[FEATURE] isolated: true flag for slash commands to run with clean context
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 running multiple slash commands sequentially in one session (e.g., /commandA followed by
/commandB), the second command's execution is polluted by the first command's conversation
history. This causes:
- The main session's orchestration logic being influenced by irrelevant prior context
- Subagents spawned by the command are already isolated, but the main session that orchestrates
them is not
- The only workaround is manually typing
/clearbetween commands, which breaks workflow
automation
Proposed Solution
Add an isolated frontmatter option to slash commands (and skills):
```markdown
---
name: my-command
isolated: true
---
When isolated: true, the command executes as if the conversation history were empty. Only
persistent state (memory, CLAUDE.md, project settings) is retained — prior conversation turns
are excluded from the context window during this command's execution.
Alternative Solutions
- Manual /clear: Works but not automatable, easy to forget
- Wrapping in an Agent: Agents have clean context, but lose the ability to interact with the
user (e.g., confirmation prompts between stages)
- Launching a new claude process via Bash: Loses interactivity entirely
Priority
High - Significant impact on productivity
Feature Category
CLI commands and flags
Use Case Example
Multi-stage workflows where a user runs one command, then immediately runs another command that
orchestrates multiple sub-agents. The orchestration logic should not be influenced by the output
from the previous command.
Additional Context
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗