Name the session, the archive folder and its env var loop-claude #26
+2
-1
@@ -6,8 +6,9 @@
|
||||
- `loop-claude <task>` 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/`, 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`.
|
||||
|
||||
+9
-9
@@ -15,12 +15,12 @@ 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 <path> auto-mode", <path> being the checkout relative to ~/code,
|
||||
Each project has one session, "A <path> loop-claude", <path> 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/<path>/) 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/<path>/ (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/*/<session-id>.jsonl, one JSON object per line. A <session-id>/
|
||||
@@ -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):
|
||||
@@ -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",
|
||||
|
||||
@@ -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):
|
||||
@@ -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")
|
||||
|
||||
|
||||
+1
-1
@@ -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 is uuid5 of the session name, "A <path> 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
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -14,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.
|
||||
|
||||
Reference in New Issue
Block a user