[Feature Request] Mid-Conversation Agent Persona Switching
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Feature Request: Mid-Conversation Agent Persona Switching
Summary
Add support for switching between named agent personas mid-conversation while preserving shared context. This would allow users to define multiple agent profiles (as .md files) and toggle between them during a single session, changing the system prompt, tool access, and behavioral guidelines without losing conversation history.
Motivation
The Problem
Claude Code's current agent model supports delegation (subagents run in isolated context and return results) but not switching (changing the active persona while staying in the same conversation context).
In practice, a developer working on a feature often needs to shift between distinct modes:
- Architect mode — Explore the codebase, reason about design trade-offs, propose a plan
- Coder mode — Implement the plan with full write access, follow coding standards
- Reviewer mode — Read-only, critique the implementation against team standards
- Ops/Triage mode — Investigate production issues using monitoring tools (MCP servers, log aggregators)
Today, each of these requires either:
- Manually adjusting your prompts to steer behavior (fragile, verbose)
- Using skills (inject instructions but don't change persona, tool restrictions, or model)
- Delegating to subagents (loses conversation context, results come back summarized)
How Other Tools Solve This
OpenCode allows defining multiple agent .md files with different system prompts and switching between them mid-conversation:
/agent coder -> switches to coder.md persona
/agent reviewer -> switches to reviewer.md persona
/agent architect -> switches to architect.md persona
The conversation context is preserved. Only the system prompt, tool access, and behavioral constraints change.
Why This Matters
In multi-repo or full-stack projects, a single conversation often involves:
- Exploring architecture (read-only, broad search)
- Implementing changes (write access, focused on conventions)
- Reviewing the result (read-only, critical perspective)
- Investigating side effects in production logs (monitoring tools)
Forcing these into separate subagent contexts means repeating background information, losing nuance from earlier discussion, and getting summarized rather than detailed results.
Proposed Solution
Agent Definition Files
Support .md files in .claude/agents/ (project-level) and ~/.claude/agents/ (user-level) that can be switched to, not just delegated to:
---
name: reviewer
description: Code reviewer focused on team standards
tools: [Read, Glob, Grep]
model: sonnet
switchable: true
---
You are a senior code reviewer.
Review code against project standards defined in CLAUDE.md.
Be critical. Flag violations clearly. Do not suggest fixes unless asked.
Switching Command
/switch reviewer -> activates reviewer persona
/switch coder -> activates coder persona
/switch default -> returns to base Claude Code behavior
Or shorter: /agent reviewer
Behavioral Changes on Switch
| Aspect | What changes | What stays |
|--------|-------------|------------|
| System prompt | Replaced with agent's prompt | — |
| Tool access | Restricted to agent's tool list | — |
| Model | Changed if agent specifies one | — |
| Conversation history | — | Preserved |
| File context | — | Preserved |
| Memory / CLAUDE.md | — | Preserved |
Indicator
Show the active agent name in the status line or prompt prefix:
[reviewer] > This function has a potential null reference issue...
[coder] > Fixed. Added a null check before the call.
Use Cases
1. Feature Development Workflow
/switch architect
> "I need to add a caching layer to the API"
(explores codebase, proposes design with trade-offs)
/switch coder
> "Implement the plan"
(writes the code following project conventions)
/switch reviewer
> "Review what we just implemented"
(checks naming conventions, error handling, test coverage)
2. Production Incident
/switch triage
> "Check for failed messages in the purchase queue"
(uses MCP tools, searches logs, categorizes errors)
/switch coder
> "Fix the missing configuration that's causing the failures"
(implements the fix based on triage findings — context is preserved)
3. Code Review with Follow-Up Fix
/switch reviewer
> "Review PR #47"
(read-only analysis, identifies 3 issues)
/switch coder
> "Fix issue #2"
(knows exactly which issue from the review context, no need to re-explain)
Alternatives Considered
| Alternative | Why it's insufficient |
|------------|----------------------|
| Subagents (current) | Isolated context — loses conversation history and nuance |
| Skills | Inject instructions but don't restrict tools or change model |
| Manual prompting | Verbose, fragile, no tool restrictions |
| Multiple terminal sessions | No shared context at all |
| CLAUDE.md per directory | Only changes on cd, not on-demand |
Implementation Considerations
- Context window: Switching personas doesn't reset the conversation, so the context window fills normally. This is intentional — the whole point is preserving context.
- Tool permissions: When switching to a restricted agent (e.g., read-only reviewer), previously granted write permissions should be suspended until switching back.
- Stacking: Consider whether agent prompts should stack with CLAUDE.md or replace it. Recommendation: stack (agent prompt is additive to project instructions).
- Default agent: When no agent is active, behavior is standard Claude Code (current behavior).
- Resumability: If a conversation is resumed, the active agent should be restored.
Environment
- Claude Code version: Latest (as of March 2026)
- Use case: Multi-repo development with custom skills and MCP servers
- Team size: Small team where workflow efficiency has outsized impact
- Comparison: OpenCode supports this pattern today
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗