SLOPSHOPPER

hope

Thinking discipline for AI work. Clarify intent, shape approach, consult experts, guard unsupervised work, hand work back so you own it. The slop hook needs…

panebandtoastpromptprocess
★ 38v13.6.0MITupdated 2026-10-21saadshahd/moo.md/hope
A shopper browsing a rack in a slop shop
README

skills.sh

Why introduce friction? Because YOU the human end up being the world model. The agent is just your hands.

moo/hope doesn't build, and doesn't author your code, rules, or taste. It works alongside build tooling like superpowers.

One idea runs through every layer: never delegate a decision.

Installation (30-second setup)

Two ways in, two philosophies. The Claude Code plugin installs each layer as a managed bundle that updates when I ship — you subscribe rather than fork. skills.sh copies editable skill files into your project, on any agent, so you can make them your own. Pick one — installing both leaves you with every skill twice.

1. Get the skills

/plugin marketplace add saadshahd/moo.md
/plugin install hope@moo.md

hope is the decision loop, and the reason to be here. More layers ship from the same marketplace: hold@moo.md, comprehension at your own pace, sound@moo.md, code taste as installable rules, and hunch@moo.md, experiments that graduate or die.

npx skills@latest add saadshahd/moo.md

Pick the skills you want and the agents to install them on — but take hope and hold whole if you take them at all: their skills call each other by name, and a missing one stops the skill that called it. sound and hunch have no such requirement.

They land as ordinary files you own — flat, and without the plugin prefix, so hope:intent arrives as intent and sound:review as review. Watch for collisions with skills you already have.

2. Run the loop

/hope:full <your seed>

Or run the stages directly — /hope:intent <your seed>, then /hope:shape <your intent>.

A loop

The loop is pure decision work. You drive it slowly, in your own context.

Every piece of work starts as a raw <seed>, the rough thing you fully typed. It is the one artifact that is fully yours.

/intent and /shape do not make the seed more honest. They make it explicit and specified. Each surfaces a decision as an interactive question, every choice previewed, a few at a time, and you answer. Every added detail stays yours because you chose it. /intent turns the <seed> into a confirmed statement of what you want. /shape turns that <work order> into a chosen approach before any code exists.

The outcome is short enough to carry comfortably outside the context window.

The loop

An anchor

freeze anchors the work to what is observed, not what you remember. When a stage depends on state that lives outside the repo — a service, a database, a queue, live logs — that state keeps moving, and memory of it goes stale the moment you look away.

freeze snaps the slice your work touches into one immutable value: every fact observed live or named as an open gap, never inferred. The stages decide against a fact, not a guess. It is the ground the other three stand on — and repo-local work skips it.

freeze

A mode

router is the line between deciding and doing.

You keep every decision. The session spawns agents and verifies their output, doing no work itself — only tactical, observable work fans out: implement, test, verify, audit, explore.

This is also what stops compaction from silently rewriting your context. The verbose doing never enters your main thread, so it can never quietly mutate what you decided.

Deciding stays, doing leaves

Overview

The trapLayerGuard
AI fills in your decisions/hope:intent & /hope:shapeinteractive questions, each choice previewed
compaction mutates & drifts your context/hope:routerdoing stays out, deciding stays in
stale or remembered external state/hope:freezesnapshot facts, never infer

Reading

Source 2 files
hooks/slop.tsx 483 lines
1import type { Register } from "claude-code";
2import { update } from "claude-code";
3import type { Chosen, Finding, Mark, Slop } from "../slop.d.ts";
4
5// After a main-thread turn that edited repo-bound files, judge.sh judges them off the turn.
6// A `slop N` button waits above the prompt. It opens a pane showing one finding at a time as the
7// diff that fixes it, and the row turns into the accept, edit or reject choice for that finding: the
8// row already holds the keys, which a pane opened from it would not get. Nothing here starts a turn.
9
10const SLOP = { plugin: "hope", key: "slop" } as const;
11const PANE = "slop";
12
13const EMPTY: Slop = {
14  findings: [],
15  cursor: 0,
16  marks: [],
17  reviewing: false,
18  editing: false,
19  chosen: [],
20  applied: [],
21  seen: [],
22  offset: 0,
23};
24
25const EDIT_TOOLS = new Set(["Edit", "Write", "MultiEdit", "NotebookEdit"]);
26
27export const FIX_STEM = "Fix the slop findings ";
28export const ADDRESSED = "Addressed slop findings";
29export const MOVED =
30  "the file changed since the judge read it; accept sends this to Claude";
31
32// ---- pure ----
33
34type Message = {
35  role: string;
36  toolUses?: {
37    tool: string;
38    input: Record<string, unknown>;
39    isError?: true;
40  }[];
41};
42
43/** The files the messages from `offset` on edited, each once. A refused or failed edit
44 * changed nothing, so it names no file. */
45export function touchedFiles(messages: Message[], offset: number): string[] {
46  const paths = messages.slice(offset).flatMap((m) =>
47    m.role === "assistant"
48      ? (m.toolUses ?? []).flatMap((u) => {
49          const p = u.input.file_path ?? u.input.notebook_path;
50          return EDIT_TOOLS.has(u.tool) && !u.isError && typeof p === "string"
51            ? [p]
52            : [];
53        })
54      : [],
55  );
56  return [...new Set(paths)];
57}
58
59const HEADER = /^(.+?):(\d+) \| (.+?) \| (.+)$/;
60
61/** judge.sh's output as findings: none when it printed nothing or CLEAN first. A header
62 * "<file>:<line> | <rule> | <claim>" starts a finding and the "- " / "+ " lines after it are its
63 * change, a bare "-" or "+" being a blank line of it. Every other line after a header, a code fence
64 * say, belongs to that finding and is dropped; before any header, a line is a finding of its text alone. */
65export function parseFindings(stdout: string): Finding[] {
66  const lines = stdout.split("\n").filter((l) => l.trim() !== "");
67  if (lines.length === 0 || lines[0].trim() === "CLEAN") return [];
68  const found: Finding[] = [];
69  for (const l of lines) {
70    const last = found.at(-1);
71    const m = HEADER.exec(l.trim());
72    const d = /^\s*([-+])( |$)/.exec(l);
73    if (m)
74      found.push({
75        file: m[1],
76        line: Number(m[2]),
77        rule: m[3],
78        claim: m[4],
79        before: [],
80        after: [],
81      });
82    else if (!last?.file)
83      found.push({ rule: "", claim: l.trim(), before: [], after: [] });
84    else if (d)
85      (d[1] === "-" ? last.before : last.after).push(l.slice(d[0].length));
86  }
87  return found;
88}
89
90/** One key per rule on a file, so the judge rewording a rule between turns keys it the same:
91 * lowercased, parentheticals and a leading "no " dropped. A finding with no file has no key. */
92export function findingKey(f: Finding): string | undefined {
93  if (!f.file) return undefined;
94  return `${f.file}|${f.rule}`
95    .toLowerCase()
96    .replace(/\([^)]*\)/g, "")
97    .replace(/\|no /, "|")
98    .replace(/[^a-z0-9|/._-]/g, "");
99}
100
101/** The state with a judge run's findings added. One still waiting for a decision takes the run's
102 * newer change in its place; one shown before and decided stays out; a keyless one always shows. */
103export function addFindings(s: Slop, found: Finding[]): Slop {
104  const known = new Set(s.seen);
105  const waiting = new Map(
106    s.findings.flatMap((f, i) => {
107      const k = findingKey(f);
108      return k !== undefined && i >= s.cursor ? [[k, i] as const] : [];
109    }),
110  );
111  const findings = [...s.findings];
112  for (const f of found) {
113    const k = findingKey(f);
114    const i = k === undefined ? undefined : waiting.get(k);
115    if (i !== undefined) {
116      findings[i] = f;
117      waiting.delete(k!);
118    } else if (k === undefined || !known.has(k)) {
119      if (k !== undefined) known.add(k);
120      findings.push(f);
121    }
122  }
123  return { ...s, findings, seen: [...known] };
124}
125
126/** A git status line keeps a file when it is tracked: not untracked (??), not ignored (!!). */
127export function isRepoBound(status: string): boolean {
128  return !status.startsWith("??") && !status.startsWith("!!");
129}
130
131/** A finding carries a change when it names a file and lines to take out or put in. */
132export function hasChange(f: Finding): boolean {
133  return !!f.file && f.before.length + f.after.length > 0;
134}
135
136/** `text` with the finding's change made: its "-" lines, found at its line or else in one place
137 * anywhere, swapped for its "+" lines. None when they are in no place, or in several but its line. */
138export function applyChange(text: string, f: Finding): string | undefined {
139  const lines = text.split("\n");
140  const at = (f.line ?? 1) - 1;
141  const matches = (i: number) => f.before.every((b, j) => lines[i + j] === b);
142  const starts = matches(at) ? [at] : lines.map((_, i) => i).filter(matches);
143  if (starts.length !== 1) return undefined;
144  lines.splice(starts[0]!, f.before.length, ...f.after);
145  return lines.join("\n");
146}
147
148/** The finding's change as one unified-diff hunk. */
149export function hunk(f: Finding): string {
150  const line = f.line ?? 1;
151  return [
152    `@@ -${line},${f.before.length} +${line},${f.after.length} @@`,
153    ...f.before.map((l) => `-${l}`),
154    ...f.after.map((l) => `+${l}`),
155  ].join("\n");
156}
157
158/** The state after deciding the finding under the cursor. Past the last one, the review ends:
159 * the findings for Claude wait for the hand-off and decided findings leave. An accepted or edited
160 * finding's key is forgotten, so the same rule broken there again shows again; a rejected one
161 * stays quiet. An accepted finding goes to Claude as one to fix when accept wrote nothing, and as one
162 * the person fixed when it wrote its change. */
163export function decide(s: Slop, mark: Mark): Slop {
164  if (!s.findings[s.cursor]) return s;
165  const marks = [...s.marks, mark];
166  const cursor = s.cursor + 1;
167  if (cursor < s.findings.length)
168    return { ...s, cursor, marks, editing: false };
169  const decided = marks.map((m, i) => ({ m, finding: s.findings[i]! }));
170  const taken = decided.filter(({ m }) => m.kind !== "reject");
171  const forget = new Set(taken.map(({ finding }) => findingKey(finding)));
172  const chosen = decided.flatMap(({ m, finding }): Chosen[] => {
173    if (m.kind === "edit") return [{ finding, note: m.note }];
174    if (m.kind === "accept" && !m.wrote) return [{ finding }];
175    return [];
176  });
177  const applied = decided.flatMap(({ m, finding }) =>
178    m.kind === "accept" && m.wrote ? [finding] : [],
179  );
180  return {
181    ...s,
182    findings: [],
183    cursor: 0,
184    marks: [],
185    reviewing: false,
186    editing: false,
187    chosen: [...s.chosen, ...chosen],
188    applied: [...s.applied, ...applied],
189    seen: s.seen.filter((k) => !forget.has(k)),
190  };
191}
192
193/** `text` ending in the line that says slop findings were addressed, once. */
194export function addressed(text: string): string {
195  const t = text.trimEnd();
196  if (t.endsWith(ADDRESSED)) return t;
197  return t ? `${t}\n${ADDRESSED}` : ADDRESSED;
198}
199
200/** A finding as Claude reads it: located, with the change the judge suggested. */
201function located(f: Finding): string[] {
202  return f.file
203    ? [
204        `${f.file}:${f.line} — ${f.claim} (${f.rule})`,
205        ...f.before.map((l) => `- ${l}`),
206        ...f.after.map((l) => `+ ${l}`),
207      ]
208    : [f.claim];
209}
210
211/** How the chosen findings read to Claude: each located, with the person's words over the
212 * judge's change when they edited it. */
213export function handoff(chosen: Chosen[]): string {
214  return [
215    "Slop findings to fix:",
216    ...chosen.flatMap(({ finding, note }) => [
217      ...located(finding),
218      ...(note
219        ? [`The person's edit, which wins over the change above: ${note}`]
220        : []),
221    ]),
222  ].join("\n");
223}
224
225/** How the changes the person accepted into files read to Claude, with what to do about them. */
226export function appliedNote(applied: Finding[]): string {
227  return [
228    "After your last turn the person wrote these slop fixes into the files; they are not committed:",
229    ...applied.flatMap(located),
230    "Commit them the way you commit your own work here.",
231  ].join("\n");
232}
233
234// ---- effects ----
235
236async function readSlop($: any): Promise<Slop> {
237  const { value } = await $.state.get(SLOP);
238  return { ...EMPTY, ...value };
239}
240
241function change($: any, fn: (s: Slop) => Slop): Promise<unknown> {
242  return update($, SLOP, (s: Slop | undefined) => fn({ ...EMPTY, ...s }));
243}
244
245async function repoBound($: any, files: string[]): Promise<string[]> {
246  const kept = await Promise.all(
247    files.map(async (f) => {
248      const dir = f.slice(0, f.lastIndexOf("/")) || "/";
249      const r = await $.process
250        .run([
251          "git",
252          "-C",
253          dir,
254          "status",
255          "--porcelain",
256          "--ignored=matching",
257          "--",
258          f,
259        ])
260        .catch(() => undefined);
261      // No git, or no worktree holds the file: out.
262      return r && r.exitCode === 0 && isRepoBound(r.stdout) ? f : undefined;
263    }),
264  );
265  return kept.filter((f): f is string => f !== undefined);
266}
267
268async function judge($: any, files: string[]): Promise<void> {
269  const r = await $.process.run([`${$.plugin.root}/hooks/judge.sh`], {
270    cwd: await $.session.root(),
271    stdin: files.join("\n") + "\n",
272    timeoutMs: 600_000,
273  });
274  if (r.exitCode !== 0) {
275    const why = `judge.sh exited ${r.exitCode}: ${r.stderr.trim().split("\n")[0].slice(0, 200)}`;
276    // The same failure shows once a session, not on every edit turn.
277    const { seen } = await readSlop($);
278    if (seen.includes(`error|${why}`)) return;
279    await change($, (s) => ({ ...s, seen: [...s.seen, `error|${why}`] }));
280    throw new Error(why);
281  }
282  const found = parseFindings(r.stdout);
283  if (found.length === 0) return;
284  await change($, (s) => addFindings(s, found));
285}
286
287export async function afterTurn($: any): Promise<void> {
288  const messages = await $.session.messages();
289  const { offset } = await readSlop($);
290  await change($, (s) => ({ ...s, offset: messages.length }));
291  const files = await repoBound($, touchedFiles(messages, offset));
292  if (files.length) await judge($, files);
293}
294
295async function openReview($: any): Promise<void> {
296  await change($, (s) => ({ ...s, reviewing: true }));
297  const r = await $.ui.open({ id: PANE, title: "slop", closeOnEscape: true });
298  if (!r.isPlaced) {
299    await change($, (s) => ({ ...s, reviewing: false }));
300    $.ui.toast(`hope slop: ${r.reason}`);
301  }
302}
303
304// The last decision ends the review: the pane closes, and when any finding waits for Claude the
305// stem goes in the prompt box for the person to finish. While a change accept wrote waits to reach
306// Claude, the box's last line says the findings were addressed, under the stem or the person's draft.
307async function choose($: any, mark: Mark): Promise<void> {
308  await change($, (s) => decide(s, mark));
309  const s = await readSlop($);
310  if (s.reviewing) return;
311  await $.ui.close({ id: PANE });
312  if (!s.chosen.length && !s.applied.length) return;
313  const text = s.chosen.length ? FIX_STEM : (await $.prompt.read()).text;
314  await $.prompt.fill({ text: s.applied.length ? addressed(text) : text });
315}
316
317/** The finding's file with its change made, and where to write it. None when the finding carries no
318 * change, or the file changed since the judge read it: gone, or no longer holding its "-" lines in
319 * one place. */
320async function changed(
321  $: any,
322  f: Finding,
323): Promise<{ path: string; text: string } | undefined> {
324  if (!hasChange(f)) return undefined;
325  const path = f.file!.startsWith("/")
326    ? f.file!
327    : `${await $.session.root()}/${f.file}`;
328  if (!(await $.fs.exists(path))) return undefined;
329  const text = applyChange(await $.fs.read(path), f);
330  return text === undefined ? undefined : { path, text };
331}
332
333// A change the file no longer holds goes to Claude, who reads the file as it is now.
334async function accept($: any): Promise<void> {
335  const { findings, cursor } = await readSlop($);
336  const f = findings[cursor];
337  const done = f && (await changed($, f));
338  if (done) await $.fs.write(done.path, done.text);
339  await choose($, { kind: "accept", wrote: !!done });
340}
341
342// A failure shows as a toast; the session goes on (hooks fail open).
343function loud($: any, work: Promise<unknown>): void {
344  work.catch((err) => $.ui.toast(`hope slop: ${err?.message ?? err}`));
345}
346
347// ---- hooks ----
348
349export const register: Register = (on) => {
350  on("turn.complete", async ($, e, next) => {
351    const r = await next(e);
352    // The judge runs past this dispatch, so the turn's end is never held.
353    if (!e.agentId) loud($, afterTurn($));
354    return r;
355  });
356
357  // The chosen findings reach Claude only with the person's own sentence, on their Enter; the
358  // changes accept wrote, only with a prompt that keeps the addressed line.
359  on("prompt.submit", async ($, e, next) => {
360    const s = await readSlop($);
361    const fix = s.chosen.length > 0 && e.text.startsWith(FIX_STEM.trim());
362    const told = s.applied.length > 0 && e.text.includes(ADDRESSED);
363    if (!fix && !told) return next(e);
364    await change($, (t) => ({
365      ...t,
366      chosen: fix ? [] : t.chosen,
367      applied: told ? [] : t.applied,
368    }));
369    return next({
370      ...e,
371      context: [
372        ...(e.context ?? []),
373        ...(fix ? [handoff(s.chosen)] : []),
374        ...(told ? [appliedNote(s.applied)] : []),
375      ],
376    });
377  });
378
379  on("ui.render", { component: "AbovePrompt" }, async ($, e, next) => {
380    const below = await next(e);
381    if (e.props.hasSurvey) return below;
382    const s = await readSlop($);
383    if (s.findings.length === 0) return below;
384    const els = $.ui.resolve(e);
385    const { Box, Text, Button } = els;
386    // The mobile app draws no field, so there a finding offers no edit.
387    const Input = "Input" in els ? els.Input : undefined;
388    const count = (
389      <Text dimColor>{`slop ${s.cursor + 1} of ${s.findings.length}`}</Text>
390    );
391    return (
392      <Box flexDirection="column">
393        {s.reviewing && s.editing && Input ? (
394          <Box gap={1}>
395            {count}
396            <Input
397              key="slop-note"
398              label="edit ›"
399              placeholder="what Claude should do instead; empty goes back"
400              submitLabel="keep for Claude"
401              autoFocus
402              onSubmit={(v: string) =>
403                loud(
404                  $,
405                  v.trim()
406                    ? choose($, { kind: "edit", note: v.trim() })
407                    : change($, (t) => ({ ...t, editing: false })),
408                )
409              }
410            />
411          </Box>
412        ) : s.reviewing ? (
413          <Box gap={1}>
414            {count}
415            <Button
416              key="slop-accept"
417              label="accept"
418              autoFocus
419              onPress={() => loud($, accept($))}
420            />
421            {Input ? (
422              <Button
423                key="slop-edit"
424                label="edit"
425                onPress={() =>
426                  loud(
427                    $,
428                    change($, (t) => ({ ...t, editing: true })),
429                  )
430                }
431              />
432            ) : null}
433            <Button
434              key="slop-reject"
435              label="reject"
436              onPress={() => loud($, choose($, { kind: "reject" }))}
437            />
438          </Box>
439        ) : (
440          <Button
441            key="slop-open"
442            label={`slop ${s.findings.length}`}
443            onPress={() => loud($, openReview($))}
444          />
445        )}
446        {below}
447      </Box>
448    );
449  });
450
451  // Closing the pane ends the review; the undecided findings wait for the next one.
452  on("ui.close", async ($, e, next) => {
453    const r = await next(e);
454    if (e.id === PANE)
455      await change($, (s) => ({ ...s, reviewing: false, editing: false }));
456    return r;
457  });
458
459  // The finding under the cursor, whole: where it is, what is wrong, and the diff that fixes it,
460  // or that the file moved under that diff since the judge read it.
461  on("ui.render", { component: "Pane" }, async ($, e, next) => {
462    if (e.requestId !== PANE) return next(e);
463    const s = await readSlop($);
464    const f = s.findings[s.cursor];
465    const { Box, Text, Code } = $.ui.resolve(e);
466    if (!f) return <Text dimColor>no findings left</Text>;
467    const moved = hasChange(f) && !(await changed($, f));
468    return (
469      <Box flexDirection="column" paddingX={1} gap={1}>
470        <Text bold wrap="wrap">
471          {f.file ? `${f.file}:${f.line}` : f.claim}
472        </Text>
473        {f.file ? <Text wrap="wrap">{f.claim}</Text> : null}
474        {hasChange(f) ? (
475          <Code key="slop-diff" format="diff" path={f.file} source={hunk(f)} />
476        ) : null}
477        {moved ? <Text wrap="wrap">{MOVED}</Text> : null}
478        {f.rule ? <Text dimColor>{f.rule}</Text> : null}
479      </Box>
480    );
481  });
482};
483
slop.d.ts 56 lines
1// hope's contract: the session state the slop judge writes and its review reads.
2// Held by the host for the session only. Callers spell the ref as a literal in their own file:
3// { plugin: "hope", key: "slop" }.
4
5/** One judge finding. A line the judge wrote in another shape keeps only its text as `claim`. */
6export type Finding = {
7  file?: string;
8  line?: number;
9  /** The violated preference, a few words. */
10  rule: string;
11  /** What is wrong there, one sentence. */
12  claim: string;
13  /** The judge's suggested change: the current lines from `line` on, and their replacement. */
14  before: string[];
15  after: string[];
16};
17
18/** The decision on one finding: accept writes its change to the file (or hands it to Claude when it
19 * wrote none: the finding carries no change, or the file no longer holds its "-" lines), edit hands
20 * it to Claude with what the person wants instead, reject drops it. */
21export type Mark =
22  | { kind: "accept"; wrote: boolean }
23  | { kind: "edit"; note: string }
24  | { kind: "reject" };
25
26/** A finding for Claude to fix, with the person's words when they edited it. */
27export type Chosen = { finding: Finding; note?: string };
28
29export type Slop = {
30  /** Findings waiting for a decision, oldest first. */
31  findings: Finding[];
32  /** The finding the review asks about; the ones before it are decided. */
33  cursor: number;
34  /** The decision on each finding before the cursor, in order. */
35  marks: Mark[];
36  /** The review pane is open, so the row above the prompt asks accept, edit or reject. */
37  reviewing: boolean;
38  /** The row holds the field for the edit of the finding under the cursor. */
39  editing: boolean;
40  /** Findings for Claude; the next submit that keeps the fix stem carries them. */
41  chosen: Chosen[];
42  /** Findings whose change accept wrote into the file; the next submit that keeps the addressed
43   * line tells Claude about them. */
44  applied: Finding[];
45  /** Keys of every finding or failure shown this session, so each shows once. */
46  seen: string[];
47  /** How many session messages were already scanned for touched files. */
48  offset: number;
49};
50
51declare module "claude-code" {
52  interface PluginState {
53    hope: { slop: Slop };
54  }
55}
56