Skip to content

[BUG] /add-dir replaces additionalDirectories instead of appending #14097

Closed as duplicate

Description

@mousio

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When using multiple /add-dir commands in a session, only the last directory is persisted to settings.local.json. The command replaces the additionalDirectories array rather than appending to it.

Actual Behavior

"additionalDirectories": [
"D:\Path\To\SecondDirectory"
]

What Should Happen?

Expected Behavior

"additionalDirectories": [
"D:\Path\To\FirstDirectory",
"D:\Path\To\SecondDirectory"
]

Error Messages/Logs

Steps to Reproduce

  1. Start Claude Code in a project directory
  2. Run /add-dir D:\Path\To\FirstDirectory
  3. Run /add-dir D:\Path\To\SecondDirectory
  4. Check .claude/settings.local.json

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.70

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Workaround

Manually edit .claude/settings.local.json to include all directories.

Activity

  1. github-actions commented on Dec 16, 2025

    @github-actions

    Found 3 possible duplicate issues:

    1. Bug: Pressing '2' overwrites .claude/settings.local.json instead of appending permissions #9875
    2. [BUG] "Don't Ask Again" Overwrites Entire Permissions Array #5710
    3. [BUG] [VSCode Extension] "Yes, and don't ask again" erases all existing permissions #10026

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. mousio commented on Dec 16, 2025

    @mousio
    Author

    Hawkeye! This appears to be the same root cause as #5710 - arrays in settings.local.json are replaced instead of merged/appended.

    Issue Affected Array Trigger
    #5710 permissions.allow "Don't ask again"
    #9875 permissions.allow Approve command (option 2)
    #10026 permissions.allow/deny/ask VS Code "Yes, and don't ask again"
    #14097 additionalDirectories /add-dir command

    Closing as duplicate.

  3. github-actions commented on Dec 23, 2025

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:corebugSomething isn't workinghas reproHas detailed reproduction stepsplatform:windowsIssue specifically occurs on Windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions