[FEATURE] Allow non-agent slash commands (/rename, /context, /usage) to run asynchronously without blocking
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
Several built-in slash commands (/rename, /context, /usage, /cost) are purely metadata or UI operations — they don't touch the agent's conversation context, don't invoke tools, and don't require model inference. Yet they share the same execution path as agent-interactive commands like /compact or /help, meaning they block on (or are blocked by) an in-progress agent turn.
When the agent is mid-generation or running a long tool call, I can't quickly rename a conversation, check token usage, or review context — I have to wait for the current turn to finish. This adds friction during long agentic sessions where I want to stay oriented without interrupting work.
Related: #10057 (slash commands ignored during tasks) and #5238 (async background research). This request is narrower — it only asks for concurrency on commands that are already side-effect-free with respect to the agent harness.
Proposed Solution
Classify slash commands into two categories:
- Agent-coupled — commands that interact with the conversation (e.g.,
/compact,/help, user prompts). These continue to require the current turn to complete. - Agent-independent — commands that only read or modify session metadata (e.g.,
/rename,/context,/usage,/cost). These should be executable immediately, even while the agent is mid-turn.
Implementation could be as simple as a { blocking: false } flag on command definitions, allowing the TUI to dispatch them without acquiring the agent turn lock.
Alternative Solutions
- A separate keybinding panel (like a HUD overlay) for status info, avoiding slash commands entirely.
- Queuing non-agent commands and executing them in the gap between tool calls.
Priority
Medium - Nice to have improvement
Feature Category
Interactive mode (TUI)
Use Case Example
I'm in the middle of a 20-tool-call agentic session. I want to check how much context I've consumed (/context) to decide whether to compact soon. Currently I have to wait for the agent to finish its current turn. With this change, /context returns instantly because it's just reading local state.
Additional Context
Claude Code version: 2.1.47, macOS Darwin 24.6.0
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗