diff --git a/bin/claude_home/home.py b/bin/claude_home/home.py index 7d40388e..3a10c802 100644 --- a/bin/claude_home/home.py +++ b/bin/claude_home/home.py @@ -71,7 +71,7 @@ def printed(done: subprocess.CompletedProcess[str]) -> str: def refreshed(home: pathlib.Path, clone: pathlib.Path, reports: pathlib.Path, own: pathlib.Path, claude: Claude, git: Git) -> Failure | None: - # The home links to the clone's rules/, and Claude Code applies the exclusion of own's files to a link's target too: a clone in own would run without its rules. + # The home links to the clone's rules/, and the exclusion of own's files also drops a rule file reached through a link: a clone in own would run without its rules. if clone.resolve().is_relative_to(own.resolve()): return Failure(f"the release is cloned in your own Claude home, {own}, whose instructions the loop keeps out; clone it elsewhere, as README.md → Install says") commit = git("rev-parse", "HEAD", cwd=str(clone)) diff --git a/docs/decisions.md b/docs/decisions.md index 888b8e4e..73051dbf 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -132,7 +132,7 @@ 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. A bullet that names 2.1.336 was probed on that version instead. Each result holds for the version it was probed on; repeat the probes when the 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 `/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 human's own `~/.claude/CLAUDE.md` and `~/.claude/rules/` load too, unless the home's settings exclude them.** 2026-12-04, found by `first-chunk-e2e/run` on Claude Code 2.1.336: claude reads `.claude/CLAUDE.md` and `.claude/rules/` in every folder above its working folder as project instructions, and the human's home folder is above each project they keep under it. Both reached the worker's request in the loop's home. A `SessionStart` hook in the human's `~/.claude/settings.json` didn't run. So `bin/claude_home` writes `claudeMdExcludes` into the home's `settings.json`, naming everything under the human's `~/.claude`, after which neither loads. The exclusion also applies to the target of a link, so `bin/claude_home` refuses a release cloned in the human's `~/.claude`: the home's link to its `rules/` wouldn't load anything. Not tested: a `CLAUDE.md` in the human's home folder itself, which is outside their Claude home. +- **The human's own `~/.claude/CLAUDE.md` and `~/.claude/rules/` load too, unless the home's settings exclude them.** 2026-12-04, found by `first-chunk-e2e/run` on Claude Code 2.1.336: claude reads `.claude/CLAUDE.md` and `.claude/rules/` in every folder above its working folder as project instructions, and the human's home folder is above each project they keep under it. Both reached the worker's request in the loop's home. A `SessionStart` hook in the human's `~/.claude/settings.json` didn't run. So `bin/claude_home` writes `claudeMdExcludes` into the home's `settings.json`, naming everything under the human's `~/.claude`, after which neither loads. The exclusion also drops a rule file the home reaches through a link, though not a linked `CLAUDE.md`, so `bin/claude_home` refuses a release cloned in the human's `~/.claude`: none of its `rules/` would load. Not tested: a `CLAUDE.md` in the human's home folder itself, which is outside their Claude home. - **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, and makes and keeps no long-lived token file. `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. - **Signs in by `CLAUDE_CODE_OAUTH_TOKEN`:** the request carried `Authorization: Bearer ` 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`. diff --git a/first-chunk-e2e/first_chunk.py b/first-chunk-e2e/first_chunk.py index 7b853e44..9e674def 100644 --- a/first-chunk-e2e/first_chunk.py +++ b/first-chunk-e2e/first_chunk.py @@ -40,7 +40,7 @@ SETUP_INSTRUCTION = "## Working loop" # What build-release asks before a project's first chunk, and the model the newcomer types: one on the shipped routing ladder. MODEL_QUESTION = "name claude --model takes:" MODEL = "claude-opus-5-5" -# How many seconds build-release may take to start the chunk, and the chunk to finish. +# The seconds build-release may take to return, and the seconds the chunk may take after that. PATIENCE = 300 README = """# first-project diff --git a/todo.md b/todo.md index d6b592d1..b625cdc3 100644 --- a/todo.md +++ b/todo.md @@ -134,7 +134,7 @@ Touches: ### 586. Keep the person's own skills, agents and commands out of the loop's Claude home where `HOME` names the home folder through a symlink. -Item 577's stability review probed Claude Code 2.1.336 in a throwaway config home: with `HOME` set to a symlink to the home folder, a skill, an agent and a command under the person's `.claude` reached the request; with `HOME` as the real path none did. `claudeMdExcludes` kept `CLAUDE.md` and the rules out both ways. The probe ran outside a checkout, so first repeat it in a project, in `first-chunk-e2e/first_chunk.py`'s container. Where it holds, have `bin/claude_home` or `bin/loop_effects` name the home folder by its real path, and exclude both spellings of the person's Claude home. Record the probe under docs/decisions.md → `Claude Code in a home of its own`. +Item 577's stability review probed Claude Code 2.1.336 in a throwaway config home: with `HOME` set to a symlink to the home folder, a skill, an agent and a command under the person's `.claude` reached the request; with `HOME` as the real path none did. `claudeMdExcludes` kept `CLAUDE.md` and the rules out both ways. The probe ran outside a checkout, so first repeat it in a project, in `first-chunk-e2e/first_chunk.py`'s container. Where it holds, have `bin/claude_home` or `bin/loop_effects` name the home folder by its real path, and exclude both spellings of the person's Claude home. Record the probe in the decision that the home's settings comment in `bin/claude_home/home.py` cites. Touches: - `bin/loop_effects/effects.py`: `system_effects` (small)