Skip to main content

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.
/compact
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.
/context

/resume

Source: src/commands/resume/ Restores a previous conversation session. Claude lists recent sessions and lets you pick one to continue.
/resume

/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.
/share

/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.
/summary

/clear

Source: src/commands/clear/ Clear the conversation history and start with a fresh context. The working directory and project files are not affected.
/clear
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.
/add-dir ./packages/ui

/files

Source: src/commands/files/ List all files currently loaded into the context window.
/files

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.
/agents

/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.
/plan

CommandSourceDescription
/compactcompact/Compress conversation context
/contextcontext/Visualize current context
/resumeresume/Restore a previous session
/sessionsession/List, switch, or delete sessions
/shareshare/Share session via link
/exportexport/Export conversation to file
/summarysummary/Generate session summary
/clearclear/Clear conversation history
/memorymemory/Manage persistent memory (CLAUDE.md)
/add-diradd-dir/Add directory to project context
/filesfiles/List files in current context
/taskstasks/Manage background tasks
/agentsagents/Manage sub-agents
/ultraplanultraplan.tsxGenerate detailed execution plan
/planplan/Enter planning mode

Build docs developers (and LLMs) love