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

Open
#95,693 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:core area:permissions bug platform:macos
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 autoMemoryDirectory in your settings.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

  1. A shell write of the one-key file:

    mkdir -p .claude && cat > .claude/settings.json <<'EOF2'
    {
      "autoMemoryDirectory": "~/projects/<repo>/docs/memory"
    }
    EOF2
    

    Result: Permission for this action was denied by the Claude Code auto mode classifier. Reason: [Self-Modification].

  2. Invoking the built-in skill update-config with the argument Set 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

  1. Start Claude Code in auto mode inside a git repository with no .claude/settings.json.
  2. Ask: "Configure auto memory into docs/memory inside this repo using the documented autoMemoryDirectory setting in the project's .claude/settings.json."
  3. Observe the agent's write (via Bash) is denied with [Self-Modification].
  4. Ask it to use /update-config for 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.