Skip to content

feat: surface Claude Code multi-instance config-isolation tip on devai:install#143

Merged
markshust merged 1 commit into
developfrom
feature/claude-multi-instance-config-tip
Jun 26, 2026
Merged

feat: surface Claude Code multi-instance config-isolation tip on devai:install#143
markshust merged 1 commit into
developfrom
feature/claude-multi-instance-config-tip

Conversation

@markshust

Copy link
Copy Markdown
Collaborator

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:

  • InstallCommanddevai:install prints a tip after the install summary, only when claude-code is 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-project CLAUDE_CONFIG_DIR shell wrapper.
  • Tests — tip is shown for claude-code, hidden for other agents.

Verification

  • composer test — 6857 passed
  • phpcs + php-cs-fixer --dry-run clean on touched files

…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>
@markshust markshust merged commit 72ab974 into develop Jun 26, 2026
1 check passed
@markshust markshust deleted the feature/claude-multi-instance-config-tip branch June 26, 2026 16:41
@github-actions github-actions Bot added the enhancement New feature or request label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant