Repository navigation
Should $HOME/.claude be read-write by default?
#2023
Replies: 2 comments
|
I agree with the goal. There are a few things that make the split messier than "state = rw, config = ro", and one of them matters more than 1. Project-level settings outrank user settings. Claude Code merges settings with this precedence: managed > CLI flags > The clean version of the second layer is managed settings ( 2. 3. Linux can't express the carve-out. On macOS, Seatbelt supports deny-within-allow, so "rw For point 2 in your post (in-session edits persisting to non-nono runs) there's a cheap fix that works on both platforms: give sandboxed runs their own config dir ( So my suggestion would be:
|
|
The precedence and 1. The carve-out has to track every name, including names created at runtime. Claude Code's atomic config writes mean deny rules on the literal paths
2. Landlock's LANDLOCK_ACCESS_FS_REFER controls exactly this on Linux. Since kernel 6.7 it's possible to allow rename/link within the sandboxed tree while forbidding moving files across referrer domains (e.g. from a writable state dir into the config dir). Not as expressive as the seatbelt deny-within-allow, but the atomic-save-rename attack is the main thing it closes, and nono could use it when available with the copy- 3. Two files the "config vs state" split tends to miss, both worth denying writes to explicitly:
4. Profile-level defense still needs an external witness. A sandbox can only enforce what its own rules say; if the profile itself has a gap (like the project-level precedence hole noted above), nothing inside the session can report it. Signing an integrity baseline — hashes of managed settings, On the macOS deny-list proposal: I'd add I work on agent-runtime-guard, a local interception layer that does that external-witness job for agent tool calls independently of the sandbox — signed receipts per verdict plus an integrity trail, no remote dependency. It runs free with no key or account, and if it doesn't actually stop this class of attack in your setup, you owe nothing — it has to solve the problem first. The only paid side is human audit/compliance work. https://github.com/DSHCorrectover/agent-runtime-guard |
Uh oh!
There was an error while loading. Please reload this page.
The
claudeprofile grants read-write access to the whole$HOME/.claudesubtree. That subtree holds Claude Code's runtime state, but also its
configuration inputs:
settings.json, hooks, andplugins/. So a sessionrunning under the profile can rewrite the configuration of the tool that
hosts it.
I understand the intent: nono is the primary enforcement layer, and the
agent's own configuration is not meant to carry the security boundary. Two
things still make the default worth revisiting.
Claude Code's own permission and auto-mode settings can act as a second
layer. That only holds if a session cannot relax them while running. Today
it can, because the files defining them are writable.
The same home directory is used outside nono. A configuration change made
during a sandboxed session persists, and applies later to runs where nono
is not in the picture. That turns an in-session edit into a durable change
nobody is reviewing.
The split looks clean: runtime state (transcripts, logs, project data, token
refresh) needs write access. Configuration inputs do not, since plugins and
hooks are installed from the host, outside the session.
Would it make sense for the profile to keep write access to state and treat
configuration as read-only by default, with an opt-in for setups that
genuinely need to write it from inside the sandbox?
All reactions