Run every claude the loop starts in a Claude home the commands generate from the clone #804
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
## Unreleased
|
||||
|
||||
- **`deploy-release` is gone, with no alias: `self-update` moves a clone of a release, and `cut-release` cuts one.** Take this release by cloning it, as the bullet on the loop's Claude home says, not with `deploy-release`. From then on, update with the new clone's `bin/self-update`. It takes no argument, moves the clone it ships in and names that clone in what it prints, so never run the development clone's copy. In the development clone, run `bin/cut-release` where you ran `deploy-release --cut`, and `bin/cut-release --patch <commits>` where you ran `--cut-patch <commits>`; neither takes a `<checkout>`. A cut no longer moves `~/.claude`: its stdout is the one `Done:` line, and each machine runs `self-update` afterwards. `cut-release` cuts the clone it ships in, whatever the directory it is run from, and no longer checks an origin. Its traces go to `~/.local/state/build-release/cut-release/`, and older traces stay where they are. Install no longer links `build-release` onto `PATH`: run it as `~/.claude/bin/build-release`. A link made earlier keeps working.
|
||||
- **`deploy-release` is gone, with no alias: `self-update` moves a clone of a release, and `cut-release` cuts one.** Take this release by cloning it, as `README.md` → Update says for a checkout in `~/.claude`, not with `deploy-release`. From then on, update with the new clone's `bin/self-update`. It takes no argument, moves the clone it ships in and names that clone in what it prints, so never run the development clone's copy. In the development clone, run `bin/cut-release` where you ran `deploy-release --cut`, and `bin/cut-release --patch <commits>` where you ran `--cut-patch <commits>`; neither takes a `<checkout>`. A cut no longer moves `~/.claude`: its stdout is the one `Done:` line, and each machine runs `self-update` afterwards. `cut-release` cuts the clone it ships in, whatever the directory it is run from, and no longer checks an origin. Its traces go to `~/.local/state/build-release/cut-release/`, and older traces stay where they are. Install no longer links `build-release` onto `PATH`: run it as `<clone>/bin/build-release`. Remove a link made earlier: it leads into `~/.claude`, to the old release.
|
||||
- Renamed `do-epic` to `build-epic`, with no alias. Before you update, finish your open `do-epic` chunks, since a chunk left open starts a fresh session, and stop every running `do-epic`, since one that runs across the update can't reload. Then, in each Jira project, relabel every issue that carries `do-epic-claude`, `do-epic-human` or `do-epic-release-review`, done issues included, to `build-epic-claude`, `build-epic-human` or `build-epic-release-review`, since a finished release review that keeps the old label isn't counted and `build-epic` files another. Rename each `DO_EPIC_E2E_*` variable you set to `BUILD_EPIC_E2E_*`. Nothing reads the old names. The next bullet moves the folders.
|
||||
- The setup's folders moved, and nothing reads or migrates the old ones. Before you update, stop every running `build-release` and `do-epic`. Then move `~/.claude-projects/` to `~/.config/build-release/` and `~/.config/build-release/do-epic/` to `~/.config/build-release/build-epic/`, and move `~/.claude/loop-claude-models.json` to `~/.config/build-release/models.json`; move `~/.claude/loop-claude-transcripts` to `~/.local/state/build-release/transcripts` and `~/.claude/do-epic-transcripts` to `~/.local/state/build-release/build-epic-transcripts`; move `larv-review`, `project-record`, `run-heavy` and `deploy-release` from `~/.local/state/` into `~/.local/state/build-release/`, and `~/.local/state/do-epic` to `~/.local/state/build-release/build-epic`; and delete `~/.local/state/loop-claude/`, which held only locks. Respell each setting that names `~/.claude-projects/`, such as `env-file`, and the log path in your crontab line. Where `XDG_CONFIG_HOME` or `XDG_STATE_HOME` holds an absolute path, the two folders are `build-release/` under it instead, and a chunk's tmux window is handed both variables.
|
||||
- The stability reviewer traces every path that can reach a callback, handler or hook that a change guards, background and process-wide ones included, and reports each path the guard leaves open.
|
||||
|
||||
@@ -77,7 +77,7 @@ The setup keeps each project's config, and what you choose for a project, in the
|
||||
- `~/.local/state/build-release/build-epic-transcripts`: the transcripts of build-epic's chunks.
|
||||
- `~/.local/state/build-release/larv-review`: each chunk's review reports.
|
||||
|
||||
Leave out the data folder. build-release builds the loop's Claude home again, and you sign in there again with `/login`. The sessions in the home are Claude Code's own copies: the transcripts above are the setup's. Claude Code writes the memory files in the home's `projects/<folder>/memory/`, so those aren't part of this setup.
|
||||
Leave out the data folder. build-release builds the loop's Claude home again, and you sign in there again with `/login`. The transcripts above are the setup's copies of the sessions in the home. A chunk that was open when the home was lost can't resume its session. Claude Code writes the memory files in the home's `projects/<folder>/memory/`, so those aren't part of this setup.
|
||||
|
||||
To keep build-release's transcripts and the reports small, add a crontab line that gzips each transcript and review file 30 days after it last changed, and logs each run with its date:
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class StartChunks(unittest.TestCase):
|
||||
self.assertEqual(self.starts(fake), [("new-session", "item-1", [str(self.LAUNCHER), "--chunk", "item-1", "ship it"]), ("new-window", "item-3", [str(self.LAUNCHER), "--chunk", "item-3", "ship it"])])
|
||||
first = next(call for call in fake.tmux_calls if call[0] == "new-session")
|
||||
self.assertEqual((first[first.index("-s") + 1], first[first.index("-c") + 1]), (self.session, str(self.root)))
|
||||
# Only build-release's own variables and the two XDG ones are handed on, since a window gets the tmux server's environment.
|
||||
# Only build-release's own variables and the three XDG ones are handed on, since a window gets the tmux server's environment.
|
||||
self.assertEqual([word for word in first if "=" in word], ["BUILD_RELEASE_WORKER_MODEL=m", "XDG_CONFIG_HOME=", "XDG_STATE_HOME=", "XDG_DATA_HOME="])
|
||||
self.assertEqual(fake.tmux_calls[0], ["list-windows", "-t", f"={self.session}", "-F", "#{window_name}\t#{pane_dead}\t#{window_id}"])
|
||||
# The session names the checkout whose chunks it runs.
|
||||
|
||||
@@ -56,7 +56,7 @@ class ExitContract(unittest.TestCase):
|
||||
("agent_cycle/run.py", "close", "1", "failure.reason", read),
|
||||
("agent_cycle/run.py", "close", "1", "failure.reason", "a finished chunk's session cannot be deleted"),
|
||||
("build_release/loop/checkout.py", "checkout_root", "1", "found.reason", git),
|
||||
("build_release/loop/main.py", "run_loop", "1", "'\\n'.join(needs)", "tmux is missing or older than 3.2, the loop's Claude home cannot be built, or nobody is signed in there"),
|
||||
("build_release/loop/main.py", "run_loop", "1", "'\\n'.join(needs)", "tmux is missing or older than 3.2, the loop's Claude home cannot be built, claude cannot say who is signed in there, or nobody is"),
|
||||
("build_release/loop/main.py", "run_loop", "1", "f'{CHUNK_FLAG} is how build-release starts itself", "--chunk is given outside a tmux window"),
|
||||
("build_release/loop/main.py", "windows_opened", "1", "started.reason", "a chunk's window cannot be started"),
|
||||
("build_release/loop/main.py", "windows_opened", "1", "f\"`tmux {' '.join(shown)}` failed", "the tmux session cannot be put on the terminal"),
|
||||
|
||||
@@ -32,19 +32,19 @@ which it builds from the clone it ships in before it starts anything. Until some
|
||||
there, it stops and prints the command to sign in with. README.md → Install says what the
|
||||
home holds.
|
||||
|
||||
build-release needs tmux 3.2 or later, and checks that first as well. Each chunk runs in
|
||||
its own window of one tmux session per project, named loop-<key>, such as loop-claude-config. <key>
|
||||
is the checkout's path relative to ~/code, or to / outside it, with a dash for each character other
|
||||
than a letter, a digit, _ or -. The tmux session's @loop-root option names its checkout, and a
|
||||
checkout whose key maps to a tmux session another checkout runs is refused. build-release <task>
|
||||
starts the chunks that may start now, then attaches to the tmux session, or switches to it inside
|
||||
tmux; detaching leaves the chunks running. Off a terminal it prints the command that attaches. Where
|
||||
no chunk may start, it says so, and the task starts in no new window. At most parallel-chunks chunks
|
||||
run at once, a whole number the project's config sets, 1 by default. The first starts from the
|
||||
plan's next item, and each other from an item whose `Touches:` prediction overlaps neither one
|
||||
before it nor an item another chunk holds (touch-predictions --help). A window is named for the item
|
||||
its chunk starts from, as item-372; a chunk without a plan item, such as planning a release or its
|
||||
release review, runs alone in the window no-item.
|
||||
build-release needs tmux 3.2 or later, and checks that too before it starts anything. Each chunk
|
||||
runs in its own window of one tmux session per project, named loop-<key>, such as
|
||||
loop-claude-config. <key> is the checkout's path relative to ~/code, or to / outside it, with a dash
|
||||
for each character other than a letter, a digit, _ or -. The tmux session's @loop-root option names
|
||||
its checkout, and a checkout whose key maps to a tmux session another checkout runs is refused.
|
||||
build-release <task> starts the chunks that may start now, then attaches to the tmux session, or
|
||||
switches to it inside tmux; detaching leaves the chunks running. Off a terminal it prints the
|
||||
command that attaches. Where no chunk may start, it says so, and the task starts in no new window.
|
||||
At most parallel-chunks chunks run at once, a whole number the project's config sets, 1 by default.
|
||||
The first starts from the plan's next item, and each other from an item whose `Touches:` prediction
|
||||
overlaps neither one before it nor an item another chunk holds (touch-predictions --help). A window
|
||||
is named for the item its chunk starts from, as item-372; a chunk without a plan item, such as
|
||||
planning a release or its release review, runs alone in the window no-item.
|
||||
|
||||
Each window runs a build-release for that one chunk, started with --chunk <window>, which nobody
|
||||
types. As a chunk finishes, its loop starts each chunk that may start then, with the task it ran
|
||||
@@ -174,8 +174,9 @@ window closes, so the next build-release <task> reads the plan again.
|
||||
Exit 1, saying why, when:
|
||||
- no task is given
|
||||
- git cannot start or finds no checkout
|
||||
- tmux is missing or older than 3.2, the loop's Claude home cannot be built, or nobody is signed
|
||||
in there; a chunk's window checks the home three times, a minute apart, before it stops
|
||||
- tmux is missing or older than 3.2, the loop's Claude home cannot be built, claude cannot say who
|
||||
is signed in there, or nobody is; a chunk's window checks the home three times, a minute apart,
|
||||
before it stops
|
||||
- --chunk is given outside a tmux window
|
||||
- a chunk's window cannot be started, as when the project's config cannot be read, or the tmux
|
||||
session runs another checkout's chunks
|
||||
|
||||
@@ -30,7 +30,7 @@ from claude_home.home import unready
|
||||
PYTHON_TIMEOUT = 600
|
||||
# Seconds a command of the forge's CLI may take, so a stalled one cannot hold the loop.
|
||||
FORGE_TIMEOUT = 60
|
||||
# Seconds each `claude` command that builds the loop's Claude home may take, as long as a Python script may, so a stalled plugin download cannot hold every loop that waits on the home's lock.
|
||||
# Seconds each `claude` command of the home's check may take, so a stalled plugin download cannot hold every loop that waits on the home's lock.
|
||||
HOME_TIMEOUT = PYTHON_TIMEOUT
|
||||
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ def state_folder(env: Mapping[str, str], home: pathlib.Path) -> pathlib.Path:
|
||||
|
||||
def claude_home(env: Mapping[str, str], home: pathlib.Path) -> pathlib.Path:
|
||||
"""The loop's Claude home, which claude_home.home builds in the data folder: every claude the loop starts keeps its settings, plugins, sign-in and transcripts there."""
|
||||
# The data folder needs no backup: the tools build the home again, and what Claude Code keeps there is its own to restore, by a new /login.
|
||||
return xdg_folder(env.get(XDG_DATA_HOME), home / DATA_HOME) / SETUP / "claude-home"
|
||||
|
||||
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ Each project principle states one rule that the decisions below apply; their ent
|
||||
|
||||
1. **Cut cost only where a measurement of archived chunks shows quality holds.** Chunk bundling, the round cap, which fixes rerun a pass, a reviewer of its own for each pass, the review a branch changing only Markdown no agent follows gets, the passes kept for the release review, review opt-outs, the security pass, compaction and the routing ladder all apply it.
|
||||
2. **A measurement files or ranks work, and never blocks a merge.** The comprehension floor and check, and a reading-cost rise, apply it. A merge waits on a scoring run the plan calls for only until the run is recorded, whatever it scores.
|
||||
3. **Each file has one writer.** `~/.config/build-release/models.json` is written only by `save_model`, which the entry points, build-release and build-epic, both call. The clone of a release moves only through its own `self-update`, and nothing else writes it. The loop's Claude home is `bin/claude_home`'s to build and Claude Code's to keep. The exception is that home's `settings.json`, which both write: a build replaces it with the clone's, and keeps only the `model` Claude Code wrote there.
|
||||
3. **Each file has one writer.** `~/.config/build-release/models.json` is written only by `save_model`, which the entry points, build-release and build-epic, both call. The clone of a release moves only through its own `self-update`. The one other write that reaches it is a change made through the links of the loop's Claude home, which `self-update` refuses to move past. The loop's Claude home is `bin/claude_home`'s to build and Claude Code's to keep. The exception is that home's `settings.json`, which both write: a build replaces it with the clone's, and keeps only the `model` Claude Code wrote there.
|
||||
4. **A rule a program can check is enforced by a program, and reviewers rule on the rest.** rule-hook and its overrides, `docker-run-memory`, the refused writes of reviewers under `agents/`, and CI with `main`'s branch protection apply it.
|
||||
5. **A chunk can't vouch for itself.** What a chunk writes is approved by a review pass, by the human, or by a precedent the repo held before the chunk began. So an unanswered ask leaves the PR unmerged, the human approves the premises chunk and runs `cut-release`, and the judge holds a chunk open while an answer the human typed isn't recorded anywhere.
|
||||
6. **An unattended run never waits on a prompt, and a lasting failure stops it.** Every claude build-release starts bypasses permissions inside its sandbox, each claude it opens on a terminal has `CLAUDE_CODE_SANDBOXED` set, and interactive sessions bypass permissions with the dangerous-mode prompt skipped. A failed archive stops the loop, while a `claude` that cannot start, as during an update, is retried.
|
||||
@@ -140,7 +140,7 @@ The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: b
|
||||
|
||||
## loop's Claude home: `bin/claude_home` generates it in the data folder from the clone it ships in, with links to the clone's instruction files and a `settings.json` whose `{clone}` it fills in
|
||||
|
||||
2026-12-04, lilleman's plan for 0.18.0. Serves goal 3. `bin/claude_home` builds the home in the data folder, `~/.local/share/build-release/claude-home`, so the clone stays a clean checkout: the files Claude Code keeps in its home never reach a commit. Only a change made through one of the four links below reaches the clone. It links `CLAUDE.md`, `rules/`, `agents/` and `skills/` to the clone's, and writes `settings.json` from the clone's with the clone's path in place of `{clone}`, since the clone may lie anywhere, so the tracked file can't hold its path. It builds the home again when the clone's commit or path changes, which covers a release's tag and a development clone alike. Probed on 2.1.336, once, while the home was built: `claude plugin install` finds a plugin only after `claude plugin marketplace add` of its marketplace; each exits 0 where its work is already done; and an install rewrites the home's `settings.json` in Claude Code's key order. Not tested: that a session loads the four through links, which needs a model request.
|
||||
2026-12-04, lilleman's plan for 0.18.0. Serves goal 3. `bin/claude_home` builds the home in the data folder, `~/.local/share/build-release/claude-home`, so the clone stays a clean checkout: the files Claude Code keeps in its home never reach a commit. Only a change made through one of the four links below reaches the clone. `bin/claude_home` links `CLAUDE.md`, `rules/`, `agents/` and `skills/` to the clone's, and writes `settings.json` from the clone's with the clone's path in place of `{clone}`, since the clone may lie anywhere and the tracked file can't hold its path. It builds the home again when the clone's commit or path changes, which covers a release's tag and a development clone alike. Probed on 2.1.336, once, while the home was built: `claude plugin install` finds a plugin only after `claude plugin marketplace add` of its marketplace; each exits 0 where its work is already done; and an install rewrites the home's `settings.json` in Claude Code's key order. Not tested: that a session loads the four through links, which needs a model request.
|
||||
|
||||
## comprehension floor: every dimension and the overall at the project's readability floor or above is the target, and no score blocks a merge or release
|
||||
|
||||
@@ -148,7 +148,7 @@ The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: b
|
||||
|
||||
## deploy: a clone of a release holds only that release, which its own `bin/self-update` moves it to; this repo is developed in `~/code/claude-config`, where build-release runs its chunks like any project's
|
||||
|
||||
2026-10-29, lilleman. Serves goal 1.3 and goal 2. `~/.claude` was this repo's development checkout, so every merge reached every session on the machine at once, its unfinished work included, while other machines took only tags. Now each machine takes only releases: what a release holds is what every session runs, and cutting one is the human's step that ships it. `self-update` automates README → Update. It refuses an uncommitted change to a tracked file that the new tag doesn't hold, such as an agent written through the loop's Claude home's link, and a move that would drop commits no release holds. 2026-12-03, lilleman, in the standalone-install plan: a release is run from a clone by the path of its `bin/`, so `self-update` moves the clone it ships in and takes no argument, in place of `deploy-release`, which ran from the development clone. Three fresh readers, seated as a person who installed a release, a consultant new to it and the maintainer, each picked `bin/self-update` over `build-release self-update`, which read as a task handed to build-release, and over `update-release`, `update` and `take-release`. 2026-12-04, with the loop's Claude home: the clone lies anywhere but `~/.claude`, and Claude Code's own writes go to the generated home. Valid while every claude the loop starts reads its configuration from one home per machine.
|
||||
2026-10-29, lilleman. Serves goal 1.3 and goal 2. `~/.claude` was this repo's development checkout, so every merge reached every session on the machine at once, its unfinished work included, while other machines took only tags. Now each machine takes only releases: what a release holds is what every session runs, and cutting one is the human's step that ships it. `self-update` automates README → Update. It refuses an uncommitted change to a tracked file that the new tag doesn't hold, such as a rule edited through a link of the loop's Claude home, and a move that would drop commits no release holds. 2026-12-03, lilleman, in the standalone-install plan: a release is run from a clone by the path of its `bin/`, so `self-update` moves the clone it ships in and takes no argument, in place of `deploy-release`, which ran from the development clone. Three fresh readers, seated as a person who installed a release, a consultant new to it and the maintainer, each picked `bin/self-update` over `build-release self-update`, which read as a task handed to build-release, and over `update-release`, `update` and `take-release`. 2026-12-04, lilleman's plan for 0.18.0, with the loop's Claude home: the clone lies anywhere but `~/.claude`, and Claude Code's own writes go to the generated home. Valid while every claude the loop starts reads its configuration from one home per machine.
|
||||
|
||||
## deploy: this repo keeps no `AGENTS.md`, since `~/.claude` is its checkout; its principles and decision titles head `docs/decisions.md`, its working rules follow them there, and its `.claude/settings.json` excludes every `.claude/CLAUDE.md`, so a session in the clone loads only the clone's `CLAUDE.md`
|
||||
|
||||
@@ -209,7 +209,7 @@ Valid while `~/.claude` is a checkout of this repo.
|
||||
|
||||
## build-release: a `claude` that cannot start is a failed worker run, retried
|
||||
|
||||
2026-09-28, larv-review, declining a product-owner nit to exit at once when `claude` is missing. Serves goal 1. Claude Code's updater repoints `~/.local/bin/claude` at each new version under running loops, and a start that meets it mid-update fails with the same error as a broken install; the retry costs two minutes on the second and saves an unattended loop on the first. 2026-12-04: the check of the loop's Claude home runs `claude` too, so a chunk's window and a reload retry it the same way, in `agent_cycle.retry.home_unready`; the command a person typed stops at once, since they are there to read why. Valid while Claude Code updates by repointing its link.
|
||||
2026-09-28, larv-review, declining a product-owner nit to exit at once when `claude` is missing. Serves goal 1. Claude Code's updater repoints `~/.local/bin/claude` at each new version under running loops, and a start that meets it mid-update fails with the same error as a broken install; the retry costs two minutes on the second and saves an unattended loop on the first. 2026-12-04, the review of item 483: the check of the loop's Claude home runs `claude` too, so a chunk's window and a reload retry it the same way, in `agent_cycle.retry.home_unready`; the command a person typed stops at once, since they are there to read why. Valid while Claude Code updates by repointing its link.
|
||||
|
||||
## build-release: a judge decides each interrupt and each quoted answer from the transcript, the premises, `AGENTS.md`, `docs/decisions.md`, `~/.claude/CLAUDE.md`, `~/.claude/rules/` and larv-review's standards, and holds a chunk open while an answer the human typed in it is recorded nowhere; it interrupts for a reserved choice those don't settle, or an ask that carries no recommendation
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
The decision "deploy: this repo keeps no `AGENTS.md`, since `~/.claude` is its checkout" predates item 483. Since item 483 a release is a clone anywhere, and the loop's Claude home links only `CLAUDE.md`, `rules/`, `agents/` and `skills/`, so an `AGENTS.md` in this repo would no longer load into another project's session: the decision lost its reason. The prose reviewer of item 483 raised it; a change to a decision the repo already held is the human's.
|
||||
|
||||
Question: keep this repo without an `AGENTS.md` for another reason, to be written into the decision, or give it one like any project and drop the decision and `.claude/rules/this-repo-keeps-no-agents-md.md`? Recommendation: decide once 0.18.0 is cut, since this repo is developed from `~/.claude` at 0.17.0 until then, where the old reason still holds; until then reword only the title's reason.
|
||||
Question: keep this repo without an `AGENTS.md` for another reason, to be written into the decision, or give it one like any project and drop the decision and `.claude/rules/this-repo-keeps-no-agents-md.md`? Recommendation: give it one. The answer closes this item; the move itself is then filed as an item of the release after 0.18.0, since it changes each place that reads the head of `docs/decisions.md` as this repo's `AGENTS.md`. Until that item ships, the decision stands as written.
|
||||
|
||||
Touches:
|
||||
- `docs/decisions.md`: lines 15-30, lines 150-160
|
||||
|
||||
Reference in New Issue
Block a user