Run every claude the loop starts in a Claude home generated outside the clone
CI / tests (pull_request) Successful in 4m45s
CI / tests (pull_request) Successful in 4m45s
This commit is contained in:
+5
-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. `~/.claude.json` is Claude Code's, and `~/.claude` moves only through its own `self-update`. The exception is `~/.claude/settings.json`, which Claude Code writes from any session. Git's clean filter `bin/settings_filter.py` keeps each machine's model and Claude Code's key order out of every commit, and `README.md` → "Update" carries its other changes into this repo.
|
||||
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.
|
||||
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.
|
||||
@@ -132,7 +132,8 @@ The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: b
|
||||
2026-11-20, lilleman's standalone-install plan. Serves goal 3, which keeps the setup out of the human's `~/.claude`, and goal 5: a home of its own keeps the loop's transcripts and token apart from the human's. The plan therefore runs every claude the loop starts in a home of its own, and doesn't load the setup with `--plugin-dir`, `--settings` and `--append-system-prompt-file` over the human's home. The probes ran on Claude Code 2.1.330, on throwaway homes, never the human's. A mock Messages API at `ANTHROPIC_BASE_URL` recorded each request and answered the first with a tool call that reads a file, so the system prompt and the tool results show what loaded, with no real token. Valid for Claude Code 2.1.330; repeat the probes when its version changes.
|
||||
|
||||
- **Loads from `$CLAUDE_CONFIG_DIR`:** `CLAUDE.md` (in the system prompt), `rules/*.md` (one with `paths:` entered the context after the model read a matching file, not before), `agents/`, `skills/`, the hooks of `settings.json` (a `SessionStart` hook ran) and plugins. `claude plugin marketplace add` and `claude plugin install` write to `<home>/plugins`, and the installed plugin's skill is listed. `.claude.json` lands in the home too, so the human's `~/.claude.json` stays theirs.
|
||||
- **The loop's home signs in by `/login`.** 2026-12-03, lilleman, planning 0.18.0: the human signs in once inside the loop's home (item 483). Not tested: where that home keeps the sign-in. The token below stays the way a container signs in, as task-bench does.
|
||||
- **The loop's home signs in by `/login`.** 2026-12-03, lilleman, planning 0.18.0: the human signs in once, in a claude started with `CLAUDE_CONFIG_DIR` naming the loop's home, over a long-lived token file they would have to make and keep. `bin/claude_home` asks `claude auth status` before a command starts a chunk. Probed on Claude Code 2.1.336 in a throwaway home: signed out, it prints JSON with `loggedIn: false` and exits 1. Not tested: where the home keeps the sign-in. The token below stays the way a container signs in, as task-bench does.
|
||||
- **The loop's home is generated, outside the clone.** `bin/claude_home` builds it in the data folder, `~/.local/share/build-release/claude-home`, so the clone stays a clean checkout and Claude Code's writes never reach a commit. 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 a hook's command can't name a clone that lies anywhere. 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: `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.
|
||||
- **Signs in by `CLAUDE_CODE_OAUTH_TOKEN`:** the request carried `Authorization: Bearer <token>` with the `oauth-2025-04-20` beta, and `claude auth status` said `loggedIn: true, authMethod: oauth_token`. The home didn't hold a credentials file. Without the variable the home is `loggedIn: false`. Not tested: that Anthropic accepts a real token, since `claude setup-token` needs the human's browser sign-in. The authentication docs say the token lasts one year and can only make model requests; neither is tested, and the first real run shows whether it signs in.
|
||||
- **`--bare` can't use that token.** With `CLAUDE_CODE_OAUTH_TOKEN`, it says `Not logged in · Please run /login` and doesn't send a request. With `ANTHROPIC_API_KEY` it signs in, but doesn't load anything from the home (`CLAUDE.md`, rules, agents or skills) and offers only Bash, Edit and Read. So a container that signs in by a long-lived token runs without `--bare`; its fresh home is empty, so nothing of the human's loads there either. The project's `CLAUDE.md` loads from the working folder, and its `AGENTS.md` only where the project has no `CLAUDE.md`.
|
||||
- **Transcripts** land in `<home>/projects/<working folder's path, with each / as ->/<session id>.jsonl`. `--no-session-persistence` doesn't write one, only an empty `memory` folder, so a bench that uses it reads the run from `--output-format stream-json`.
|
||||
@@ -838,9 +839,9 @@ Valid while Claude Code loads `~/.claude/rules/*.md` in every project, a path-sc
|
||||
|
||||
2026-12-03, lilleman. Interactive sessions now start in `bypassPermissions` instead of auto mode: auto mode still asked for permission too often for a sandbox, where the sandbox, not the prompt, grants access. Valid while every machine taking this checkout is such a sandbox.
|
||||
|
||||
## settings.json: each machine owns its model, and git's clean filter `bin/settings_filter.py` keeps it, and Claude Code's key order, out of every commit
|
||||
## settings.json: the tracked file sets what every machine shares, and a machine's model lives only in the copy generated in the loop's Claude home
|
||||
|
||||
2026-10-21, lilleman. Serves goal 2: Claude Code rewrites `"model"` in `settings.json` on every `/model` and plugin install, so a tracked model let one machine's pick override every other's. lilleman chose a model per machine over one synced in `env.ANTHROPIC_MODEL`, which would override a `/model` pick from the next session on. A model per machine is simpler, and build-release picks each project's model in `~/.config/build-release/models.json` anyway. The filter also sorts the keys, since each write puts them back in Claude Code's order. The cost: a move or pull that changes `settings.json` drops the machine's model. The effort keys, `effortLevel` and `modelSettings`, stay synced: the routing decision on a chunk's worker rung relies on the effort `settings.json` gives every interactive session. Valid while Claude Code writes the model it picks into `settings.json`.
|
||||
2026-12-04, replacing the clean filter of 2026-10-21. Serves goal 2. Claude Code rewrites `"model"` in its home's `settings.json` on every `/model` and plugin install. While that home was the clone, a clean filter, `bin/settings_filter.py`, kept the model and Claude Code's key order out of every commit, and each machine ran one `git config` step to set it. The loop's home is now generated outside the clone, so Claude Code never writes the tracked file, and the filter and its step are gone. A build of the home keeps the `model` its `settings.json` holds and takes every other key from the clone. lilleman chose a model per machine over one synced in `env.ANTHROPIC_MODEL`, which would override a `/model` pick from the next session on; build-release picks each project's model in `~/.config/build-release/models.json` anyway. The effort keys, `effortLevel` and `modelSettings`, stay synced: the routing decision on a chunk's worker rung relies on the effort `settings.json` gives every interactive session. The tracked file holds no theme or status line: those are the person's, in their own `~/.claude`. `bin/repo_checks/test_settings.py` holds the tracked file to no model and sorted keys. Valid while Claude Code writes the model it picks into its home's `settings.json`.
|
||||
|
||||
## task-bench: a bench takes 5 bugs and 5 runs per side, after a 2 × 2 pilot on a new setup, and at no affordable count does a chunk-sized change rise above the noise
|
||||
|
||||
|
||||
@@ -4061,3 +4061,20 @@ Read most (opens and searches):
|
||||
- `bin/loop_state/paths.py` 1
|
||||
- `bin/repo_checks/test_gitignore.py` 1
|
||||
- `bin/repo_checks/test_import_order.py` 1
|
||||
|
||||
## Reading cost, chunk f8e8bc3c9a97, finished 2026-12-03T23:35:33Z
|
||||
|
||||
197317 new input tokens before the first commit.
|
||||
|
||||
Read most (opens and searches):
|
||||
|
||||
- `bin/cut_release/test_cut_release.py` 13
|
||||
- `README.md` 8
|
||||
- `bin/self_update/test_self_update.py` 7
|
||||
- `docs/decisions.md` 7
|
||||
- `bin/cut_release/cut.py` 5
|
||||
- `todo.md` 5
|
||||
- `.gitignore` 3
|
||||
- `bin/cut_release/patch.py` 3
|
||||
- `CLAUDE.md` 2
|
||||
- `bin/cut_release/trace.py` 2
|
||||
|
||||
Reference in New Issue
Block a user