How I work with AI

One agent job, followed from its state file to its result.

I run six recurring agent jobs. This is one of them, the dream loop, which keeps my agent memory tidy. Every file below is real. Follow one cycle from the file it reads to the note it leaves for the next cycle.

The state file

Each job keeps its state in a file, so a session can end at any point and the next one picks up from the file. The success line says what done means, and who checks it.

loops/dream-loop.md

loop: dream-loop
success_criteria: >
  Either (a) thresholds unmet and the cycle noops cheaply, or (b) a scoped dream
  pass ran, a verifier subagent cleared the diff, reversible changes were committed,
  and any gated items are parked in Pending review.
autonomy: semi-autonomous  # memory/knowledge edits, snapshot commit, and both
  cleanup scripts unattended; hook edits + external suggestions gated
The success line names a verifier and the pending review list. The autonomy line says which actions run without me. Shortened. From my home setup.

The verifier’s brief

Before anything is committed, a fresh agent that never saw the cycle’s reasoning grades the diff. It does not fix anything.

skills/dream-loop.md

You are verifying a memory-consolidation diff, not producing one. ... Flag, with
file and line: (a) any fact or actionable detail that was dropped or blurred in a
merge, (b) any broken [[wikilink]] where the target memory no longer exists, (c) any
feedback memory that was edited or deleted, (d) any over-aggressive prune where a
still-relevant memory was removed. ... Do not fix anything. Use at most 30 tool
calls. Return at most 300 words.
The verifier's brief, from the step that runs before the commit. It looks for what the pass lost. Shortened. From my home setup.

One run

On November 5 the job tried to move rules out of my always-loaded file. The verifier passed the change, a behavior test did not, and the job reverted it. The same day it shortened the file in place instead, and the verifier scored that 8.5 after three fixes.

loops/dream-loop.md

- 2026-11-05 — CLAUDE.md shortened in place, nothing moved. Mark refused a budget
  raise and approved condensing the STE section from 3.2 KB to about 1.2 KB.
  Verifier 8.0, then 8.5 after 3 fixes. ...
- 2026-11-05 — full `/dream` (Mark present, after the loop cycle). ... Move plan rows
  1, 2, 3, 5 applied, verifier 8.0, behavior test failed (66 vs 53), all reverted.
  ...
Two entries from the run log, newest first. The first is the fix for the second. Shortened. From my home setup.

What waits for me

Anything I cannot undo goes to the pending review list. The job writes a proposal there and does not act.

skills/dream-loop.md

- Gated (one-way door — park in `## Pending review`, do NOT do unattended): editing
  `scripts/skill-trigger-check.sh`, deleting a feedback memory, any other external
  post or write (email, chat, GitHub), ... the startup-load move plan, ... Write the
  proposal into `## Pending review` for the user instead.
The rule for what the job parks instead of doing. Only I clear the list. Shortened. From my home setup.

The result

The failed move is now a rule in the state file, so the next cycle starts with it.

loops/dream-loop.md

## Next action

... AGENTS.md has no headroom at 8k: a new rule needs a cut. Do not move always-on
rules behind pointers: that failed on 2026-11-05 (66 vs 53). Shorten in place. The
routine cycle: check thresholds. ...
The note the job left for itself. The failed test became an instruction. Shortened. From my home setup.

Hooks, skills, and writing rules

The dream loop runs on rules that every session shares. A rule in a prompt can be forgotten, so the ones that matter most run as hooks. One hook hands a long session to a fresh one at 100 tool calls or 500k tokens, with its state on disk. Another stops a command that hangs my machine and tells the agent what to do instead.

scripts/block-python-stdin.js

// PreToolUse hook (Bash): block Python that reads its script from stdin.
// Exit 2 blocks the tool call and shows stderr to the agent.
...
if (patterns.some((re) => re.test(cmd))) {
  process.stderr.write(
    'BLOCKED: Python that reads its script from stdin (`python -`, `python <<EOF`, `| python`) hangs on this machine.\n' +
      'Write the script to a file in your scratchpad directory with the Write tool, then run `python <file>.py`.\n' +
      'For a one-liner, `python -c "..."` is fine.\n'
  );
  process.exit(2);
}
A hook that blocks one command pattern. Its message gives the agent the fix. Shortened. From my home setup.

Skills are instructions an agent loads when a task matches, such as the dream loop’s own steps above. Everything an agent writes for me follows ASD-STE100, a simplified technical English from aircraft maintenance manuals: short sentences, active voice, one word for one meaning.

Shown elsewhere