The typical session loop
From empty project to review. These six steps form the Context-First lifecycle of a session — in exactly this order.
1
/initCreate CLAUDE.md — always first.
2
/planThink first, then code.
3
prompt
Natural language for coding.
4
/contextHow full is the context?
5
/compactCondense instead of losing.
6
/security-reviewScan before PR / merge.
Context: making the right call
Context management is the biggest lever for output quality. These four questions solve 90% of cases.
- New, independent task?
- →
/clear— drop the history, a fresh start beats drift. - Long, but history still needed?
- →
/compact— condenses to a summary instead of deleting. - Headed in the wrong direction?
- →
/rewind— back to the last checkpoint (code + chat). - Testing an alternative?
- →
/branch— fork off without losing the main line.
All commands by purpose
Syntax in mono, purpose alongside. Arguments are optional when in [brackets].
Context — Core
Biggest lever for quality.
| Command | When | Alias |
|---|---|---|
/clear | New task, clean start. | /reset · /new |
/compact [focus] | Long session, context running low. | — |
/context | Check what’s filling the context. | — |
/rewind | Roll back conversation/code. | /checkpoint |
/branch [name] | Fork off into a new session. | formerly: /fork |
/btw <question> | Side question without context clutter. | — |
Model & Reasoning — Tuning
Control cost vs. depth.
| Command | When | Alias |
|---|---|---|
/model [model] | Sonnet to explore, Opus for the finale. | — |
/effort [low…max|auto] | Complex architecture = high/max. | max requires Opus 4.6 |
/fast [on|off] | Fast, simple iterations. | — |
Code Workflow — Build
From setup to review.
| Command | When |
|---|---|
/init | Always first — generates CLAUDE.md. |
/plan [desc.] | Before multi-step changes. |
/memory | Anchor project conventions. |
/diff | Review uncommitted changes. |
/security-review | Branch scan before PR/merge. |
/agents | Delegate specialized tasks. |
/skills | List available Skills. |
Bundled Skills — Skill
Prompt-based, not hard-wired.
| Command | When |
|---|---|
/code-review | Review (replaces the deprecated /review). |
/batch <instruction> | Mass refactor across worktrees. |
/loop [interval] | Iterate a prompt until green. |
/debug [desc.] | Enable debug logging. |
/simplify [focus] | Clean up changed files. |
/claude-api | Load API reference for the project language. |
Session & Usage — Ops
Resume, measure, export.
| Command | When | Alias |
|---|---|---|
/resume [session] | Continue a conversation. | /continue |
/rename [name] | Name the session. | — |
/export [file] | Save/share the conversation. | — |
/cost | Token usage for this session. | — |
/stats · /usage | Usage, sessions, streaks. | — |
/insights | Session analysis report. | — |
/status | Version, model, account. | — |
Integration & Setup — Connect
MCP, GitHub, IDE, Hooks.
| Command | When |
|---|---|
/mcp | Manage MCP servers & OAuth. |
/install-github-app | Set up the GitHub Actions app. |
/ide | Connect IDE integration. |
/hooks | View Hook configurations. |
/plugin | Manage plugins. |
/terminal-setup | Set the Shift+Enter keybinding. |
Config & System — Config
Permissions, sandbox, diagnostics.
| Command | When | Alias |
|---|---|---|
/config | Open settings. | /settings |
/permissions | View/change permissions. | /allowed-tools |
/sandbox | Toggle sandbox mode. | — |
/doctor | Check installation health. | — |
/vim · /theme · /statusline | Customize editor & UI. | — |
Account & Misc — Util
Login, help, directories.
| Command | When | Alias |
|---|---|---|
/help | Show all commands. | — |
/login · /logout | Switch account / sign out. | — |
/add-dir <path> | Add a working directory. | — |
/feedback | Send feedback/bug. | /bug |
/release-notes | View the changelog. | — |
/mobile | QR code for the mobile app. | — |
/exit | Leave the REPL. | /quit |