From 6830500831203c9623bf147ef64aa0919207dd80 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 00:12:45 +0200 Subject: [PATCH 1/4] Name the session, the archive folder and its env var loop-claude --- CHANGELOG.md | 1 + bin/loop-claude | 8 ++++---- bin/test_loop_claude.py | 4 ++-- docs/decisions.md | 2 +- todo.md | 1 - 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7a4697f..c1942922 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - `loop-claude ` runs a project's next chunk cycle after cycle, interrupting only for a decision that is yours or a release ready to cut. - `loop-claude` exits 1 when the judge fails three times running; a verdict missing a field or quoting nothing in the transcript is a failure. - `loop-claude` exits 2 when an interrupt gets no answer, saying why: stdin or stdout is not a terminal, or nothing was typed. Rerunning resumes the session. +- `loop-claude` archives each session's transcript under `~/.claude/loop-claude-transcripts//`; `LOOP_CLAUDE_TRANSCRIPTS` overrides the root. - `loop-claude --help` names the Claude Code version its transcript, session and trust handling were observed on; check it first when an upgrade breaks a cycle. - `loop-claude` runs the model each project's settings pick; `WORKER_MODEL` and `JUDGE_MODEL` override it. This repo runs on Fable 5.1. - Reviewers share one protocol for verdicts, severities, rounds and declines: `agents/review-protocol.md`. diff --git a/bin/loop-claude b/bin/loop-claude index baf685f3..dce58a49 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -15,9 +15,9 @@ Exit 2: the human is needed and stdin or stdout is not a terminal, or the interr them typing anything. Rerunning resumes the session after either exit. Before an interrupt every worktree is marked trusted in ~/.claude.json. -Each project has one session, "A auto-mode", being the checkout relative to ~/code, +Each project has one session, "A loop-claude", being the checkout relative to ~/code, or to / outside it, deleted when the chunk finishes. Its transcript is archived under -$AUTO_MODE_TRANSCRIPTS (default ~/.claude/auto-mode-transcripts//) whenever the human is asked +$LOOP_CLAUDE_TRANSCRIPTS (default ~/.claude/loop-claude-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 cycle boundary, once the new file answers --help. @@ -42,7 +42,7 @@ import sys import time import uuid -ARCHIVE = os.path.expanduser(os.environ.get("AUTO_MODE_TRANSCRIPTS", "~/.claude/auto-mode-transcripts")) +ARCHIVE = os.path.expanduser(os.environ.get("LOOP_CLAUDE_TRANSCRIPTS", "~/.claude/loop-claude-transcripts")) RELOAD_BASELINE = open(__file__, encoding="utf-8").read() RELOAD_CYCLE = "LOOP_CLAUDE_CYCLE" RELOAD_FAILURES = "LOOP_CLAUDE_FAILURES" @@ -110,7 +110,7 @@ def project(): def session_name(): - return f"A {project()} auto-mode" + return f"A {project()} loop-claude" def session_file(session_id): diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 941c54ed..105a9f93 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -60,12 +60,12 @@ class Project(unittest.TestCase): with unittest.mock.patch.dict(os.environ, {"HOME": "/h"}): with unittest.mock.patch("os.getcwd", return_value="/h/code/a/b"): self.assertEqual(loop.project(), "a/b") - self.assertEqual(loop.session_name(), "A a/b auto-mode") + self.assertEqual(loop.session_name(), "A a/b loop-claude") with unittest.mock.patch("os.getcwd", return_value="/h/code"): self.assertEqual(loop.project(), "h/code") with unittest.mock.patch("os.getcwd", return_value="/srv/x"): self.assertEqual(loop.project(), "srv/x") - self.assertEqual(loop.session_name(), "A srv/x auto-mode") + self.assertEqual(loop.session_name(), "A srv/x loop-claude") class WorkerArgs(unittest.TestCase): diff --git a/docs/decisions.md b/docs/decisions.md index 58ed9f40..6eee52e5 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -6,7 +6,7 @@ ## loop-claude: one session per project, at a fixed id -2026-09-21, lilleman; the rename and mirrored-path costs accepted 2026-09-25 by larv-review. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id the script's own to delete. The id derives from the checkout's path, so a rename migrates nothing: transcripts open under the old id stay in the picker until the human deletes them, a one-human audience not being worth the code, and the `auto-mode` → `loop-claude` rename in the plan ships on the same terms. A checkout outside `~/code` mirroring a path inside it would share its id; none does. Valid while the picker lists sessions by id. +2026-09-21, lilleman; the rename and mirrored-path costs accepted 2026-09-25 by larv-review. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id the script's own to delete. The id derives from the checkout's path, so a rename migrates nothing: transcripts open under the old id stay in the picker until the human deletes them, a one-human audience not being worth the code. A checkout outside `~/code` mirroring a path inside it would share its id; none does. Valid while the picker lists sessions by id. ## loop-claude: the trust file is rewritten before an interrupt diff --git a/todo.md b/todo.md index 7a6574f8..b2d777c5 100644 --- a/todo.md +++ b/todo.md @@ -4,7 +4,6 @@ Ordered by how many seats of the 2026-09-24 scoring panel (`docs/decisions.md`) named the place; each is one chunk. -- Name the session, the archive folder and its env var `loop-claude`; today they say `auto-mode`. - Pin every `CLAUDE.md` heading the agents and skills cite with a test that resolves each citation. - Define chunk, plan and release inside `JUDGE_RULES`; the judge reads nothing else. - Name the `set -u` empty-array idiom and the `@sh` eval in `statusline.sh`, one line each. -- 2.52.0 From 6d4ebd83e348768dc80f39287cc026022de56993 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 00:15:48 +0200 Subject: [PATCH 2/4] Wrap the archive line of --help --- bin/loop-claude | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/loop-claude b/bin/loop-claude index dce58a49..80150888 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -17,8 +17,8 @@ worktree is marked trusted in ~/.claude.json. Each project has one session, "A loop-claude", being the checkout relative to ~/code, or to / outside it, deleted when the chunk finishes. Its transcript is archived under -$LOOP_CLAUDE_TRANSCRIPTS (default ~/.claude/loop-claude-transcripts//) whenever the human is asked -and when the chunk finishes. +$LOOP_CLAUDE_TRANSCRIPTS (default ~/.claude/loop-claude-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 cycle boundary, once the new file answers --help. -- 2.52.0 From 69384ea1d630fab06ee1b9c0d9e2a3d08963c4fe Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 00:19:02 +0200 Subject: [PATCH 3/4] Expect LOOP_CLAUDE_WORKER_MODEL --- bin/test_loop_claude.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/test_loop_claude.py b/bin/test_loop_claude.py index 105a9f93..9119a880 100644 --- a/bin/test_loop_claude.py +++ b/bin/test_loop_claude.py @@ -83,9 +83,9 @@ class WorkerArgs(unittest.TestCase): def test_the_project_settings_pick_the_model_unless_the_environment_names_one(self): with unittest.mock.patch.dict(os.environ): - os.environ.pop("WORKER_MODEL", None) + os.environ.pop("LOOP_CLAUDE_WORKER_MODEL", None) self.assertNotIn("--model", loop.worker_args("t", "n", SESSION_ID, resuming=False)) - with unittest.mock.patch.dict(os.environ, {"WORKER_MODEL": "claude-fable-5-1"}): + with unittest.mock.patch.dict(os.environ, {"LOOP_CLAUDE_WORKER_MODEL": "claude-fable-5-1"}): args = loop.worker_args("t", "n", SESSION_ID, resuming=False) self.assertEqual(args[args.index("--model") + 1], "claude-fable-5-1") -- 2.52.0 From 8b8d1d12bff8528535bf23822de9866e5678060c Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Fri, 25 Sep 2026 00:19:02 +0200 Subject: [PATCH 4/4] Prefix the model overrides LOOP_CLAUDE_; name the session-id cause in the fixed-id decision --- CHANGELOG.md | 4 ++-- bin/loop-claude | 12 ++++++------ docs/decisions.md | 2 +- todo.md | 1 + 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1942922..c355a4a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ - `loop-claude ` runs a project's next chunk cycle after cycle, interrupting only for a decision that is yours or a release ready to cut. - `loop-claude` exits 1 when the judge fails three times running; a verdict missing a field or quoting nothing in the transcript is a failure. - `loop-claude` exits 2 when an interrupt gets no answer, saying why: stdin or stdout is not a terminal, or nothing was typed. Rerunning resumes the session. -- `loop-claude` archives each session's transcript under `~/.claude/loop-claude-transcripts//`; `LOOP_CLAUDE_TRANSCRIPTS` overrides the root. +- `loop-claude` archives each session's transcript under `~/.claude/loop-claude-transcripts/`, one folder per project; `LOOP_CLAUDE_TRANSCRIPTS` overrides the root. - `loop-claude --help` names the Claude Code version its transcript, session and trust handling were observed on; check it first when an upgrade breaks a cycle. -- `loop-claude` runs the model each project's settings pick; `WORKER_MODEL` and `JUDGE_MODEL` override it. This repo runs on Fable 5.1. +- `loop-claude` runs the model each project's settings pick; `LOOP_CLAUDE_WORKER_MODEL` and `LOOP_CLAUDE_JUDGE_MODEL` override it. This repo runs on Fable 5.1. - Reviewers share one protocol for verdicts, severities, rounds and declines: `agents/review-protocol.md`. - Skills and agents cite `CLAUDE.md` by heading; the comment and documentation bar lives there alone. - Update a main checkout with `git pull --ff-only`, never `--autostash`. diff --git a/bin/loop-claude b/bin/loop-claude index 80150888..8f611926 100755 --- a/bin/loop-claude +++ b/bin/loop-claude @@ -17,10 +17,10 @@ worktree is marked trusted in ~/.claude.json. Each project has one session, "A loop-claude", being the checkout relative to ~/code, or to / outside it, deleted when the chunk finishes. Its transcript is archived under -$LOOP_CLAUDE_TRANSCRIPTS (default ~/.claude/loop-claude-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 cycle boundary, once the new file answers --help. +$LOOP_CLAUDE_TRANSCRIPTS// (default ~/.claude/loop-claude-transcripts) whenever the human is +asked and when the chunk finishes. LOOP_CLAUDE_JUDGE_MODEL and LOOP_CLAUDE_WORKER_MODEL override the +model the project's Claude Code settings pick. A change to this file takes effect at the next cycle +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 / @@ -239,7 +239,7 @@ def worker_args(task, name, session_id, resuming): "--output-format", "stream-json", "--permission-mode", "bypassPermissions", "--verbose", - *model("WORKER_MODEL"), + *model("LOOP_CLAUDE_WORKER_MODEL"), ] @@ -278,7 +278,7 @@ def judge(task, premises, transcript): args = [ "-p", "--json-schema", json.dumps(JUDGE_SCHEMA), - *model("JUDGE_MODEL"), + *model("LOOP_CLAUDE_JUDGE_MODEL"), "--no-session-persistence", "--output-format", "json", "--permission-mode", "bypassPermissions", diff --git a/docs/decisions.md b/docs/decisions.md index 6eee52e5..257534d7 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -6,7 +6,7 @@ ## loop-claude: one session per project, at a fixed id -2026-09-21, lilleman; the rename and mirrored-path costs accepted 2026-09-25 by larv-review. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id the script's own to delete. The id derives from the checkout's path, so a rename migrates nothing: transcripts open under the old id stay in the picker until the human deletes them, a one-human audience not being worth the code. A checkout outside `~/code` mirroring a path inside it would share its id; none does. Valid while the picker lists sessions by id. +2026-09-21, lilleman; the rename and mirrored-path costs accepted 2026-09-25 by larv-review. Serves goal 4. One fixed id per project keeps the session picker at one entry per project and makes any transcript under that id the script's own to delete. The id is uuid5 of the session name, "A loop-claude", so moving the checkout or changing that name orphans open sessions: they stay in the picker until the human deletes them, migration code not being worth a one-human audience. A checkout outside `~/code` mirroring a path inside it would share its id. Valid while claude takes `--session-id` and resumes by it, and no checkout outside `~/code` mirrors a path inside it. ## loop-claude: the trust file is rewritten before an interrupt diff --git a/todo.md b/todo.md index b2d777c5..1e83dcb2 100644 --- a/todo.md +++ b/todo.md @@ -13,4 +13,5 @@ Ordered by how many seats of the 2026-09-24 scoring panel (`docs/decisions.md`) - Cut what `review-protocol.md` → "Documenting decisions" restates from `CLAUDE.md`: the decision kinds, the create-or-fix line and the record-nothing default. - Make the missing-premises exit name what is missing: `README.md` itself, a `## Goals` or `## Audience` heading, or a body under one; today all three print the same line. - Spell the false-claim rule once under `CLAUDE.md` → "Comments and documentation" with its tie-break, the doc corrected unless consumers rely on what it promises, and cite it from "Working with the codebase", "Working loop" and the README paragraph; today four spellings, two of which disagree on which side to fix. +- Derive `project()` from the checkout root, today `os.getcwd()`, so `loop-claude` run from a subdirectory joins the root's session. - Re-run the four-seat scoring panel and record the score in `docs/decisions.md`; the target is every dimension at 7.0 or above. -- 2.52.0