claude-code - 💡(How to fix) Fix [Bug] Local directory permissions get copied into global settings.json on config update [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#46681Fetched 2026-04-12 13:35:51
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Error Message

[{"error":"Error: NON-FATAL: Lock acquisition failed for /home/jshute/.local/share/claude/versions/2.1.101 (expected in multi-process scenarios)\n at qQ$ (/$bunfs/root/src/entrypoints/cli.js:2838:2153)\n at Ee8 (/$bunfs/root/src/entrypoints/cli.js:2838:1233)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:22.317Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:22.356Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n at async W (/$bunfs/root/src/entrypoints/cli.js:6005:10596)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:23.026Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n at async v (/$bunfs/root/src/entrypoints/cli.js:6005:11366)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:23.028Z"}]

Fix Action

Fix / Workaround

How to reproduce

  1. Start: Subdir settings.local.json has some items on permissions->allow and a defaultMode. Homedir settings.json has a smaller list.
  2. In CLI, open /config, change default mode setting, and press enter to save.
  3. The local permissions get merged into the global permission list. It seems to merge the entire effective permissions block into permanent global settings.

Code Example

[{"error":"Error: NON-FATAL: Lock acquisition failed for /home/jshute/.local/share/claude/versions/2.1.101 (expected in multi-process scenarios)\n    at qQ$ (/$bunfs/root/src/entrypoints/cli.js:2838:2153)\n    at Ee8 (/$bunfs/root/src/entrypoints/cli.js:2838:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:22.317Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:22.356Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n    at async W (/$bunfs/root/src/entrypoints/cli.js:6005:10596)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:23.026Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n    at async v (/$bunfs/root/src/entrypoints/cli.js:6005:11366)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:23.028Z"}]
RAW_BUFFERClick to expand / collapse

Bug Description Claude copies permissions from local-dir settings.local.json into global settings.json unprompted when updating /config.

How to reproduce

  1. Start: Subdir settings.local.json has some items on permissions->allow and a defaultMode. Homedir settings.json has a smaller list.
  2. In CLI, open /config, change default mode setting, and press enter to save.
  3. The local permissions get merged into the global permission list. It seems to merge the entire effective permissions block into permanent global settings.

Environment Info

  • Platform: linux
  • Terminal: vte-based
  • Version: 2.1.101
  • Feedback ID: 55c433eb-79d1-4757-9ceb-be483d27c113

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /home/jshute/.local/share/claude/versions/2.1.101 (expected in multi-process scenarios)\n    at qQ$ (/$bunfs/root/src/entrypoints/cli.js:2838:2153)\n    at Ee8 (/$bunfs/root/src/entrypoints/cli.js:2838:1233)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:22.317Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:22.356Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n    at async W (/$bunfs/root/src/entrypoints/cli.js:6005:10596)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:23.026Z"},{"error":"Error: Plugin MCP server error - mcp-config-invalid: MCP server github invalid: Missing environment variables: GITHUB_PERSONAL_ACCESS_TOKEN\n    at dDH (/$bunfs/root/src/entrypoints/cli.js:1558:33935)\n    at async v (/$bunfs/root/src/entrypoints/cli.js:6005:11366)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-11T15:07:23.028Z"}]

extent analysis

TL;DR

The issue can be mitigated by modifying the code to prevent merging local permissions into global settings when updating the /config endpoint.

Guidance

  • Review the code in cli.js around lines 2838 and 1558 to understand how permissions are being merged and how errors are being handled.
  • Verify that the settings.local.json and settings.json files are being read and written correctly, and that the defaultMode setting is being updated as expected.
  • Consider adding a check to prevent the merging of local permissions into global settings when the /config endpoint is updated.
  • Investigate the missing GITHUB_PERSONAL_ACCESS_TOKEN environment variable and its impact on the MCP server error.

Example

No code snippet can be provided without modifying the existing codebase, but the fix likely involves modifying the cli.js file to handle permissions merging correctly.

Notes

The provided error messages indicate issues with lock acquisition and missing environment variables, but these may not be directly related to the permissions merging issue. The fix should focus on preventing the unwanted merging of local permissions into global settings.

Recommendation

Apply a workaround by modifying the code to prevent merging local permissions into global settings when updating the /config endpoint, as the root cause of the issue appears to be related to the handling of permissions in the cli.js file.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING