Add exit notifications for slash command agents
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)
Problem Statement
When a slash command agent (like /marketing-agent) completes its task and returns control to the main Claude Code agent, there is no clear notification to the user. This creates confusion about which agent is currently handling requests. Users must explicitly ask "Am I still in [command]?" to verify their current context.
Proposed Solution
Add a clear, visible notification when a slash command agent exits and returns control to the main session. The notification should appear in the conversation and clearly indicate:
- Which agent/command has completed
- That control has returned to the main Claude Code agent
Example notification:
✓ /cold-email agent completed. Returned to main Claude Code session.
Alternative Solutions
- Status line indicator: Show the current active agent in the Claude Code status line (e.g., "Agent: cold-email" vs "Agent: main")
- Prompt prefix: Add a visual prefix to responses indicating which agent is responding (e.g., "[cold-email]" or "[main]")
- Explicit exit command: Require users to manually exit slash commands with a command like /exit or /done, preventing silent transitions
- Session persistence: Keep slash command agents active for the entire session unless explicitly exited, rather than auto-exiting after task completion
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
Scenario: User is working on a cold email campaign optimization project.
- User invokes /cold-email to get help with email sequences
- Agent helps optimize Steps 1-6, fix language issues, and rename files
- Agent silently exits after completing the task
- User asks follow-up question: "Should I update the subject lines?"
- Problem: User expects cold-email agent to respond with specialized expertise, but main agent responds instead with generic advice
- User asks: "Am I still in /cold-email?" to verify context
- User must re-invoke /cold-email to continue with specialized agent
Additional Context
- This issue affects all custom slash commands, not just /cold-email
- Silent transitions between agents can lead to:
- Confusion about why responses lack expected specialized knowledge
- Wasted prompts asking context-verification questions
- Need to re-explain context when re-invoking the agent
- Similar tools (like tmux, screen, virtual environments) show clear indicators of current context/session
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗