/clearClear history — aliases: /reset, /newSlash Commands
Session & Context
/compact [instr]Compact conversation with optional focus/contextVisualise context usage as a coloured grid/copy [N]Copy last (or Nth) response/diffInteractive diff — uncommitted + per-turn/export [file]Export conversation as plain text/rewindRewind conversation/code (alias: /checkpoint)/branch [name]Branch conversation (alias: /fork)/resume [session]Resume by ID/name (alias: /continue)/rename [name]Rename session — shows on prompt bar/recapShow session context recapnew/btw <question>Side question — no context costModel & Effort
/model [model]Pick/change model; ←→ adjusts effort/effort [level]low / medium / high / xhigh★ / max / auto/fast [on|off]Toggle fast modeDisplay & Config
/configOpen settings (alias: /settings)/themeChange theme — now supports custom themesnew/color [color]Set prompt-bar color for session/tui [fullscreen]Flicker-free fullscreen renderingnew/focusToggle focus viewnew/statuslineConfigure shell prompt status linenew/keybindingsOpen/create keybindings config/terminal-setupConfigure Shift+Enter shortcut/permissionsManage allow/ask/deny rules/statusSettings — version, model, networkTools & Integration
/initInitialize project CLAUDE.md/memoryEdit CLAUDE.md; manage auto-memory/mcpManage MCP server connections/hooksView hook configurations/skillsList skills — t sorts by tokens/agentsManage agent configurations/pluginPlugin manager (alias: /plugins)/chromeConfigure Claude in Chrome/reload-pluginsHot-reload plugins/ideManage IDE integration status/add-dir <path>Add working directory/install-github-appSet up Claude GitHub Actionsnew/install-slack-appInstall Claude Slack app (OAuth)new/web-setupConnect GitHub to Claude Code on webnewWorkflows & Agentic
/plan [desc]Enter plan mode with optional task/batch <instr>5–30 worktree agents [Skill]/simplify [focus]3-agent parallel code review [Skill]/debug [desc]Debug logging + analysis [Skill]/loop [interval]Recurring task; self-paces [Skill]/schedule [desc]Create/run routinesnew/ultraplan <prompt>Cloud plan editor → web UInew/ultrareview [PR#]Parallel multi-agent PR reviewnew/autofix-pr [prompt]Web agent auto-fix PR CI/commentsnew/security-reviewScan branch diff for vulnerabilitiesnew/team-onboardingReplayable guide from 30-day historynew/less-permission-promptsPropose allowlist from transcriptsnew/claude-apiLoad API reference [Skill]Remote & Sessions
/remote-controlEnable remote control (alias: /rc)/teleport /tpPull web session into local terminalnew/remote-envConfigure default remote environmentnew/voiceToggle push-to-talk dictation/desktop /appContinue in Desktop app (mac/Win)/mobile /iosQR code for Claude mobile app/sandboxToggle sandbox modenew/tasksList background tasks (alias: /bashes)newUtility
/usagePlan limits + rate statusnew/statsOpens /usage → Stats tab/costOpens /usage → Cost tab/extra-usageKeep working past rate limits/insightsReport on patterns + friction/doctorDiagnose install; f = auto-fix/powerupInteractive tutorials + demosnew/release-notesChangelog — version picker/feedback /bugSubmit feedback/helpShow help and commands/exit /quitExit the CLI/login / /logoutSign in / out/mcp elicitationMCP server structured-input dialognewRemoved / Deprecated
/pr-commentsRemoved v2.1.91 — ask Claude directly/vimRemoved v2.1.92 — use /config → Editor/reviewDeprecated — install code-review plugin/tagRemoved in v2.1.92Keyboard & Interactive Mode
General Controls
Text Editing
Multiline Input
Mode Switching
Transcript Viewer (Ctrl+O)
Vim Mode (enable in /config)
⚠ macOS Option-as-Meta Setup
Alt+B, Alt+F, Alt+Y, Alt+M, Alt+P, Alt+T need Option configured as Meta:
- iTerm2: Profiles → Keys → Left Option = "Esc+"
- Terminal.app: Profiles → Keyboard → check "Use Option as Meta Key"
- VS Code: set
"terminal.integrated.macOptionIsMeta": true
Beyond the Cheat Sheet — Tips to Save Tokens and Work Smarter
Four habits that separate heavy spenders from efficient operators
1. Know where your tokens actually go. Every turn sends the full conversation, every active tool schema, every loaded CLAUDE.md, and the system prompt. Run /context regularly to see the breakdown as a grid — you will often find memory bloat, oversized tool results, or a stale conversation dominating the budget. Check /usage after expensive operations to see what you actually paid for. The fastest wins come from finding the single biggest offender rather than micro-optimising everywhere.
2. Plan before you spend. Exploratory back-and-forth is the most common source of waste. Enter plan mode (Shift+Tab to cycle or /plan) for anything non-trivial — Claude researches and proposes an approach in one pass, and you approve before any editing begins. Use /compact focus on <topic> proactively rather than waiting for auto-compact at 95%. Put durable facts in CLAUDE.md so they survive compaction.
3. Match the model and effort to the task. Opus 4.7 at xhigh effort is extraordinary for complex agentic coding, but routine edits, formatting, and lookups run fine on Sonnet 4.6 at medium. /effort low is often enough for "rename this variable everywhere" work. Subscription users get a 1-hour prompt cache TTL automatically; API-key users opt in with ENABLE_PROMPT_CACHING_1H=1. Avoid switching models mid-conversation — the next turn re-reads the full history uncached.
4. Delegate — do not clutter. Spawn the Explore subagent (read-only, Haiku, cheaper) for codebase navigation instead of doing it in main context. Use /btw for side questions — it reuses the parent prompt cache and never enters history. Prefer @path/to/file.md over pasting contents. For parallel work, launch separate --worktree sessions. If you re-explain the same workflow a third time, codify it as a skill in .claude/skills/.
Quick Wins
--barefor scripted one-shots skips plugins/hooks/skills (faster startup)--max-budget-usd Ncaps any headless run before it runs away- Prefer
Grep/GloboverReadfor discovery — full reads are expensive - Collapse bulky MCP results with
anthropic/maxResultSizeChars MAX_THINKING_TOKENS=0when thinking does not help on this taskCLAUDE_CODE_DISABLE_AUTO_MEMORY=1if not using auto-memory- After a long break, prefer
/clearover re-caching stale history /skills tsorts by token count — prune the heaviest you rarely use
CLI, Configuration & Automation
CLI Commands
claudeStart interactive sessionclaude "query"Session with initial promptclaude -p "query"Headless / print modeclaude -cContinue most recent conversationclaude -r "name"Resume by name or IDclaude updateUpdate to latest versionclaude install [version]Install specific / stablenewclaude auth loginSign in (--console for API)newclaude auth logoutLog out of accountnewclaude auth statusAuth status (--text = human)newclaude agentsList configured subagentsnewclaude setup-tokenLong-lived token for CInewclaude remote-controlStart remote-control servernewclaude mcpConfigure MCP serversclaude pluginManage pluginsnewclaude auto-mode defaultsPrint classifier rulesnewKey CLI Flags
--modelsonnet / opus / full name--permission-modedefault / acceptEdits / plan / auto★ / bypass--effortlow / med / high / xhigh★ / max--output-formattext / json / stream-json--max-turns NLimit agentic turns--max-budget-usd NCost cap per session--worktree / -wIsolated git worktreenew--tmuxCreate tmux pane for worktreenew--bareFaster startup — skip plugins/hooksnew--agent <name>Specify agent for sessionnew--agents {JSON}Define agents dynamicallynew--from-pr NResume PR-linked sessionsnew--fork-sessionNew ID when resumingnew--name / -n "x"Set session display namenew--remote "task"Create web session--remote-control / --rcEnable Remote Control--teleportPull web → local terminalnew--mcp-config <file>Load MCP from JSONnew--strict-mcp-configOnly use --mcp-confignew--settings <file>Load extra settingsnew--plugin-dir <path>Load plugins from directorynew--json-schema {schema}Validated JSON outputnew--system-promptReplace system prompt--append-system-promptAppend to system prompt--allowedToolsTools auto-allowed--disallowedToolsTools removed from context--toolsRestrict built-in tools--dangerously-skip-permissionsBypass ALL permission checks--debug [categories]Debug w/ category filternew--verboseFull turn-by-turn logs--version / -vShow versionPermission Modes
defaultPrompt on risky actionsacceptEditsAuto-allow edits; prompt on BashplanRead-only research / planningautoClassifier allows safe, denies riskynewdontAskDeny silently, no promptbypassPermissionsSkip ALL checks (dangerous)Permission Rule Syntax
Bash(git *) — any git subcommandBash(git log *) — specific subcommandEdit(src/**/*.ts) — glob file writesRead(/~/*.env) — read-only pathsmcp__<server> — MCP tools by servermcp__<server>__<tool> — specific tool
Config Files
~/.claude/settings.jsonUser (global).claude/settings.jsonProject (shared via git).claude/settings.local.jsonLocal (gitignored)managed-settings.jsonAdmin-deployed (read-only)~/.claude.jsonOAuth & MCP state~/.claude/themes/Custom themesnew~/.claude/keybindings.jsonCustom keybindings~/.claude/CLAUDE.mdGlobal personal memoryCLAUDE.md (project root)Project memory (survives compact).claude/rules/*.mdRule fragments loaded by pathHook Events
SessionStartSession begins or resumesSessionEndSession terminatesUserPromptSubmitBefore Claude processes promptUserPromptExpansionBefore user command → promptnewPreToolUseBefore tool call (can block)PostToolUseAfter tool call succeedsPostToolUseFailureAfter tool call failsnewPostToolBatchAfter parallel batch resolvesnewPermissionRequestPermission dialog appearsPermissionDeniedAuto-mode denial (can retry)newSubagentStartSubagent spawnednewSubagentStopSubagent finishesTaskCreatedVia TaskCreatenewTaskCompletedTask marked completenewStopClaude finishes respondingStopFailureTurn ended on API errornewPreCompactBefore context compactionnewPostCompactAfter compaction completesnewElicitationMCP requests input mid-callnewElicitationResultAfter user responds to MCPnewNotificationClaude sends notificationCwdChangedWorking directory changesnewFileChangedWatched file changes on disknewConfigChangeConfig file changesnewInstructionsLoadedCLAUDE.md / rules loadednewWorktreeCreate/RemoveWorktree lifecyclenewTeammateIdleAgent-teams teammate idlenewHook Types
commandRun a shell commandhttpPOST event JSON to a URLmcp_toolCall an MCP server toolnewpromptEvaluate with the LLMagentRun an agentic verifierEnv Vars — Authentication
ANTHROPIC_API_KEYAPI key (overrides subscription)CLAUDE_CODE_OAUTH_TOKENLong-lived OAuth token for CIANTHROPIC_AUTH_TOKENCustom Authorization headerANTHROPIC_BASE_URLProxy / gateway endpointANTHROPIC_CUSTOM_HEADERSCustom request headersEnv Vars — Providers
CLAUDE_CODE_USE_BEDROCKUse AWS BedrockCLAUDE_CODE_USE_VERTEXUse Google Vertex AICLAUDE_CODE_USE_FOUNDRYUse Microsoft FoundrynewCLAUDE_CODE_USE_MANTLEUse Bedrock Mantle endpointnewAWS_BEARER_TOKEN_BEDROCKBedrock API keyHTTP_PROXY / HTTPS_PROXYProxy configurationNO_PROXYBypass proxy for domains/IPsEnv Vars — Behaviour & Features
DISABLE_AUTOUPDATERDisable auto-updatesDISABLE_UPDATESBlock ALL updates incl. manualnewCLAUDE_CODE_NO_FLICKEREnable fullscreen renderingnewCLAUDE_CODE_DISABLE_MOUSEDisable mouse tracking (fullscreen)newCLAUDE_CODE_EFFORT_LEVELSet effort level globallynewCLAUDE_CODE_SIMPLESet by --barenewCLAUDE_CODE_DISABLE_BACKGROUND_TASKSDisable bg tasks + Ctrl+BCLAUDE_CODE_DISABLE_CRONDisable /loop + scheduled tasksnewCLAUDE_CODE_DISABLE_1M_CONTEXTBlock 1M context modelsnewCLAUDE_CODE_DISABLE_TERMINAL_TITLEStop setting terminal titleCLAUDE_CODE_DISABLE_THINKINGForce-disable extended thinkingnewMAX_THINKING_TOKENSThinking budget (0 = disable)MAX_MCP_OUTPUT_TOKENSMCP tool response capCLAUDE_CODE_MAX_OUTPUT_TOKENSOutput token limitBASH_DEFAULT_TIMEOUT_MSBash command timeoutBASH_MAX_TIMEOUT_MSMax bash timeoutAPI_TIMEOUT_MSAPI timeout (default 10min)CLAUDE_AUTOCOMPACT_PCT_OVERRIDECompact threshold % (default 95)newENABLE_PROMPT_CACHING_1HRequest 1-hour cache TTLnewCLAUDE_CONFIG_DIROverride config directoryCLAUDE_CODE_SUBPROCESS_ENV_SCRUBScrub secrets from subprocessesnewCLAUDE_ENV_FILESourced before each Bash commandCLAUDE_CODE_TMPDIROverride temp directorynewPlugins, Skills & Agents
🧠 Code Intelligence (LSP)
Real-time diagnostics + go-to-def after each edit. Install binary FIRST, then plugin.
typescript-lsp
TS / JavaScript
npm i -g typescript-language-server typescriptpyright-lsp
Python
pip install pyrightrust-analyzer-lsp
Rust
rustup component add rust-analyzergopls-lsp
Go
go install golang.org/x/tools/gopls@latestclangd-lsp
C / C++
brew install llvmcsharp-lsp
C#
dotnet tool install -g csharp-lsjdtls-lsp
Java
brew install jdtlskotlin-lsp
Kotlin
kotlin-language-server releaseswift-lsp
Swift
Bundled with Xcodelua-lsp
Lua
brew install lua-language-serverphp-lsp
PHP
npm i -g intelephense🔌 Official Plugins
Marketplace: claude-plugins-official
Browse: claude.com/plugins
Source Control
githubPRs, issues, repos, ActionsgitlabMRs, issues, pipelines, reposProject Management
atlassianJira tickets + Confluence docsasanaTasks, projects via Asana MCPlinearIssues, cycles via Linear MCPnotionPages, databases, searchDesign
figmaFiles, components, variables, designsInfrastructure
vercelDeploy, inspect Vercel projectsfirebaseFirestore, Auth, Storage, HostingsupabasePostgres, Auth, Edge FunctionsCommunication
slackPost messages, read channelssentryQuery errors, issues, replaysDevelopment Workflow
commit-commandsGit commit/push/PR workflowspr-review-toolkitSpecialised PR review agentscode-reviewReplaces deprecated /reviewagent-sdk-devBuild with Claude Agent SDKplugin-devCreate & debug your own pluginsOutput Styles
explanatory-output-styleEducational insightslearning-output-styleInteractive learning mode⚙ Plugin Management
Quick Install
/plugin install github@claude-plugins-official
/plugin install typescript-lsp@claude-plugins-official
/plugin install commit-commands@claude-plugins-official
CLI Commands
claude plugin install <n>Install from marketplaceclaude plugin uninstall <n>Remove (--keep-data optional)claude plugin enable <n>Re-enable disabled pluginclaude plugin disable <n>Disable without uninstallingclaude plugin update <n>Update to latestclaude plugin listList installed (--json)claude plugin tagCreate release git tagclaude plugin validateCheck schemasPlugin Path Variables
${CLAUDE_PLUGIN_ROOT}Install dir (changes on update)${CLAUDE_PLUGIN_DATA}Persistent data — survives updates${user_config.KEY}User-supplied config valueUse Case: Building an Excellent Obsidian Vault
Treat your vault as a repo — Claude Code does the rest
An Obsidian vault is just a folder of Markdown files — which makes it an ideal Claude Code project. Point Claude at your vault, add a CLAUDE.md at the root describing your conventions, codify repeated note operations as skills in .claude/skills/, and use plan mode before any bulk change. Version-control the vault with git so you can diff, branch, and roll back entire restructures.
📂 Setup & Structure
Initial Setup (one-time)
cd ~/MyVault
git init && git add .
claude
/init # Claude drafts CLAUDE.md
mkdir .claude/skills
PARA Structure
Vault/
├ 1-Projects/ active, deadline-driven
├ 2-Areas/ ongoing responsibilities
├ 3-Resources/ reference material
├ 4-Archive/ completed / inactive
├ Slipbox/ atomic permanent notes
├ Daily/ daily notes
├ Templates/ note templates
├ _attachments/ images, PDFs
└ CLAUDE.md vault conventions
Zettelkasten Structure (alt.)
Vault/
├ Inbox/ fleeting notes
├ Literature/ source-based notes
├ Permanent/ atomic ideas
├ MOCs/ Maps of Content
└ CLAUDE.md
Example CLAUDE.md (vault root)
# Vault Conventions
## Note types & folders
- Daily: `Daily/YYYY-MM-DD.md`
- Permanent: `Slipbox/` — atomic ideas
- Literature: `Literature/` — source notes
- MOC: `MOCs/` — topic indexes
## Frontmatter (required on all notes)
---
type: [daily|permanent|lit|moc]
created: YYYY-MM-DD
tags: [topic1, topic2]
source: <url or citation>
---
## Linking
- Use [[wikilinks]], not markdown links
- Every permanent note links to ≥1 other
- MOCs use bulleted [[links]]
## Tag hierarchy
- #area/work, #area/personal
- #topic/ml, #topic/writing
- #status/draft, #status/reviewed
📝 Templates & Conventions
{{date:...}} syntax requires the Templater plugin; the core Templates plugin uses {{date}} without format.
Daily Note Template
---
type: daily
created: {{date:YYYY-MM-DD}}
tags: [daily]
---
# {{date:dddd, MMMM D YYYY}}
## 🎯 Focus
-
## 📝 Notes
-
## 🔗 Links
- [[Yesterday]] ← [[Today]] → [[Tomorrow]]
## 💡 Ideas captured
-
Permanent Note Template
---
type: permanent
created: {{date:YYYY-MM-DD}}
tags: []
links_to: []
---
# {{title}}
<!-- ONE idea, in your own words -->
## Why it matters
## Related
- [[...]]
## Source
- [[Literature/...]]
Literature Note Template
---
type: lit
author:
year:
url:
tags: []
---
# {{title}}
## Summary (one paragraph)
## Key ideas
-
## Quotes
>
## Permanent notes extracted
- [[Slipbox/...]]
⚡ Bulk Ops & Custom Skills
Useful Prompts (use /plan first!)
- Add missing frontmatter to all notes, infer type from folder
- Find orphan notes (zero backlinks) in
/Slipboxand list them - Generate
MOCs/Machine-Learning.mdlinking every#topic/mlnote - Find duplicate or near-duplicate notes; suggest merges in a report
- Extract permanent notes from last month's daily notes into
/Slipbox - Rename all files to kebab-case, update every
[[wikilink]]referencing them - Convert markdown links to
[[wikilinks]]where the target is in-vault - Audit tag usage; propose a consolidated hierarchy
- Find notes with broken
[[wikilinks]]and list targets - Migrate this Notion export to vault using our conventions
Custom Skills to Build
Suggested patterns for .claude/skills/<n>/SKILL.md — write each yourself; names are illustrative.
/dailyOpen today's daily note; create if absent/weekly-reviewReview week: extract insights → /Slipbox/moc <topic>Build Map of Content for #topic/*/orphansList notes with no in/out links/frontmatter-fixAdd/repair frontmatter across vault/link-suggestSuggest links for current note/atomicizeSplit multi-idea note into atomic notes/lit <url>Fetch article → draft literature note/tag-auditReport tag usage + hierarchy warnings/inbox-processTriage Inbox/ notes by typeSafe-Ops Workflow
- git commit before any bulk change
- Enter
/planmode — review the approach - Preview with
/diffafter each turn - Major restructures → use
--worktree - Commit working state; iterate in small steps
- Ask
/btwfor meta questions mid-task
★ Expert Tips
- Keep
CLAUDE.mdshort & imperative - Store templates in
/Templates— Claude reads them like any other note - Add
.obsidian/workspace*.jsonto.gitignore - Use
acceptEditsmode for trusted ops,defaultfor destructive ones - Daily note links should form a chain
- Run
/tag-auditmonthly, not per-session