Colour key: Keyboard Slash command Workflow Skill / agent CLI / flag Config / env ★ New in 2026 Removed

Getting the Most Out of Claude Code

A practical guide and reference — verified April 24 2026 · Compiled by Douglas Mun

Claude Code is an agentic coding assistant — it reads your repo, runs commands, edits files, and manages git workflows on its own, within the permission boundaries you set. The gap between casual and expert use is narrow but compounds quickly: the practitioners who get the most out of it plan before they build, give Claude durable project memory, isolate risky work in worktrees, and offload repeated thinking to skills, plugins, and subagents.

How to read this guide. Entries shown in their section colour are stable features. new entries are new in 2026 (v2.1.84 or later) and may require a current install or specific plan tier. Struck-through entries have been removed or deprecated and should be avoided in scripts. Use the search box at the top to filter all entries instantly.

The short path from competent to expert. For anything touching more than a couple of files, start in plan mode (Shift+Tab cycles permission modes, or type /plan) and let Claude propose a structured approach before editing. Put essential project context in a CLAUDE.md at your repo root — it survives compaction and grounds every turn. Codify repeated workflows as skills in .claude/skills/. Isolate parallel or risky work with --worktree. Ask side questions with /btw to keep the main conversation clean. Raise effort with /effort high or xhigh for hard problems on Opus 4.7. And install an LSP plugin for your language so Claude sees type errors in real time as it edits.

Slash Commands

Session & Context

/clearClear history — aliases: /reset, /new
/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 cost

Model & Effort

/model [model]Pick/change model; ←→ adjusts effort
/effort [level]low / medium / high / xhigh★ / max / auto
/fast [on|off]Toggle fast mode

Display & 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, network

Tools & 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 webnew

Workflows & 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)new

Utility

/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 dialognew

Removed / 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.92

Keyboard & Interactive Mode

General Controls

CtrlCCancel input / generation
CtrlDExit session (EOF)
CtrlLClear prompt + force redraw
CtrlOToggle transcript viewer
CtrlRReverse search command history
CtrlGOpen prompt in editor
CtrlXCtrlEOpen in editor (readline)
CtrlBBackground task (tmux: twice)
CtrlTToggle task list
CtrlVPaste image → [Image #N] chip
CtrlXCtrlKKill bg agents (2× in 3s)
EscEscRewind / summarize
Cursor / history navigation
CtrlPUp — history nav
CtrlNDown — history nav

Text Editing

CtrlAStart of current line
CtrlEEnd of current line
CtrlKDelete to end of line
CtrlUDelete to start of line
CtrlWDelete previous word
CtrlYPaste deleted text (yank)
AltYCycle paste history *
AltBBack one word *
AltFForward one word *

Multiline Input

\EnterUniversal — any terminal
CtrlJUniversal control sequence
ShiftEnteriTerm2 / WezTerm / Ghostty / Kitty
OptionEntermacOS w/ Option-as-Meta

Mode Switching

ShiftTabCycle permission modes
AltMCycle permission modes (alt)
OptionPSwitch model (mac)
AltPSwitch model (Win/Linux)
OptionTToggle extended thinking
AltTToggle thinking (Win/Linux)
OptionOToggle fast mode (mac)
AltOToggle fast mode (Win/Linux)

Transcript Viewer (Ctrl+O)

CtrlEToggle show all content
/Search transcript
nNext match
NPrevious match
[Dump to scrollback
vOpen in $VISUAL/$EDITOR
qExit transcript

Vim Mode (enable in /config)

EscNORMAL mode
iInsert before cursor
aInsert after cursor
oOOpen line below / above
vVisual (character) ★
VVisual line ★
hjklMove left/down/up/right
webWord next/end/previous
0$^Line start / end / non-blank
ggGTop / bottom of input
xddDDel char / line / to end
ccCChange line / to end
yyYYank line
pPPaste after / before
u.Undo / repeat
>><<Indent / dedent

⚠ 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

  • --bare for scripted one-shots skips plugins/hooks/skills (faster startup)
  • --max-budget-usd N caps any headless run before it runs away
  • Prefer Grep/Glob over Read for discovery — full reads are expensive
  • Collapse bulky MCP results with anthropic/maxResultSizeChars
  • MAX_THINKING_TOKENS=0 when thinking does not help on this task
  • CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 if not using auto-memory
  • After a long break, prefer /clear over re-caching stale history
  • /skills t sorts by token count — prune the heaviest you rarely use

CLI, Configuration & Automation

CLI Commands

claudeStart interactive session
claude "query"Session with initial prompt
claude -p "query"Headless / print mode
claude -cContinue most recent conversation
claude -r "name"Resume by name or ID
claude updateUpdate to latest version
claude install [version]Install specific / stablenew
claude auth loginSign in (--console for API)new
claude auth logoutLog out of accountnew
claude auth statusAuth status (--text = human)new
claude agentsList configured subagentsnew
claude setup-tokenLong-lived token for CInew
claude remote-controlStart remote-control servernew
claude mcpConfigure MCP servers
claude pluginManage pluginsnew
claude auto-mode defaultsPrint classifier rulesnew

Key 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 version

Permission Modes

defaultPrompt on risky actions
acceptEditsAuto-allow edits; prompt on Bash
planRead-only research / planning
autoClassifier allows safe, denies riskynew
dontAskDeny silently, no prompt
bypassPermissionsSkip ALL checks (dangerous)

Permission Rule Syntax

  • Bash(git *) — any git subcommand
  • Bash(git log *) — specific subcommand
  • Edit(src/**/*.ts) — glob file writes
  • Read(/~/*.env) — read-only paths
  • mcp__<server> — MCP tools by server
  • mcp__<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 memory
CLAUDE.md (project root)Project memory (survives compact)
.claude/rules/*.mdRule fragments loaded by path

Hook Events

SessionStartSession begins or resumes
SessionEndSession terminates
UserPromptSubmitBefore Claude processes prompt
UserPromptExpansionBefore user command → promptnew
PreToolUseBefore tool call (can block)
PostToolUseAfter tool call succeeds
PostToolUseFailureAfter tool call failsnew
PostToolBatchAfter parallel batch resolvesnew
PermissionRequestPermission dialog appears
PermissionDeniedAuto-mode denial (can retry)new
SubagentStartSubagent spawnednew
SubagentStopSubagent finishes
TaskCreatedVia TaskCreatenew
TaskCompletedTask marked completenew
StopClaude finishes responding
StopFailureTurn ended on API errornew
PreCompactBefore context compactionnew
PostCompactAfter compaction completesnew
ElicitationMCP requests input mid-callnew
ElicitationResultAfter user responds to MCPnew
NotificationClaude sends notification
CwdChangedWorking directory changesnew
FileChangedWatched file changes on disknew
ConfigChangeConfig file changesnew
InstructionsLoadedCLAUDE.md / rules loadednew
WorktreeCreate/RemoveWorktree lifecyclenew
TeammateIdleAgent-teams teammate idlenew

Hook Types

commandRun a shell command
httpPOST event JSON to a URL
mcp_toolCall an MCP server toolnew
promptEvaluate with the LLM
agentRun an agentic verifier

Env Vars — Authentication

ANTHROPIC_API_KEYAPI key (overrides subscription)
CLAUDE_CODE_OAUTH_TOKENLong-lived OAuth token for CI
ANTHROPIC_AUTH_TOKENCustom Authorization header
ANTHROPIC_BASE_URLProxy / gateway endpoint
ANTHROPIC_CUSTOM_HEADERSCustom request headers

Env Vars — Providers

CLAUDE_CODE_USE_BEDROCKUse AWS Bedrock
CLAUDE_CODE_USE_VERTEXUse Google Vertex AI
CLAUDE_CODE_USE_FOUNDRYUse Microsoft Foundrynew
CLAUDE_CODE_USE_MANTLEUse Bedrock Mantle endpointnew
AWS_BEARER_TOKEN_BEDROCKBedrock API key
HTTP_PROXY / HTTPS_PROXYProxy configuration
NO_PROXYBypass proxy for domains/IPs

Env Vars — Behaviour & Features

DISABLE_AUTOUPDATERDisable auto-updates
DISABLE_UPDATESBlock ALL updates incl. manualnew
CLAUDE_CODE_NO_FLICKEREnable fullscreen renderingnew
CLAUDE_CODE_DISABLE_MOUSEDisable mouse tracking (fullscreen)new
CLAUDE_CODE_EFFORT_LEVELSet effort level globallynew
CLAUDE_CODE_SIMPLESet by --barenew
CLAUDE_CODE_DISABLE_BACKGROUND_TASKSDisable bg tasks + Ctrl+B
CLAUDE_CODE_DISABLE_CRONDisable /loop + scheduled tasksnew
CLAUDE_CODE_DISABLE_1M_CONTEXTBlock 1M context modelsnew
CLAUDE_CODE_DISABLE_TERMINAL_TITLEStop setting terminal title
CLAUDE_CODE_DISABLE_THINKINGForce-disable extended thinkingnew
MAX_THINKING_TOKENSThinking budget (0 = disable)
MAX_MCP_OUTPUT_TOKENSMCP tool response cap
CLAUDE_CODE_MAX_OUTPUT_TOKENSOutput token limit
BASH_DEFAULT_TIMEOUT_MSBash command timeout
BASH_MAX_TIMEOUT_MSMax bash timeout
API_TIMEOUT_MSAPI timeout (default 10min)
CLAUDE_AUTOCOMPACT_PCT_OVERRIDECompact threshold % (default 95)new
ENABLE_PROMPT_CACHING_1HRequest 1-hour cache TTLnew
CLAUDE_CONFIG_DIROverride config directory
CLAUDE_CODE_SUBPROCESS_ENV_SCRUBScrub secrets from subprocessesnew
CLAUDE_ENV_FILESourced before each Bash command
CLAUDE_CODE_TMPDIROverride temp directorynew

Plugins, Skills & Agents

🧠 Code Intelligence (LSP)

Real-time diagnostics + go-to-def after each edit. Install binary FIRST, then plugin.

typescript-lsp TS / JavaScript
Binary: npm i -g typescript-language-server typescript
pyright-lsp Python
Binary: pip install pyright
rust-analyzer-lsp Rust
Binary: rustup component add rust-analyzer
gopls-lsp Go
Binary: go install golang.org/x/tools/gopls@latest
clangd-lsp C / C++
Binary: brew install llvm
csharp-lsp C#
Binary: dotnet tool install -g csharp-ls
jdtls-lsp Java
Binary: brew install jdtls
kotlin-lsp Kotlin
Binary: kotlin-language-server release
swift-lsp Swift
Binary: Bundled with Xcode
lua-lsp Lua
Binary: brew install lua-language-server
php-lsp PHP
Binary: npm i -g intelephense

🔌 Official Plugins

Marketplace: claude-plugins-official
Browse: claude.com/plugins

Source Control

githubPRs, issues, repos, Actions
gitlabMRs, issues, pipelines, repos

Project Management

atlassianJira tickets + Confluence docs
asanaTasks, projects via Asana MCP
linearIssues, cycles via Linear MCP
notionPages, databases, search

Design

figmaFiles, components, variables, designs

Infrastructure

vercelDeploy, inspect Vercel projects
firebaseFirestore, Auth, Storage, Hosting
supabasePostgres, Auth, Edge Functions

Communication

slackPost messages, read channels
sentryQuery errors, issues, replays

Development Workflow

commit-commandsGit commit/push/PR workflows
pr-review-toolkitSpecialised PR review agents
code-reviewReplaces deprecated /review
agent-sdk-devBuild with Claude Agent SDK
plugin-devCreate & debug your own plugins

Output Styles

explanatory-output-styleEducational insights
learning-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 marketplace
claude plugin uninstall <n>Remove (--keep-data optional)
claude plugin enable <n>Re-enable disabled plugin
claude plugin disable <n>Disable without uninstalling
claude plugin update <n>Update to latest
claude plugin listList installed (--json)
claude plugin tagCreate release git tag
claude plugin validateCheck schemas

Plugin Path Variables

${CLAUDE_PLUGIN_ROOT}Install dir (changes on update)
${CLAUDE_PLUGIN_DATA}Persistent data — survives updates
${user_config.KEY}User-supplied config value

Use 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 /Slipbox and list them
  • Generate MOCs/Machine-Learning.md linking every #topic/ml note
  • 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 type

Safe-Ops Workflow

  1. git commit before any bulk change
  2. Enter /plan mode — review the approach
  3. Preview with /diff after each turn
  4. Major restructures → use --worktree
  5. Commit working state; iterate in small steps
  6. Ask /btw for meta questions mid-task

★ Expert Tips

  • Keep CLAUDE.md short & imperative
  • Store templates in /Templates — Claude reads them like any other note
  • Add .obsidian/workspace*.json to .gitignore
  • Use acceptEdits mode for trusted ops, default for destructive ones
  • Daily note links should form a chain
  • Run /tag-audit monthly, not per-session