/compact
Free up context by summarizing the conversation so far. Optionally pass focus instructions for the summary.
Syntax
/compact [instructions]Example
/compact focus on the auth changes we madeAbout
Replaces earlier turns with a concise summary, freeing context while keeping critical details. Optionally pass focus instructions to guide what the summary emphasizes. Use after long exchanges so Claude retains key points without filling the context window.
When to use
- ▸After a long debugging session before starting a new sub-task
- ▸When the context window is getting full mid-task
- ▸Keeping focus on current work without losing prior decisions
More Claude Code commands
parallel-agents
/agents
Manage agent configurations and monitor background agents running in parallel.
parallel-agents
/background
Detach the current session to run as a background agent and free this terminal. Optionally pass a final instruction before detaching.
parallel-agents
/batch
Orchestrate large-scale changes across a codebase in parallel. Decomposes work into 5–30 independent units, each in its own git worktree with its own PR.
context-management
/btw
Ask a quick side question without adding it to the main conversation history.