diff --git a/bin/loop-claude b/bin/loop-claude index 267d41e9..47307d93 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -14,17 +14,17 @@ three times running. Exit 2: the human is needed and no terminal is attached, or without them typing anything. Before a handoff every worktree is marked trusted in ~/.claude.json. Each project has one session, "A ~/code/ auto-mode" (the absolute path outside ~/code), -resumed while present and deleted when the chunk finishes. Its transcript is archived under -$AUTO_MODE_TRANSCRIPTS (default ~/.claude/auto-mode-transcripts//) whenever the human is asked -and when the chunk finishes. JUDGE_MODEL and WORKER_MODEL override the model the project's -Claude Code settings pick. A change to this file takes effect at the next round boundary, once the -new file answers --help. +deleted when the chunk finishes. Its transcript is archived under $AUTO_MODE_TRANSCRIPTS (default +~/.claude/auto-mode-transcripts//) whenever the human is asked and when the chunk finishes. +JUDGE_MODEL and WORKER_MODEL override the model the project's Claude Code settings pick. A change to +this file takes effect at the next round boundary, once the new file answers --help. Claude Code internals this rests on, observed on 2.1.282: - The transcript is ~/.claude/projects/*/.jsonl, one JSON object per line. A / folder and .superseded-*/ and .orphaned-*.jsonl siblings belong to the same session. -- A typed human turn is a "user" entry without isMeta whose message.content is a string not starting - with "<", or a list of "text" parts none of which starts with "[Request interrupted". +- Claude Code writes "user" entries of its own: isMeta ones, tool_result lists, strings starting with + "<" ( and its kind) and text parts starting with "[Request interrupted". A typed human + turn is any other "user" entry. - An "assistant" entry, in the transcript and in --output-format stream-json, carries message.content parts of type "text" (text) and "tool_use" (name, input); stream-json ends with a "result" event. - `claude -p --output-format json --json-schema` returns the verdict under "structured_output".