Keep every answer on record: the judge reads CLAUDE.md, holds a chunk open for an unrecorded answer, and archives each answer it quotes
This commit is contained in:
@@ -4,13 +4,15 @@ usage: loop-claude <task>
|
||||
|
||||
Run it anywhere inside a project checkout whose README.md has ## Goals and ## Audience, the
|
||||
premises; the task runs at the checkout root. Each cycle a worker runs the task. A judge then reads
|
||||
the transcript's end, the premises, and the project's records: AGENTS.md and docs/decisions.md,
|
||||
where they exist. It rules whether the chunk, the work of one PR, is finished. A choice the worker
|
||||
made that the premises or the records settle is not asked about. When the worker asks a question
|
||||
they answer, the judge quotes the answer, loop-claude prints it, and the worker resumes with it. A
|
||||
quote they do not hold word for word is dropped, and the question goes to the human. So does a
|
||||
question asked again after its answer. The fourth question they answer in one cycle goes to the
|
||||
human too, with the quote.
|
||||
the transcript's end, the premises, and the records: the project's AGENTS.md and docs/decisions.md
|
||||
and the human's ~/.claude/CLAUDE.md, where they exist. It rules whether the chunk, the work of one
|
||||
PR, is finished. It is not while an answer the human typed in it, that a later chunk could need, is
|
||||
recorded nowhere: not in the premises, AGENTS.md or docs/decisions.md, nor in a code comment the
|
||||
transcript shows the worker writing. A choice the worker made that the premises or the records
|
||||
settle is not asked about. When the worker asks a question they answer, the judge quotes the
|
||||
answer, loop-claude prints it, and the worker resumes with it. A quote they do not hold word for
|
||||
word is dropped, and the question goes to the human. So does a question asked again after its
|
||||
answer. The fourth question they answer in one cycle goes to the human too, with the quote.
|
||||
A question only the human can answer, or a release ready to cut, is an interrupt: `claude --resume`
|
||||
on the terminal, every worktree first marked trusted in ~/.claude.json. An unfinished chunk resumes
|
||||
its session next cycle; the next chunk starts a fresh session.
|
||||
@@ -22,12 +24,12 @@ interrupt, and as every cycle ends, Ctrl-C and a failure included, the session's
|
||||
copied to $LOOP_CLAUDE_TRANSCRIPTS/<key>/<chunk>/<sha256>.jsonl (default
|
||||
~/.claude/loop-claude-transcripts), named by its hash. <chunk> is the hash of the transcript's first
|
||||
line with a timestamp, the same for every cycle of a chunk. Beside the copy, <sha256>.outcomes.md
|
||||
holds the verdict, with the transcript passage the judge rested it on, and why the loop stopped. The
|
||||
verdict and the stop each open with their UTC time. Claude Code keeps a folder per session beside
|
||||
its transcript, holding the subagents' transcripts among other files; that folder, and every other
|
||||
file named after the session except the transcript, are copied into <chunk>/session/. A file there
|
||||
is replaced only by a version that grew from it. A file Claude Code rewrote lands beside its copy as
|
||||
<name>.<hash of its content>.
|
||||
holds the verdict, with the transcript passage the judge rested it on; each answer quoted from the
|
||||
records, with the question it answers; and why the loop stopped. Each of these opens with its UTC
|
||||
time. Claude Code keeps a folder per session beside its transcript, holding the subagents'
|
||||
transcripts among other files; that folder, and every other file named after the session except
|
||||
the transcript, are copied into <chunk>/session/. A file there is replaced only by a version that
|
||||
grew from it. A file Claude Code rewrote lands beside its copy as <name>.<hash of its content>.
|
||||
|
||||
Every claude loop-claude starts runs the project's model, saved per <key> in
|
||||
~/.claude/loop-claude-models.json and read each cycle; a project without an entry, as on its first
|
||||
@@ -40,7 +42,8 @@ loop-claude --help succeeds: the loop reloads into the edited script.
|
||||
Exit 1, saying why, when:
|
||||
- no task is given
|
||||
- git cannot start or finds no checkout
|
||||
- README.md, or AGENTS.md or docs/decisions.md where they exist, cannot be read or is not UTF-8
|
||||
- README.md, or AGENTS.md, docs/decisions.md or ~/.claude/CLAUDE.md where they exist, cannot be
|
||||
read or is not UTF-8
|
||||
- README.md holds no premises
|
||||
- the models file cannot be read or written
|
||||
- claude leaves no transcript
|
||||
@@ -108,7 +111,7 @@ def run_loop(argv: list[str], env: typing.Mapping[str, str], paths: Paths, launc
|
||||
premises = read_premises(loop_run.root)
|
||||
if isinstance(premises, Stop):
|
||||
return premises
|
||||
records = read_records(loop_run.root)
|
||||
records = read_records(loop_run.root, paths.claude_md)
|
||||
if isinstance(records, Stop):
|
||||
return records
|
||||
models = get_or_ask_models(key, paths, env, effects)
|
||||
|
||||
Reference in New Issue
Block a user