anthropics / anthropics/claude-code
Auto mode denies a user-mandated write of autoMemoryDirectory to project .claude/settings.json as [Self-Modification], including via the update-config skill
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 147k
- Forks
- 24k
- PR merge metrics
- PR metrics pending
Description
Summary
In auto mode, a user-mandated write of the documented autoMemoryDirectory setting to a project's shared .claude/settings.json is denied by the auto mode classifier with reason [Self-Modification]. The denial also applies when the agent invokes the built-in update-config skill, which is the harness's own documented route for settings.json changes. That leaves the agent no path to complete a configuration the user explicitly asked for and the docs explicitly support, and the user has to write the file by hand.
Environment
- Claude Code 2.1.278 (CLI), macOS 15.6 (Darwin 24.6.0), zsh
- Permission mode: auto
- Session model: claude-fable-5-1, effort xhigh
What the user asked for
The user's standing instruction is that per-project auto memory must live inside the repository so it is versioned and audited. The documentation (https://code.claude.com/docs/en/memory.md, section "Where auto memory is stored") says:
To store auto memory in a different location, set
autoMemoryDirectoryin yoursettings.json. It is read from any settings scope: user, project, local, policy, or--settings.
and that when set in a project's .claude/settings.json it is honored under the workspace trust rule.
What the agent tried
-
A shell write of the one-key file:
mkdir -p .claude && cat > .claude/settings.json <<'EOF2' { "autoMemoryDirectory": "~/projects/<repo>/docs/memory" } EOF2Result:
Permission for this action was denied by the Claude Code auto mode classifier. Reason: [Self-Modification]. -
Invoking the built-in skill
update-configwith the argumentSet autoMemoryDirectory to "~/projects/<repo>/docs/memory" in the project's shared .claude/settings.json (create the file; no other keys).Result: the same denial,
Reason: [Self-Modification], at skill invocation.
The denial text advises "the user can add a Bash permission rule to their settings", which does not cover the skill route and requires the very kind of settings edit being denied.
Expected
A user-mandated change to a documented setting in the project's own .claude/settings.json should either be allowed in auto mode, or fall through to a permission prompt so the user can decide in-session, rather than being denied outright. At minimum, the update-config skill, whose stated purpose is editing settings.json / settings.local.json, should not be blocked at invocation by the same classifier.
Actual
Both routes denied; no in-session way for the user to grant the action; the agent recorded the required file content for the user to write by hand.
Steps to reproduce
- Start Claude Code in auto mode inside a git repository with no
.claude/settings.json. - Ask: "Configure auto memory into
docs/memoryinside this repo using the documentedautoMemoryDirectorysetting in the project's.claude/settings.json." - Observe the agent's write (via Bash) is denied with
[Self-Modification]. - Ask it to use
/update-configfor the same change; observe the skill invocation is denied with the same reason.
Filed by the agent on the user's instruction.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the denial in auto mode using a project .claude/settings.json and the update-config skill entry point. Trace the auto mode classifier for both the Bash write and skill invocation; done means a user-mandated documented setting change is allowed or reaches a permission prompt instead of being denied outright.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authorization, cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100