Merge remote-tracking branch 'origin/main' into item-420

# Conflicts:
#	bin/loop_claude/test_loop_claude.py
#	bin/loop_effects/test_effects.py
This commit is contained in:
2026-11-19 07:46:23 +01:00
162 changed files with 8606 additions and 1433 deletions
+13 -10
View File
@@ -49,7 +49,7 @@ claude session is named "A <key> loop-claude <window>", so a rerun resumes a chu
deleted when the chunk finishes. A fresh worker is told the items the project's other chunks hold,
running or stopped: each one's own and those on its latest `Chunk items:` line, and leaves them out.
A question only the human can answer is an interrupt (bin/loop_claude/cycle/interrupt.py).
A question only the human can answer is an interrupt (bin/agent_cycle/interrupt.py).
loop-claude prints the question in the chunk's window and rings its bell. Until it is answered the
window's name ends in " ?", as in "item-372 ?", which tmux's status bar shows. The human answers it
there:
@@ -64,7 +64,10 @@ config sets notifier, loop-claude also sends the human each question, naming its
<session>:<window>, each release ready to cut and each stop as a DM, as bin/notify sends it. Four
stops are left out: Ctrl-C, printing this help, the loop-claude that started the windows once it
attaches or prints how to, and a loop whose chunk finished once it started the next chunks. A DM
that fails is said on stderr, and the loop goes on.
that fails is said on stderr, and the loop goes on. Where no answer has come 10 minutes before the
worker's hour-long prompt cache expires, and the worker's context holds at least 60k tokens,
loop-claude compacts the worker's session with `claude -p /compact` and keeps waiting, so the resume
doesn't write the whole context again.
As a chunk starts, before it is routed, loop-claude runs bin/chunk-preflight --worktree, adding
--item <ID> in a window named for an item, and quotes what it prints in the first prompt
@@ -83,13 +86,13 @@ never ends. Every 5 minutes without output from that claude after its final resu
stops each of its shells and what runs below them, unless a shell has written output in the last 3
minutes, runs chunk-pr or run-heavy, or holds a heavy slot. It prints each stop and appends it, with
the UTC time, to lingering-workers.md at the project's folder in that archive
(bin/loop_claude/cycle/lingering_workers.py).
(bin/agent_cycle/lingering_workers.py).
Before each worker starts, loop-claude waits until at least a quarter of the machine's memory is
available (bin/machine_load/memory.py).
Each worker's claude, the session /talk opens and the subagents either launches run with a 200k
auto-compact window (CLAUDE_CODE_AUTO_COMPACT_WINDOW, bin/loop_claude/cycle/worker.py), so each
auto-compact window (CLAUDE_CODE_AUTO_COMPACT_WINDOW, bin/agent_cycle/worker.py), so each
compacts its context at about 170k tokens. They also save a Bash result of more than 6,000
characters to a file and see its path and the first 2,000 characters (BASH_MAX_OUTPUT_LENGTH,
bin/claude_code/output_limits.py).
@@ -108,13 +111,13 @@ models on another; a chunk no item routes runs on the project's model. The worke
rungs it launches its reviews on. The worker's rung steps up as a chunk stays unfinished, when the
worker names on its `Chunk items:` line an item that picks a higher rung, or when the judge finds
in the transcript an escalation trigger that fired and the worker asked for a higher rung. The
rules are in bin/loop_claude/routing.py and bin/model_routing/ladder.py, the choice of
rules are in bin/agent_cycle/routing.py and bin/model_routing/ladder.py, the choice of
each review's rung in bin/model_routing/review_choice.py, and the prompts' wording in
bin/loop_claude/cycle/prompts.py. Each verdict, interrupt, quoted answer, stop and
step-up in the archive ends with a Worker: line, the route as JSON (Route.worker_line in
bin/model_routing/route.py); a rerun resumes an open chunk on the latest route named there. A
plan or an archive that cannot be read or parsed is said on stderr, and the chunk is routed
without it.
bin/loop_claude/cycle/prompts.py and bin/agent_cycle/worker_prompts.py. Each verdict, interrupt,
quoted answer, stop and step-up in the archive ends with a Worker: line, the route as JSON
(Route.worker_line in bin/model_routing/route.py); a rerun resumes an open chunk on the latest
route named there. A plan or an archive that cannot be read or parsed is said on stderr, and the
chunk is routed without it.
The ladder is a JSON file, each rung a model's full name and an effort of low, medium, high, xhigh
or max: