[BUG] User-level MCP servers don't load in worktree sessions
Description
MCP servers configured in ~/.claude/settings.json (user-level) do not load when Claude Code is running inside a git worktree (e.g., claude -w <worktree>). The servers start fine when tested manually and work in regular (non-worktree) sessions.
Steps to Reproduce
- Add an MCP server to
~/.claude/settings.json:
{
"mcpServers": {
"rescuetime": {
"command": "fastmcp",
"args": ["run", "/path/to/server.py"],
"env": { "API_KEY": "..." }
}
}
}
- Start a regular Claude Code session in a repo -- MCP tools appear in deferred tools list. Works.
- Start a worktree session:
claude -w my-worktree(or enter an existing worktree) - MCP tools do NOT appear.
ToolSearchreturns no matches for the server name. - The server binary runs fine when tested manually from the worktree directory (
fastmcp run server.pystarts without error).
Expected Behavior
User-level MCP servers from ~/.claude/settings.json should load regardless of whether the session is in a worktree or the main working tree.
Actual Behavior
MCP servers silently fail to connect in worktree sessions. No error is shown. The tools simply don't appear.
Environment
- Claude Code version: latest (April 2026)
- macOS (Darwin 25.4.0, arm64)
- Git worktrees created via
claude -wor manually viagit worktree add - FastMCP 3.2.3 (also reproduced with a
uv runbased community MCP server)
Additional Context
This is related to a known pattern where worktree sessions also silently skip UserPromptSubmit hooks. It appears worktree sessions may not fully inherit user-level configuration. Project-level settings (.claude/settings.local.json) ARE read, but user-level MCP servers are not connected.
Workaround: duplicate the MCP config into the project-level .claude/settings.local.json, but this is fragile and requires manual sync.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗