MCP servers should survive /clear and /compact
Resolved 💬 3 comments Opened Mar 8, 2026 by Projazzbone Closed Mar 11, 2026
Feature Request
Problem
All MCP servers die when the user runs /clear or /exit. They must be manually reconnected by calling any tool from that server (lazy-reload). This is especially painful for MCP servers that maintain persistent connections or are used across every session (e.g., Notion, database connectors).
Impact
- Notion MCP: Used for async communication (chalkboard), task tracking, and content generation. After
/clear, the first Notion call fails, then lazy-reload kicks in — but the failed call wastes a turn and confuses the agent - Perplexity MCP: Used for research with cited sources. After
/clear, falls back to the weaker built-in WebSearch - Database MCPs (DuckDB, etc.): Lose connection state and query context
Users doing long sessions /clear frequently (every 30-60 min) to manage context. Each time, all MCP servers drop and must be individually reconnected.
Proposed Solution
MCP servers should persist across /clear and /compact operations. These commands reset the conversation context, not the session infrastructure.
Specifically:
/clearshould only reset conversation history, not kill MCP server processes/compactalready preserves MCP connections (good!) —/clearshould match this behavior/exitkilling MCPs is acceptable since it's a full session termination
Current Workaround
- CLAUDE.md instructs the agent to immediately call an MCP tool after
/clearto force lazy-reload - Users add SessionStart hooks to attempt reconnection
- Notion content is written to local
.mdfiles as fallback when MCP is unavailable
Additional Context
- Filed alongside #32062 (auto-save state before compaction)
- The lazy-reload mechanism works — the issue is just that servers are killed unnecessarily on
/clear - This affects ALL configured MCP servers, not just specific ones
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗