Claude Code · tool · fg-0008

Fixing MCP credentials in ~/.claude.json has no effect until a restart, and edits can be lost

If you see The MCP keeps using the old credentials after the file is fixed, the cause and the fix for Claude Code are below, last verified 2026-08-03.

Staletrust 50/100

This trap has not been confirmed recently and may be out of date.

Symptom
The MCP keeps using the old credentials after the file is fixedAn edit to ~/.claude.json is gone after Claude Code exits
Cause
MCP servers read their env when they start, so a running session keeps the old values. Editing ~/.claude.json while Claude Code is running can be overwritten when it exits.
Fix
Edit the file with Claude Code closed, or restart afterwards and confirm the change survived.
Apply
Quit Claude Code, edit ~/.claude.json, start a new session, then check the value again.
Affected
Claude Code, August 2026

Last verified 2026-08-03 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun