Session management
/compact
Source: src/commands/compact/
Compresses the current conversation context to reclaim space and fit more history into the context window. Claude summarizes older parts of the conversation while preserving recent messages and key facts.
Run /compact when conversations grow long and responses start to slow down or lose earlier context.
/context
Source: src/commands/context/
Displays a visual breakdown of what is currently in the context window — open files, memory entries, tool results, and conversation turns.
/resume
Source: src/commands/resume/
Restores a previous conversation session. Claude lists recent sessions and lets you pick one to continue.
/session
Source: src/commands/session/
Manage your sessions: list all saved sessions, switch to a different one, or delete sessions you no longer need.
/session
/session list
/session switch <id>
/session delete <id>
/share
Source: src/commands/share/
Generate a shareable link for the current session. Useful for collaborating with teammates or filing a bug report with full context.
/export
Source: src/commands/export/
Export the current conversation to a file. Supports multiple formats for archiving or sharing outside Claude Code.
/export
/export conversation.md
/summary
Source: src/commands/summary/
Generate a concise summary of everything discussed in the current session.
/clear
Source: src/commands/clear/
Clear the conversation history and start with a fresh context. The working directory and project files are not affected.
Clearing history is irreversible unless you have a saved session. Consider /export or /session before clearing.
Memory & knowledge
/memory
Source: src/commands/memory/
View and manage persistent memory stored in CLAUDE.md files. Memory entries carry over between sessions and teach Claude about your project conventions, preferences, and facts.
/memory
/memory add "Always use pnpm, not npm"
/memory delete <id>
CLAUDE.md files can live at the repo root (project memory) or in ~/.claude/CLAUDE.md (global memory).
/add-dir
Source: src/commands/add-dir/
Add a directory to the current project context. Claude will be aware of all files in that directory for the remainder of the session.
/files
Source: src/commands/files/
List all files currently loaded into the context window.
Tasks & agents
/tasks
Source: src/commands/tasks/
View and manage background tasks that Claude is running or has queued. Tasks are long-running operations that execute outside the main conversation loop.
/tasks
/tasks list
/tasks cancel <id>
/agents
Source: src/commands/agents/
View and manage sub-agents spawned by the current session. Sub-agents handle parallel or delegated work.
/ultraplan
Source: src/commands/ultraplan.tsx
Generate a detailed, step-by-step execution plan for a complex task before any code is written. Useful for large features or refactors where you want to review the approach first.
/ultraplan Migrate the auth system from JWT to session cookies
/plan
Source: src/commands/plan/
Enter planning mode. In planning mode, Claude drafts a plan and waits for your approval before taking any actions.
| Command | Source | Description |
|---|
/compact | compact/ | Compress conversation context |
/context | context/ | Visualize current context |
/resume | resume/ | Restore a previous session |
/session | session/ | List, switch, or delete sessions |
/share | share/ | Share session via link |
/export | export/ | Export conversation to file |
/summary | summary/ | Generate session summary |
/clear | clear/ | Clear conversation history |
/memory | memory/ | Manage persistent memory (CLAUDE.md) |
/add-dir | add-dir/ | Add directory to project context |
/files | files/ | List files in current context |
/tasks | tasks/ | Manage background tasks |
/agents | agents/ | Manage sub-agents |
/ultraplan | ultraplan.tsx | Generate detailed execution plan |
/plan | plan/ | Enter planning mode |