Record that a Claude home of its own loads the setup and signs in by a long-lived token, but not under --bare #679

Merged
lilleman merged 4 commits from item-479 into main 2026-11-21 00:05:36 +01:00
3 changed files with 23 additions and 15 deletions
+11
View File
@@ -18,6 +18,7 @@ Each project principle states one rule that the decisions below apply; their ent
- bin/: the tools send no OTLP traces, logs or metrics, and loop-claude's archive holds the trace of each cycle
- bin/: the tools support only the latest stable Python, and the tests, written in plain unittest, run on it in four pytest-xdist workers
- chunk-pr: the chunks of a project merge one at a time on a machine, each finishing its plan items in its turn, and a pull request that waits for an approval leaves the queue while it waits
- Claude Code in a home of its own: a `CLAUDE_CONFIG_DIR` home loads `CLAUDE.md`, rules, agents, skills, hooks and plugins, and `CLAUDE_CODE_OAUTH_TOKEN` signs in there, but never under `--bare`
- 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`
- do-epic: drives one Jira epic whose items span repos, or have none, ranked by the epic's goals, then code health, then each repo's goals, and closes the epic only once the human confirms every goal
- epic-branch: an epic's chunks branch off and merge into a working branch its project's config names, without a person, and a person merges that branch into the default branch in one pull request
@@ -123,6 +124,16 @@ Valid while a chunk's worker runs `chunk-pr merge` itself, and one machine runs
The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: by the highest R among a chunk's items, the median was 0.9M to 1.5M tokens at R 1 to 5, and 2.7M at R 6, where the 90th percentile was 8.8M. A risky item that runs long re-runs review over every item bundled with it. R 5 is also the least R an I 4 item gets, so an item that could take everything down shares a chunk only where its L + E is 3 or less, and an irreversible I 5 item, at R 7 or more, never does. Valid while a review's cost is mostly fixed per chunk; revisit once 30 chunks have shipped bundles under it.
## Claude Code in a home of its own: a `CLAUDE_CONFIG_DIR` home loads `CLAUDE.md`, rules, agents, skills, hooks and plugins, and `CLAUDE_CODE_OAUTH_TOKEN` signs in there, but never under `--bare`
2026-11-20, lilleman's standalone-install plan. Serves goal 2, so the setup installs without taking over the human's `~/.claude`, and goal 4: 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.
- **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`.
- **The model catalog** sits in `<home>/cache/model-catalog/` on the human's machine, as `bin/loop_state/paths.py` expects. The throwaway homes didn't write one, since the mock was the only server they reached. Not tested: whether a long-lived-token session writes it. Where it doesn't, `bin/chunk_driver/project/model_choice.py` prints `no model catalog cached` and takes a typed model name.
## 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
2026-09-27, lilleman, restating the 2026-09-24 target and extending it to the overall. Serves goal 1. 2026-10-13, lilleman: the floor doesn't block anything, and `review: the comprehension check records …` says why. Valid while the scoring run keeps its four seats. 2026-11-12, lilleman, through todo item 358: a project's config sets this floor as `readability-floor`, its readability floor, since legacy code scores low. It is 7.0 where left out, and the signal stays that the score rises. Readers seated as the person who writes the config picked the key, 2 of 3.
+8
View File
@@ -3288,3 +3288,11 @@ Read most (opens and searches):
## Reading cost, chunk fbec3b9bb507, finished 2026-11-19T13:23:00Z
37393 new input tokens before the first commit.
## Reading cost, chunk 94e322c53239, finished 2026-11-20T22:47:29Z
56904 new input tokens before the first commit.
Read most (opens and searches):
- `README.md` 1
+4 -15
View File
@@ -12,9 +12,8 @@
| ID | Release | Blocked by | Exempt | Item | L | E | I | R | S | Moves | Score |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 479 | 0.15.0 | | owner | **Record in a decision which of `CLAUDE.md`, path-scoped rules, agents, skills, hooks and plugins Claude Code loads from a `CLAUDE_CONFIG_DIR` home, whether a long-lived token logs in there, and where its transcripts and model catalogue land.** | 1 | 2 | 1 | 2 | 3 | 1.6 by 4 | 1.3 |
| 500 | 0.15.0 | | owner | **Mutate the Go lines a branch changes with Gremlins in `mutate-changes`, as it mutates Python, Rust, TypeScript and PHP, and print each mutant the tests do not kill.** | 2 | 2 | 2 | 4 | 4 | 1.1 by 4 | 1.2 |
| 501 | 0.15.0 | 479, 500 | owner | **Ship `task-bench`, which plants a bug the tests catch at the places the comprehension seats found hardest, has Haiku fix it in a vanilla Claude Code at a base and a head, and prints for each side how often the fix passes, with its median tokens, turns, wall time and reads before it opens a file the bug is in.** | 4 | 2 | 1 | 5 | 9 | 1.1 by 5, code health by 4 | 0.6 |
| 501 | 0.15.0 | 500 | owner | **Ship `task-bench`, which plants a bug the tests catch at the places the comprehension seats found hardest, has Haiku fix it in a vanilla Claude Code at a base and a head, and prints for each side how often the fix passes, with its median tokens, turns, wall time and reads before it opens a file the bug is in.** | 4 | 2 | 1 | 5 | 9 | 1.1 by 5, code health by 4 | 0.6 |
| 502 | 0.15.0 | 501 | owner | **Distil each `task-bench` run into a digest of short traces and decoys, the files most failing runs read but no fix touches, and have a stronger model turn it into plan items before the transcripts are deleted.** | 3 | 2 | 1 | 4 | 5 | 1.1 by 4, code health by 4 | 4.8 |
| 469 | 0.15.0 | | | **Move a do-epic parent issue whose sub-tasks a person filed to Release Ready once every sub-task has landed, and to Done once every sub-task is done, by transitions its config names.** | 3 | 2 | 2 | 5 | 4 | 1.2 by 4, 1.5 by 4, 1.6 by 3 | 3.1 |
| 503 | 0.15.0 | 502 | owner | **Calibrate `task-bench` on fejkdata: bench a head against itself for the noise floor, then one finished chunk at its base and head, and record in a decision how many tasks and runs the bench needs.** | 1 | 2 | 1 | 2 | 2 | 1.1 by 3 | 1.2 |
@@ -28,9 +27,9 @@
| 478 | 0.17.0 | | question | **Name the project, its repo and its two commands, today proposed as `do-release` and `do-epic`.** | 1 | 1 | 2 | 2 | 1 | | 0.0 |
| 480 | 0.18.0 | | owner | **Resolve every path the tools use in one module: the release root (the folder the running code ships in), the config folder, the state folder and the Claude home. Then only that module names `~/.claude`, and the loop still runs from `~/.claude`.** | 3 | 2 | 3 | 6 | 6 | 1.6 by 3, code health by 3 | 2.4 |
| 481 | 0.18.0 | 480 | owner | **Put the release's tools on `PATH` for every session the loop starts and every hook it runs, name them bare in the prose in place of `~/.claude/bin/<tool>`, and refuse the old spelling in new prose.** | 3 | 2 | 3 | 6 | 6 | 1.4 by 2, code health by 2 | 1.6 |
| 482 | 0.19.0 | 478, 479, 481 | owner | **Install the setup with `uv tool install` from a release tag, with `do-release` and `do-epic` on `PATH`, and replace `deploy-release` with `do-release self-update`.** | 3 | 2 | 3 | 6 | 7 | 1.6 by 4, 1.3 by 3 | 1.3 |
| 482 | 0.19.0 | 478, 481 | owner | **Install the setup with `uv tool install` from a release tag, with `do-release` and `do-epic` on `PATH`, and replace `deploy-release` with `do-release self-update`.** | 3 | 2 | 3 | 6 | 7 | 1.6 by 4, 1.3 by 3 | 1.3 |
| 485 | 0.19.0 | 478, 482 | owner | **Rename `loop-claude` to `do-release`, and keep `loop-claude` as an alias that warns, for one release.** | 2 | 2 | 3 | 5 | 4 | 1.3 by 2 | 2.1 |
| 483 | 0.19.0 | 479, 482 | owner | **Run every claude the loop starts in a Claude home the install generates from the release, with hooks that point into it and `do-release login` to sign in there, so the human's `~/.claude` stays theirs.** | 4 | 2 | 3 | 7 | 7 | 1.6 by 6 | 0.5 |
| 483 | 0.19.0 | 482 | owner | **Run every claude the loop starts in a Claude home the install generates from the release, with hooks that point into it and `do-release login` to sign in there, so the human's `~/.claude` stays theirs.** | 4 | 2 | 3 | 7 | 7 | 1.6 by 6 | 0.5 |
| 486 | 0.19.0 | 483 | owner | **Open an interactive claude in the loop's home with `do-release claude`, for a manual `/larv-review` or a talk with the setup loaded.** | 2 | 1 | 1 | 2 | 3 | 1.6 by 2 | 0.7 |
| 484 | 0.19.0 | 482 | owner | **Keep project configs, this machine's rules, transcripts and review reports in `~/.config/do-release/` and `~/.local/state/do-release/`, move them there with `do-release migrate`, and have rule-hook guard the new places.** | 3 | 2 | 4 | 7 | 6 | 1.6 by 3 | 0.4 |
| 487 | 0.20.0 | 483 | owner | **Run larv-review's passes from a program that picks them from the diff and the item, counts rounds against the cap and decides each rerun, with each reviewer returning its findings as JSON against a schema.** | 4 | 2 | 3 | 7 | 8 | 1.1 by 5, 1.4 by 5 | 0.5 |
@@ -108,16 +107,6 @@
## Details
### 479. Record in a decision which of `CLAUDE.md`, path-scoped rules, agents, skills, hooks and plugins Claude Code loads from a `CLAUDE_CONFIG_DIR` home, whether a long-lived token logs in there, and where its transcripts and model catalogue land.
Part of the standalone-install plan lilleman approved on 2026-11-20. `do-release` and `do-epic` stand for the names item 478 picks. The plan runs every claude the loop starts in a Claude home of its own, so the human's `~/.claude` stays theirs. Find out by testing on a throwaway home, never the human's. The result decides whether the loop gets a home of its own, or loads the setup with `--plugin-dir`, `--settings` and `--append-system-prompt-file` instead.
lilleman moved it into 0.15.0 on 2026-11-20, ahead of item 501: `task-bench` runs Haiku in a container, which is a fresh Claude home signed in by a long-lived token, so the decision also says how that container signs in.
Touches:
- `docs/decisions.md`: `## Claude Code in a home of its own: what loads from CLAUDE_CONFIG_DIR, and how a long-lived token signs in`
### 500. Mutate the Go lines a branch changes with Gremlins in `mutate-changes`, as it mutates Python, Rust, TypeScript and PHP, and print each mutant the tests do not kill.
fejkdata runs Gremlins v0.6.0 from a compose service of its own today, so a Go project's review mutates outside the shared tool. Run `gremlins unleash --diff <merge base> --output <file>` through `--prefix`, as the other tools run, read its JSON report, and print each mutant that `LIVED` or is `NOT COVERED` as `<path>:<line>:<column>: <status>: <mutator>`. Leave out `*_test.go`. Gremlins v0.6.0 mutates one run of lines per hunk, so its git runs with `diff.context=0`, as fejkdata's compose file sets. A worktree keeps git's data outside the folder a container mounts: `--help` shows the prefix that mounts it, as fejkdata's README does with `GIT_COMMON_DIR`.
@@ -136,7 +125,7 @@ The panel's scores barely move between chunks, and `reading-cost` measures chunk
- **Plant.** Run Gremlins, as item 500 runs it, without `--diff`, over the files that hold the places `larv-review places` prints. Draw 5 of its `KILLED` mutants by a seeded pick, and re-apply each at its file, line and column. The task's text is the failing assertion's message, without the test's name, file or line, so it says what goes wrong and not where. Go is the first language; item 508 adds the others.
- **Copy.** The tree at the commit, without `.git`, committed once with the bug in it, so `git diff` and `git log` show Haiku nothing.
- **Run.** Inside a container that holds only the copy: the project's development image with Claude Code added, such as `golang` for fejkdata, signed in by a long-lived token in an environment variable, with a memory limit and the network only for the API. In it, `claude -p --bare --strict-mcp-config --disable-slash-commands --no-session-persistence --model claude-haiku-5-5 --effort low --output-format stream-json` runs with every tool, Bash included, so Haiku greps, builds, runs the CLI and runs single tests as an agent normally does. A narrower tool list would raise the figures for reasons outside the code, and an allowlist can't fence Bash anyway: a rule that allows `cat` allows it on any path, such as the real checkout, whose diff would give away the bug. `--bare` drops the human's instructions, memories, hooks, skills and plugins, which would skew the figures and change with claude-config. The repo's README, `AGENTS.md` and `docs/` stay, since they are part of what the bench measures; a project's `CLAUDE.md`, which `--bare` skips, is passed in, so every project is measured alike.
- **Run.** Inside a container that holds only the copy: the project's development image with Claude Code added, such as `golang` for fejkdata, signed in by a long-lived token in an environment variable, with a memory limit and the network only for the API. In it, `claude -p --strict-mcp-config --disable-slash-commands --no-session-persistence --model claude-haiku-5-5 --effort low --output-format stream-json` runs with every tool, Bash included, so Haiku greps, builds, runs the CLI and runs single tests as an agent normally does. A narrower tool list would raise the figures for reasons outside the code, and an allowlist can't fence Bash anyway: a rule that allows `cat` allows it on any path, such as the real checkout, whose diff would give away the bug. Run without `--bare`: it can't sign in by a long-lived token (the decision `Claude Code in a home of its own`). The container's fresh Claude home is empty, so none of the human's instructions, memories, hooks, skills or plugins load; they would skew the figures and change with claude-config. The repo's README and `docs/` stay in the copy, since they are part of what the bench measures. A project's `CLAUDE.md` loads from the working folder, or its `AGENTS.md` where it has no `CLAUDE.md`; the bench takes that as the project's own setup.
- **Pair.** 5 runs per task at the base and at the head, in one bench, so a model or CLI update moves both sides. Each result names the Claude Code version and the model id.
- **Check.** The project's test command over Haiku's changes to files other than tests, with the tests restored from the commit, so deleting a test doesn't pass.
- **Measure.** From the stream: passed or not, tokens split into input, cache write, cache read and output, turns, wall time, and the reads before the first open of the file the bug is in.