diff --git a/README.md b/README.md index 4e1c0558..84e07482 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ build-release and build-epic run every claude in the loop's Claude home, `~/.loc Sign in to the loop's home once. Until you have, build-release and build-epic stop and print the line to run, `CLAUDE_CONFIG_DIR=~/.local/share/build-release/claude-home claude`: type `/login` in the claude it opens. A model you pick there with `/model` stays in the generated `settings.json`. The loop's home has no theme or status line of yours: those stay in your own `~/.claude`, for the claude you start yourself. build-release or build-epic builds the home again once the clone holds another commit, as after `self-update`, and keeps the sign-in, the model and the sessions. It builds the home again when you change `XDG_STATE_HOME`, too. The home follows the clone whose build-release, build-epic, `task-bench gather` or `claude-release` ran last, so run only the release clone's, never the development clone's: that one would point every running loop at unreleased rules. -From the account you sign in with, the loop's home keeps only the sign-in and the account's profile. It keeps out what a claude.ai account brings: its connectors, such as mail, calendar and files, its skills and its plugins. The generated `settings.json` turns each of these off, and every claude the loop starts also runs with `ENABLE_CLAUDEAI_MCP_SERVERS=false`. `claude-release` uses the same home, so the account's connectors don't load there either. Signing in can copy the account's skills into the home's `skills/synced/` before the home is built; the next claude there moves them to `skills/.trash/` and loads none. The home shares two things with your own Claude Code that it can't avoid. It signs in as an account, usually yours, so the loop's usage counts against that account's limits. And the account lists the home as one more signed-in session. +From the account you sign in with, the loop's home keeps only the sign-in and the account's profile: its IDs, email, names, organization and plan. It keeps out the account's claude.ai connectors (such as mail, calendar and files), skills and plugins. This holds in `claude-release` too. The home shares one thing with your own Claude Code that it can't avoid: it signs in as an account, usually yours, so the loop's usage counts against that account's limits. Signing in can copy the account's skills into the home's `skills/synced/` before the home is built; the first claude there after the home is built moves them to `skills/.trash/` and doesn't load any of them. To work in the loop's home yourself, for a manual `/larv-review` or a planning talk, run `~/build-release/bin/claude-release` in the project's checkout. It builds or refreshes the home first, as above, then runs claude there and passes every argument on, so `--resume`, `-p` and `--model` work as with plain claude. Where nobody has signed in to the home yet, type `/login` in the claude it opens. The home's `settings.json` bypasses permissions, and Claude Code may still ask you to trust the folder. The setup's hooks, such as `rule-hook`, which refuses a tool call that breaks a rule a program can check, run in every claude in the loop's home: the loop's sessions and `claude-release`. The claude you start from your own `~/.claude` loads neither the setup nor its hooks. @@ -210,7 +210,7 @@ Move `~/build-release` to the newest release: It prints `CHANGELOG.md`'s section for each version it moved past: do what each asks, such as a new step under Install. `self-update` moves the clone it ships in, whatever the directory it is run from, and names that clone in each line that says what it did or why it refused. So run `~/build-release`'s copy, never the development clone's. The next build-release or build-epic builds the loop's Claude home again from the new release. `self-update --help` says what else it checks. -It refuses while a file the clone tracks has an uncommitted change. Claude Code keeps its own files in the loop's home, not in the clone. The home's links lead into the clone, though, so a rule, an agent, a skill, a principle or a tool changed in that home changes the clone's file. Carry such a change into `~/code/dev-factory` on a branch of its own, merge it through a PR, and cut a release. +It refuses while a file the clone tracks has an uncommitted change. Claude Code keeps its own files in the loop's home, not in the clone. The home's links lead into the clone, though, so a rule, an agent, a skill, a principle or a tool changed in that home changes the clone's file. A new skill made there stays in the home, where no repo or backup holds it: make it in `~/code/dev-factory` instead. Carry such a change into `~/code/dev-factory` on a branch of its own, merge it through a PR, and cut a release. A release up to 0.17.0 was a checkout in `~/.claude`, and `self-update` doesn't move one out of there. Finish each open chunk first: its session stays in `~/.claude`, where the new release doesn't look for it. Then clone the newest release as Install says, and sign in to the loop's home. In each project's config, write `setup:` in place of `~/.claude/` in `principles` and `standards`, as in `setup:principles`, and write the new clone in place of `~/.claude` in the crontab line. build-release and build-epic don't read `~/.claude` after that, so the checkout there is yours to keep or remove. Keep it on 0.17.0 if you keep it: a later `settings.json` names its hooks by a placeholder that only the loop's home fills in, so in `~/.claude` the hooks would not run. A later release's `.gitignore` doesn't ignore Claude Code's credentials, transcripts and memory files, so in `~/.claude` a `git add .` would stage them. Where that checkout has moved past 0.17.0, run `echo '*' >> .git/info/exclude` in it. diff --git a/docs/decisions.md b/docs/decisions.md index 54e8d534..7ef21fed 100644 --- a/docs/decisions.md +++ b/docs/decisions.md @@ -129,22 +129,22 @@ The cap is 5, `bin/plan/todo_table.py`'s `BUNDLE_MAX_R`, from the same chunks: b ## 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 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. +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 another version or machine was probed there 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 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`. -- **A claude.ai account signed in there brings its connectors, skills and plugins, unless the home's settings turn them off.** 2026-12-06, item 605, on the owner's machine with Claude Code 2.1.337: after `/login` in the loop's home, before any build, `claude mcp list` there listed the account's Gmail, Google Drive, Google Calendar and Claude Docs connectors, each connected, and the account's skills sat in `/skills/synced/`. With `disableClaudeAiConnectors: true`, `syncClaudeAiSkills: false` and `syncClaudeAiPlugins: false` in the home's `settings.json`, `claude mcp list` listed no server, the next `claude -p` moved the synced skills to `/skills/.trash/` and loaded only Claude Code's built-in skills, and no `/plugins/synced/` appeared. So the clone's `settings.json` holds all three, and `in_claude_home` sets `ENABLE_CLAUDEAI_MCP_SERVERS=false` as a second lock. Claude Code's docs name the keys (settings-reference, skills and plugins/loading at code.claude.com/docs/en) and the variable (env-vars); they don't say `--strict-mcp-config` keeps connectors out, so the loop doesn't rely on it. A long-lived token from `claude setup-token` can't fetch connectors at all, per the authentication docs; not tested. +- **A claude.ai account signed in there brings its connectors, skills and plugins, unless the home's settings turn them off.** 2026-12-06, item 605, on the owner's machine with Claude Code 2.1.337: after `/login` in the loop's home, before any build, `claude mcp list` there listed the account's Claude Docs, Gmail, Google Calendar and Google Drive connectors, each connected, and the account's skills sat in `/skills/synced/`. With `disableClaudeAiConnectors: true`, `syncClaudeAiSkills: false` and `syncClaudeAiPlugins: false` in the home's `settings.json`, `claude mcp list` didn't list any server, the next `claude -p` moved the synced skills to `/skills/.trash/` and loaded only Claude Code's built-in skills, and no `/plugins/synced/` appeared. So the clone's `settings.json` holds all three, and `in_claude_home` sets `ENABLE_CLAUDEAI_MCP_SERVERS=false` as a second lock. Claude Code's docs name the keys (settings-reference, skills and plugins/loading at code.claude.com/docs/en) and the variable (env-vars); they don't say `--strict-mcp-config` keeps connectors out, so the loop doesn't rely on it. A long-lived token from `claude setup-token` can't fetch connectors at all, per the authentication docs; not tested. Two more points from the docs, not tested: an organisation's managed settings can't turn the account's skills or plugins back on, since a `true` in either sync key is "the same as unset", nor its connectors, since a `true` in `disableClaudeAiConnectors` applies from any file; and on macOS the sign-in's Keychain entry is keyed to `CLAUDE_CONFIG_DIR`, so the home's sign-in stays apart from the person's own. - **Transcripts** land in `/projects//.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 `/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. ## 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 links below reaches the clone. `bin/claude_home` links `agents/`, `bin/`, `CLAUDE.md`, `principles/` and `rules/` to the clone's, `bin/` and `principles/` since `setup files: …` below, and each of the clone's skills inside a `skills/` folder of the home's own, 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 `agents/`, `CLAUDE.md`, `rules/` and `skills/` 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 links below reaches the clone. `bin/claude_home` links `agents/`, `bin/`, `CLAUDE.md`, `principles/` and `rules/` to the clone's, `bin/` and `principles/` since `setup files: …` below. It links each of the clone's skills inside a `skills/` folder of the home's own. It 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 `agents/`, `CLAUDE.md`, `rules/` and `skills/` through links, which needs a model request. -2026-12-06, item 605, for patch release 0.18.1. Claude Code writes the signed-in account's skills into `/skills/synced/` at sign-in, which README → Install has the person do before the first build. A whole `skills` link then stopped that build at the folder in its place, and once made it would have carried Claude Code's writes into the clone. So `skills/` is a folder of the home's own, and each build replaces only the links in it: a skill the clone dropped loses its link, and what Claude Code wrote there stays in the home. The clone's `.gitignore` also ignores `skills/synced/` and `skills/.trash/`. +2026-12-06, the owner, through item 605 for patch release 0.18.1. Serves goal 2, and goal 1.3: every loop session loads the setup's skills and no account's. Claude Code writes the signed-in account's skills into `/skills/synced/` at sign-in, which README → Install has the person do before the first build. The first build then failed, since a folder already stood where it makes the `skills` link. Had the link come first, Claude Code would have written through it into the clone. So `skills/` is a folder of the home's own, and each build replaces only the links in it: a skill the clone dropped loses its link, and what Claude Code wrote there stays in the home. A skill is a folder holding a `SKILL.md`, so a `synced/` or `.trash/` that 0.18.0 let Claude Code write into a clone isn't linked back. The clone's `.gitignore` also ignores `skills/synced/` and `skills/.trash/`. 2026-12-04, the release review of 0.18.0, declining the architect's finding that two clones can rebuild one home. Only the README keeps the development clone's build-release, build-epic, `task-bench gather` and `claude-release` from repointing a running loop's home. Serves goal 2. One home per machine is what lets the person sign in once. A program-held guard would have to know which clone is the development one and whether a loop is running, and pass both into `claude_home`. The cost of the README's rule is a chunk that runs on unreleased rules after someone ran the development clone's tool. Valid while one person runs the setup on a machine; two clones that run loops at once would each need a home.