feat: surface Claude Code multi-instance config-isolation tip on devai:install#143
Merged
Merged
Conversation
…i:install Running multiple concurrent Claude Code instances makes them contend on a single global ~/.claude.json, which Claude Code rewrites constantly. The contention causes Claude Code to tear down and reconnect its entire MCP fleet in lockstep — marko-mcp included — so the marko server appears to "randomly disconnect" even though nothing is wrong with it. This is a Claude Code behavior, not a Marko one, so rather than touching the user's shell, devai:install now prints a tip (only when Claude Code is among the installed agents) pointing at a new troubleshooting section documenting the per-project CLAUDE_CONFIG_DIR workaround. - InstallCommand: print the tip after the install summary when claude-code is among the selected agents - troubleshooting.md: new "Multiple Claude Code instances disconnect MCP servers" section with explanation + copy-paste shell wrapper - tests: tip shown for claude-code, hidden for other agents Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A new project (
acta) reported the marko MCP server "randomly disconnecting." Investigation of Claude Code's per-server MCP logs showed it was not a marko bug: every MCP server (marko-mcp, context-mode, n8n) was being torn down and reconnected in lockstep (23/23 of marko's restarts occurred at the exact same second as the others). The trigger is multiple concurrent Claude Code instances contending on a single global~/.claude.json, which Claude Code rewrites constantly. marko-mcp is just the slowest to re-handshake (it boots a PHP process), so it's the one users notice.This is a Claude Code behavior (anthropics/claude-code#25768, #28829), independent of Marko.
What
Rather than touching the user's shell, surface the documented workaround:
InstallCommand—devai:installprints a tip after the install summary, only whenclaude-codeis among the installed agents, linking to the troubleshooting docs.troubleshooting.md— new section "Multiple Claude Code instances disconnect MCP servers" with the explanation and a copy-paste per-projectCLAUDE_CONFIG_DIRshell wrapper.claude-code, hidden for other agents.Verification
composer test— 6857 passedphpcs+php-cs-fixer --dry-runclean on touched files