Repository navigation
fix(agent-isolation): stop the status line reading ~/.claude/settings.local.json - #1971
Merged
potiuk merged 1 commit intoNov 3, 2026
Merged
Conversation
….local.json Claude Code loads a settings.local.json only from a project's .claude/, never from the home directory. sandbox-status-line.sh still walked ~/.claude/settings.local.json ahead of ~/.claude/settings.json, so a stale `sandbox.enabled: true` there made the footer render [sandbox] or [sandbox-auto] over a session with no sandbox at all — the silent drift the line exists to catch. Drop that file from the walk, say why in the script header, and update the precedence list in the secure-setup guide. Two regression tests cover the home settings.local.json being ignored on its own and not shadowing a `false` in ~/.claude/settings.json. Generated-by: Claude Opus 5
10 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sandbox-status-line.shwalked~/.claude/settings.local.jsonbefore~/.claude/settings.jsonand stopped at the first file that setssandbox.enabled. Claude Code does not load asettings.local.jsonfrom the home directory (the guide already says so for the container-gateway hooks, see fix(agent-isolation): wire the container-gateway hooks where Claude Code loads them #1921), so a staleenabled: truethere made the footer show[sandbox]/[sandbox-auto]for a session with no sandbox.docs/setup/secure-agent-setup.mdsay why.~/.claude/settings.jsonlostsandbox.enabled, the only remainingenabled: truesat in~/.claude/settings.local.json, and the footer showed[sandbox-auto]while a sandboxedtouch ~/xsucceeded and~/.aws/credentialswas readable. Both were denied once/sandboxwrote the project file.Type of change
tools/*/withpyproject.toml) —tools/agent-isolationscript and testsdocs/,README.md,CONTRIBUTING.md)Test plan
TestSandboxTag:test_home_settings_local_is_not_read(only the homesettings.local.jsonenables the sandbox) andtest_home_settings_local_does_not_shadow_settings_json(it saystrue,~/.claude/settings.jsonsaysfalse). Both fail onmainand pass with the fix.uv run --project tools/agent-isolation pytest tools/agent-isolation/tests/test_sandbox_status_line.py: 17 passedprek run --files <changed files>: every hook passes exceptworkspace-pytest, which fails only on threetest_gpg_touch_overlay.pytests (test_wrapped_signer_record_is_cleaned_up[group-signal|dead-owner-sweep],test_failed_signer_publication_preserves_input_status_and_reminder). They fail the same way on unmodifiedmainon this machine (macOS), so they are unrelated to this change.isolated-setup-fingerprinthook regeneratedFRAMEWORK_FINGERPRINT, sincetools/agent-isolation/changed.RFC-AI-0004 compliance
Linked issues
Refs #1921 (its reviewer notes list this script as a follow-up), Refs #1763
Notes for reviewers (optional)
setup_preflight.isolated.configured()read the homesettings.local.json"matching the status line"; its evidence was that the footer showed a sandbox. With this fix the footer stops vouching for that file, andconfigured()has the same wrong assumption. I left it for a separate PR so this one stays to the one script.🤖 Generated with Claude Code