Keyboard Shortcuts & Productivity
Master the Claude Code CLI shortcuts and techniques to work faster in the terminal.
Mode Switching
Claude Code has permission modes you can cycle through instantly:
- Shift + Tab — Cycle: default → acceptEdits → plan. Once enabled,
autoandbypassPermissionsslot in afterplan;dontAskstays out of the cycle.
Use default for careful work, acceptEdits when you trust the flow, and plan for read-only exploration. See the Plan Mode guide for details.
Essential Shortcuts
- Ctrl + C — Cancel current generation or input
- Ctrl + D — Exit Claude Code
- Ctrl + L — Redraw the terminal (recovers from garbled display; conversation history is kept)
- Ctrl + R — Reverse search through command history
- ↑ — Recall previous prompts
- Esc Esc — Rewind: undo code changes and/or conversation turns
Input & References
- @ — Reference a file or directory (tab-completable)
- / — Open slash commands menu
- # — Quick-update CLAUDE.md from the conversation (legacy; prefer
/memoryfor the official editor) - ! — Enter bash mode (run shell commands directly)
- Ctrl + V — Paste an image for visual analysis
Useful Slash Commands
| Command | Description |
|---|---|
/clear | Reset conversation history |
/compact | Compress history while preserving key context |
/context | Visualize context window usage |
/cost | Show session token usage and cost |
/permissions | View and manage tool permissions |
/hooks | Review all hooks loaded in current session |
/mcp | Inspect configured MCP servers and tools |
/agents | Manage subagents (Running + Library tabs) |
/plugins | Manage installed plugins |
/workflows | Inspect, pause, resume, stop, or save dynamic workflow runs |
/goal | Keep Claude working until a completion condition holds |
/loop | Re-run a prompt on an interval inside the current session |
/advisor | Configure a stronger model for second opinions |
/model | Switch the AI model |
/effort | Set reasoning effort: low, medium, high, max |
/rename <name> | Name the current session for easy resumption |
/memory | Open CLAUDE.md files for editing |
/config | Open settings editor (replaces old /vim, /output-style) |
/doctor | Check installation health |
/powerup | Interactive animated lessons for Claude Code features |
/team-onboarding | Generate a ramp-up guide from your usage history |
/review | Review current PR or staged diff |
Session Management
Resume a Session
claude --continue # resume most recent conversation (short: -c)
claude --resume # pick from a list of recent sessions (short: -r)
claude --resume "my-task" # resume a named session directlyName a Session
claude --name "auth-refactor" # set a display name at launch (short: -n)Or rename mid-session with /rename auth-refactor. Named sessions are easy to resume with --resume.
Fork a Session
claude --resume "auth-refactor" --fork-session # branch into a new session IDUseful when you want to explore an alternative approach without modifying the original session.
Start an Isolated Worktree
claude --worktreeUse this when you want a parallel session with its own branch and working directory.
Workflow Tips
Pipe Input
Feed external data directly into Claude Code using Unix pipes:
git diff main | claude -p "review this diff for issues"
tail -f app.log | claude -p "summarize errors as they appear"
cat schema.sql | claude -p "suggest indexes for this schema"File References
Use @ to pull file content into your prompt efficiently:
@src/auth/login.ts what does this auth flow do?
look at @tests/ and write tests for @src/utils/parser.tsHeadless / Scripting Mode
For CI and automation, use -p (print mode):
claude -p "run all tests and report failures" --output-format jsonAdd --bare for the fastest possible startup — it skips hooks, skills, plugins, MCP servers, auto memory, and CLAUDE.md:
claude --bare -p "check if this file has any syntax errors"Why do these shortcuts matter?
Each shortcut maps to a core agent capability: mode switching controls the permission model, @ manages the context window, and Esc Esc leverages checkpointing. Understanding the agent architecture behind these makes you faster.
Related Reading
- Plan Mode — Learn the Explore → Plan → Code workflow
- CLAUDE.md & Memory — Configure persistent project context
- Git & Parallel Sessions — Use worktrees for safe parallel work
- Dynamic Workflows — Use ultracode for large orchestration
- Automation — Keep Claude working with goals, loops, routines, and channels
- Debugging Tips — Fix bugs faster with Claude
Continue with practice
You have finished the core ideas of Keyboard Shortcuts & Productivity.
If you want to turn the idea into something reusable, continue practicing on AgentWay.