Claude Code Shortcuts Cheat Sheet 2026 (PDF Download)

Claude Code Shortcuts Cheat Sheet
Listen to this article

Claude Code Shortcuts Cheat Sheet 2026 (PDF Download)

0:0012:52
onyx

Most developers using Claude Code only scratch the surface. They type prompts, hit Enter, and wait. But Claude Code ships with 80+ slash commands, 60+ CLI flags, full vim mode, customizable keybindings, and keyboard shortcuts that make every interaction faster.

This is the complete reference. Every shortcut, every command, every flag, pulled from official Anthropic documentation and verified against the latest Claude Code release. Bookmark it, open it in a second tab, and come back every time someone mentions a command you've never heard of.

Learn How to build FullStack APP With Claude Code here.


Key Takeaways

  • Claude Code's most powerful shortcut is Shift+Tab, which cycles through permission modes (Default, AcceptEdits, Plan, and Auto) so you can control how much Claude does without asking.
  • Esc interrupts Claude mid-response without losing work; double Esc opens the rewind menu to roll back to a previous checkpoint.
  • Slash commands break into seven categories: session management, code review, GitHub integration, parallel agents, tooling, diagnostics, and scheduling.
  • CLI flags like --worktree, --bare, and --output-format stream-json unlock automation and isolated parallel sessions that most developers never use.
  • Vim mode (enabled via /config) brings full NORMAL and VISUAL mode editing to the Claude Code input, including text objects and operator-motion combinations.
  • Custom keybindings live in ~/.claude/keybindings.json and hot-reload without restarting Claude Code.

  • PDF

    claude-code-cheatsheet-promptslove.pdf

    83 KB

    Download PDF

    Part 1: Interactive Mode Keyboard Shortcuts

    These shortcuts work inside any active Claude Code session. No configuration needed for most of them.

    Official reference: code.claude.com/docs/en/interactive-mode

    Session and Navigation Controls

    ShortcutWhat It Does
    Shift+TabCycle permission modes: Default > AcceptEdits > Plan > Auto > BypassPermissions
    EscInterrupt Claude mid-response. Keeps work done so far
    Esc + Esc (double)When input has text: clear it, save draft to history. When input is empty: open rewind/checkpoint menu
    Ctrl+CCancel current operation. Second press exits Claude Code. Cannot be rebound
    Ctrl+DExit Claude Code (EOF signal). Cannot be rebound
    Ctrl+OToggle verbose transcript viewer (shows tool usage, MCP calls)
    Ctrl+RReverse search through command history
    Ctrl+TToggle the task list in the status area
    Ctrl+BBackground running tasks or bash commands. Tmux users press twice
    Ctrl+X Ctrl+KStop all running background subagents. Press twice within 3 seconds to confirm
    Ctrl+LRedraw the screen. Keeps input and history. Use if display becomes garbled
    Ctrl+G or Ctrl+X Ctrl+EOpen current prompt in your default external text editor
    Alt+P (Win/Linux) or Option+P (Mac)Switch model without clearing your current prompt
    Alt+T (Win/Linux) or Option+T (Mac)Toggle extended thinking mode
    Alt+O (Win/Linux) or Option+O (Mac)Toggle fast mode
    Left/Right arrowsCycle between tabs in permission dialogs and menus
    Up/Down arrowsNavigate command history (or move cursor in multiline input first)
    Ctrl+VPaste image from clipboard (use Alt+V on Windows/WSL)
    Ctrl+S (in history search)Cycle history scope: this session > this project > all projects

    Text Editing Shortcuts (Readline-Style)

    ShortcutWhat It Does
    Ctrl+AMove cursor to start of current line
    Ctrl+EMove cursor to end of current line
    Ctrl+KDelete from cursor to end of line (stores text for paste)
    Ctrl+UDelete from cursor to line start (stores text for paste)
    Ctrl+WDelete previous word (stores text for paste)
    Ctrl+YPaste previously deleted text
    Alt+Y (after Ctrl+Y)Cycle through paste history
    Alt+BMove cursor back one word
    Alt+FMove cursor forward one word

    Mac note: Alt shortcuts require Option configured as Meta in your terminal. In iTerm2: Profiles > Keys > set Left/Right Option to "Esc+". In Apple Terminal: Settings > Profiles > Keyboard > check "Use Option as Meta Key". In VS Code: add "terminal.integrated.macOptionIsMeta": true.

    Multiline Input Methods

    MethodShortcutWorks In
    Backslash + Enter\ + EnterAll terminals
    Ctrl+JCtrl+JAll terminals
    Shift+EnterShift+EnteriTerm2, WezTerm, Ghostty, Kitty, Warp, Apple Terminal, Windows Terminal. Run /terminal-setup for VS Code, Cursor, Alacritty, Zed
    Option+EnterOption+EnterMac with Option configured as Meta

    Quick Input Prefixes

    PrefixWhat It Does
    / at start of inputOpens command/skill menu. Type letters to filter
    ! at start of inputShell mode. Runs command directly and adds output to session context
    @ anywhereTriggers file path autocomplete

    Part 2: Transcript Viewer and Overlay Shortcuts

    Transcript Viewer (open with Ctrl+O)

    ShortcutWhat It Does
    ?Toggle keyboard shortcut help panel
    { / }Jump to previous/next user prompt
    Ctrl+EToggle "show all content"
    [Write full conversation to terminal scrollback
    vWrite conversation to temp file and open in $VISUAL or $EDITOR
    q, Ctrl+C, or EscExit transcript view

    /btw Side Question Overlay

    The /btw command lets you ask a quick question without adding it to the main conversation. These keys control the overlay.

    KeyWhat It Does
    Space, Enter, or EscDismiss the answer and return to prompt
    Up / DownScroll the answer
    Left / RightStep between this and earlier /btw answers
    cCopy answer to clipboard as raw Markdown
    fFork into a new session (inherits full context and this Q&A)
    xClear the earlier /btw exchange list

    History Search (Ctrl+R Mode)

  • Press Ctrl+R to activate
  • Type text to search previous commands
  • Press Ctrl+R again to cycle to older matches
  • Press Ctrl+S to cycle scope: this session > this project > all projects
  • Press Tab or Esc to accept and keep editing; Enter to accept and execute
  • Press Ctrl+C to cancel; Backspace on empty search to cancel

  • Part 3: Vim Mode Shortcuts

    Enable vim mode with /config > Editor mode, or set "editorMode": "vim" in ~/.claude/settings.json.

    Official reference: code.claude.com/docs/en/keybindings.md

    Mode Switching

    KeyActionFrom Mode
    EscEnter NORMAL modeINSERT, VISUAL
    iInsert before cursorNORMAL
    IInsert at beginning of lineNORMAL
    aInsert after cursorNORMAL
    AInsert at end of lineNORMAL
    oOpen new line belowNORMAL
    OOpen new line aboveNORMAL
    vCharacter-wise visual selectionNORMAL
    VLine-wise visual selectionNORMAL

    Navigation (NORMAL Mode)

    KeyAction
    h/j/k/lLeft/down/up/right
    w / e / bNext word / end of word / previous word
    0 / $ / ^Line start / end / first non-blank
    gg / GBeginning / end of input
    f{char} / F{char}Jump to next/previous occurrence of a character
    t{char} / T{char}Jump to just before/after next occurrence
    ; / ,Repeat last f/F/t/T motion / in reverse
    /Open reverse history search (same as Ctrl+R)

    Editing (NORMAL Mode)

    KeyAction
    xDelete character
    dd / DDelete line / delete to end of line
    dw/de/dbDelete word/to end/back
    cc / CChange line / change to end of line
    cw/ce/cbChange word/to end/back
    yy/YYank (copy) line
    yw/ye/ybYank word/to end/back
    p / PPaste after / before cursor
    >> / <<Indent / dedent line
    JJoin lines
    uUndo
    .Repeat last change

    Text Objects (with operators d, c, y)

    ObjectSelects
    iw/awInner/around word
    iW/aWInner/around WORD (whitespace-delimited)
    i"/a"Inner/around double quotes
    i'/a'Inner/around single quotes
    i(/a(Inner/around parentheses
    i[/a[Inner/around brackets
    i{/a{Inner/around braces

    Note: Block-wise visual mode with Ctrl+V is not supported in Claude Code's vim mode.


    Part 4: Complete Slash Commands Reference

    Official reference: code.claude.com/docs/en/commands

    Session and Context Management

    CommandWhat It Does
    /clearClear conversation history. Aliases: /reset, /new
    /compact [instructions]Summarize conversation to free up context window
    /contextVisualize context window usage with optimization suggestions
    /costShow token usage and session spend
    /usageShow plan limits, rate-limit status, and activity stats
    /btw Ask a quick side question without adding it to conversation history
    /resume [session]Reopen a previous session by ID or name. Alias: /continue
    /rewindRoll back conversation and code to a previous checkpoint. Aliases: /checkpoint, /undo
    /export [filename]Export current conversation as plain text
    /copy [N]Copy last assistant response to clipboard
    /rename [name]Rename the current session
    /branch [name]Fork current conversation into a new branch. Alias: /fork
    /compact [focus]Summarize conversation with optional focus instructions

    Planning and Execution

    CommandWhat It Does
    /plan [description]Enter plan mode directly from the prompt
    /effort [level]Set model effort level: low, medium, high, xhigh, max, auto
    /model [model]Switch the active model and save as default
    /diffOpen interactive diff viewer showing uncommitted changes and per-turn diffs
    /fast [on/off]Toggle fast mode
    /advisor [model/off]Enable a second model that advises at key decision moments

    Project Setup and Memory

    CommandWhat It Does
    /initInitialize project with a CLAUDE.md guide
    /memoryEdit CLAUDE.md files, enable/disable auto-memory, view auto-memory entries
    /permissionsManage allow/ask/deny rules for tool permissions. Alias: /allowed-tools
    /configOpen configuration interface. Alias: /settings
    /add-dir Grant Claude access to an additional directory for the current session
    /keybindingsOpen or create your custom keybindings file

    Code Quality and Review

    CommandWhat It Does
    /code-review [effort] [--fix] [--comment] [target]Review diff for bugs. --fix applies findings; --comment posts GitHub PR comments
    /review [PR]Read-only review of a GitHub pull request
    /security-reviewAnalyze pending changes for security vulnerabilities
    /simplify [target]Parallel agents review changed code for cleanup opportunities
    /ultrareview [PR]Alias for /code-review ultra - deep multi-agent cloud review

    GitHub and CI Integration

    CommandWhat It Does
    /install-github-appWalk through installing the Claude GitHub App and Actions workflow
    /install-slack-appInstall the Claude Slack app via OAuth flow
    /pr-comments [PR]Fetch and display GitHub PR comments (requires gh CLI)
    /autofix-pr [prompt]Spawn a Claude Code session to watch your PR and push fixes when CI fails

    Parallel Agents and Background Work

    CommandWhat It Does
    /batch Decompose large changes across parallel worktree agents
    /agentsList and manage agent configurations
    /tasksView and manage everything running in the background. Alias: /bashes
    /background [prompt]Detach current session to run as a background agent. Alias: /bg
    /loop [interval] [prompt]Run a prompt repeatedly while the session stays open. Alias: /proactive
    /schedule [description]Create, update, list, or run cloud scheduled tasks. Alias: /routines
    /fork Spawn a subagent that inherits full conversation and works on the directive
    /goal [condition]Set a goal and let Claude keep working until the condition is met

    Tooling and Environment

    CommandWhat It Does
    /mcpManage MCP server connections and OAuth authentication
    /hooksView hook configurations for tool lifecycle events
    /skillsList available skills in this session
    /pluginInstall and manage Claude Code plugins
    /vimToggle vim editing mode. Note: removed in v2.1.92; use /config > Editor mode instead
    /voice [hold/tap/off]Toggle voice dictation or set the input mode
    /statuslineConfigure Claude Code's status line
    /color [color]Set prompt bar color: red, blue, green, yellow, purple, orange, pink, cyan
    /terminal-setupConfigure Shift+Enter in terminals that need it (VS Code, Cursor, Alacritty, Zed)
    /themeChange color theme (light, dark, daltonized, ANSI variants)
    /sandboxToggle sandbox mode
    /ideManage IDE integrations and show connection status
    /remote-controlMake this session available for remote control from claude.ai. Alias: /rc
    /teleportPull a cloud session into your local terminal. Alias: /tp

    Diagnostics and Help

    CommandWhat It Does
    /helpShow all available commands
    /doctorDiagnose installation and settings issues. Press f to fix reported problems
    /feedbackSubmit feedback or report a bug with session context attached. Alias: /bug
    /statusShow account, model, working directory, and version (opens while Claude responds)
    /release-notesView full changelog in an interactive version picker
    /insightsGenerate a report analyzing your Claude Code sessions
    /statsVisualize daily usage, session history, and model preferences

    Authentication and Account

    CommandWhat It Does
    /loginSign in to your Anthropic account
    /logoutSign out from your Anthropic account
    /upgradeOpen the upgrade page to switch to a higher plan tier
    /usage-creditsConfigure usage credits to keep working when rate limits are hit
    /privacy-settingsView and update privacy settings (Pro and Max plans only)
    /mobileShow QR code to download the Claude mobile app. Aliases: /ios, /android
    /desktopContinue the current session in the Claude Code Desktop app. Alias: /app

    Command Aliases Reference

    AliasPoints To
    /allowed-tools/permissions
    /android, /ios/mobile
    /app/desktop
    /bashes/tasks
    /bg/background
    /bug/feedback
    /checkpoint, /undo/rewind
    /continue/resume
    /cost, /stats/usage
    /new, /reset/clear
    /proactive/loop
    /quit/exit
    /rc/remote-control
    /routines/schedule
    /settings/config
    /share/feedback
    /tp/teleport

    Part 5: CLI Flags Reference

    These flags launch at the command line when starting Claude Code. All flags work with claude followed by the flag.

    Official reference: code.claude.com/docs/en/cli-reference

    Core Launch Commands

    CommandWhat It Does
    claudeStart an interactive session
    claude "query"Start with an initial prompt
    claude -p "query"Print mode: send query and exit without interactive session
    cat file.txt | claude -p "query"Process piped content
    claude -cContinue the most recent conversation in the current directory
    claude -r "session-id" "query"Resume a session by ID or name
    claude updateUpdate to the latest version

    Model and Output Flags

    FlagWhat It DoesExample
    --model / -mSet the model: sonnet, opus, haiku, or full model IDclaude --model opus
    --fallback-modelFallback model when primary is unavailableclaude --fallback-model haiku
    --print / -pNon-interactive print modeclaude -p "query"
    --output-formatOutput format: text, json, stream-jsonclaude -p --output-format json "query"
    --input-formatInput format: text or stream-jsonclaude -p --input-format stream-json
    --verboseEnable verbose logging with full turn-by-turn outputclaude --verbose
    --version / -vPrint the current versionclaude -v

    Session Flags

    FlagWhat It DoesExample
    --continue / -cLoad most recent conversationclaude -c
    --resume / -rResume a session by ID or nameclaude -r "auth-refactor"
    --fork-sessionCreate a new session from an existing one instead of resuming itclaude -r abc123 --fork-session
    --name / -nSet a display name for the sessionclaude -n "my-feature"
    --session-idUse a specific session ID (must be valid UUID)claude --session-id "550e8400..."
    --no-session-persistenceDisable saving the session (print mode only)claude -p --no-session-persistence "query"
    --from-prLoad context from a pull request URL or numberclaude --from-pr 123

    System Prompt Flags

    FlagWhat It DoesExample
    --system-promptReplace the entire system promptclaude --system-prompt "You are a Python expert"
    --system-prompt-fileLoad system prompt from fileclaude --system-prompt-file ./prompt.txt
    --append-system-promptAdd text on top of the default system promptclaude --append-system-prompt "Always suggest tests"
    --append-system-prompt-fileAppend file contents to default promptclaude --append-system-prompt-file ./extra.md

    Note: --system-prompt and --system-prompt-file are mutually exclusive. Append flags combine with either.

    Tool and Permission Flags

    FlagWhat It DoesExample
    --allowedToolsPre-approve specific tools without prompts. Supports glob patternsclaude --allowedTools "Bash(git:*)" "Read"
    --disallowedToolsBlock specific tools for the sessionclaude --disallowedTools "Bash(rm:*)"
    --permission-modeSet permission mode at launch: default, plan, acceptEdits, dontAsk, bypassPermissions, autoclaude --permission-mode plan
    --dangerously-skip-permissionsSkip all permission prompts. Use only in sandboxed environmentsclaude --dangerously-skip-permissions
    --permission-prompt-toolUse an MCP tool to handle permission prompts programmaticallyclaude -p --permission-prompt-tool mcp_auth "query"

    Context and Directory Flags

    FlagWhat It DoesExample
    --add-dirAdd additional working directories for file accessclaude --add-dir ../lib ../apps
    --mcp-configLoad MCP server configurations from a JSON file or stringclaude --mcp-config ./mcp.json
    --strict-mcp-configOnly use MCP servers from --mcp-config, ignore all othersclaude --mcp-config ./mcp.json --strict-mcp-config

    Automation and Limits Flags

    FlagWhat It DoesExample
    --max-turnsLimit the number of agentic turns (print mode only)claude -p --max-turns 3 "query"
    --max-budget-usdCap the cost budget in USDclaude --max-budget-usd 0.50
    --json-schemaEnforce a JSON schema on the outputclaude -p --json-schema '{"type":"object"}' "query"
    --bareSkip auto-discovery of CLAUDE.md, hooks, skills, plugins, and MCP. ~10x faster for CIclaude --bare -p "query"
    --include-partial-messagesInclude partial streaming events (stream-json mode)claude -p --output-format stream-json --include-partial-messages "query"

    Parallel Work Flags

    FlagWhat It DoesExample
    --worktree / -wStart session in an isolated git worktreeclaude -w feature-auth
    --tmuxCreate a tmux session for the worktreeclaude -w feature-auth --tmux
    --background / --bgStart as a background agent and return immediatelyclaude --bg "investigate the flaky test"
    --agentSpecify a custom agent for the sessionclaude --agent code-reviewer
    --teammate-modeSet how team agent teammates displayclaude --teammate-mode auto

    Debugging Flags

    FlagWhat It DoesExample
    --debugEnable debug-level loggingclaude --debug
    --debug-file Write debug logs to a file (implicitly enables debug)claude --debug-file ./debug.log
    --safe-modeStart with all customizations disabled for troubleshooting (v2.1.169+)claude --safe-mode
    --no-colorDisable colored output for log files or pipesclaude --no-color

    Short-Form Flag Summary

    ShortLongPurpose
    -p--printNon-interactive print mode
    -c--continueContinue last session
    -r--resumeResume session by ID
    -m--modelSet model
    -v--versionPrint version
    -w--worktreeGit worktree session
    -n--nameName the session

    Part 6: Customizable Keybindings

    Claude Code lets you remap almost every action. Run /keybindings to create or open ~/.claude/keybindings.json. Changes hot-reload without restarting.

    Official reference: code.claude.com/docs/en/keybindings

    Actions That Cannot Be Rebound

    These three are hardcoded at the OS level:

  • Ctrl+C: interrupt/cancel
  • Ctrl+D: exit
  • Ctrl+M: identical to Enter in all terminals
  • Example Keybindings JSON

    AI Prompt
    {
      "chat:newline": ["Ctrl+J"],
      "chat:externalEditor": ["Ctrl+G"],
      "app:toggleTranscript": ["Ctrl+O"],
      "history:search": ["Ctrl+R"],
      "chat:cycleMode": ["Shift+Tab"],
      "transcript:exit": ["q", "Ctrl+C", "Escape"]
    }

    Key Bindable Actions by Category

    ActionDefaultWhat It Does
    app:interruptCtrl+CCancel current operation
    app:exitCtrl+DExit Claude Code
    app:toggleTodosCtrl+TToggle task list visibility
    app:toggleTranscriptCtrl+OToggle verbose transcript
    chat:cancelEscapeCancel current input
    chat:submitEnterSubmit message
    chat:newlineCtrl+JInsert newline without submitting
    chat:cycleModeShift+TabCycle permission modes
    chat:externalEditorCtrl+GOpen in external editor
    chat:imagePasteCtrl+VPaste image
    chat:thinkingToggleCmd+T / Meta+TToggle extended thinking
    chat:fastModeMeta+OToggle fast mode
    history:searchCtrl+ROpen history search
    history:previousUpPrevious history item
    history:nextDownNext history item
    task:backgroundCtrl+BBackground current task
    transcript:toggleShowAllCtrl+EToggle show all content
    transcript:exitq, Ctrl+C, EscapeExit transcript view
    voice:pushToTalkSpaceHold to dictate a prompt

    Part 7: CLAUDE.md and Memory System

    The CLAUDE.md file is not a shortcut in the traditional sense, but understanding it speeds up every session.

    Official reference: code.claude.com/docs/en/memory

    File Load Order (Broadest to Most Specific)

    ScopeLocation
    Organization policy/Library/Application Support/ClaudeCode/CLAUDE.md (macOS)
    User (all projects)~/.claude/CLAUDE.md
    Project (team-shared)./CLAUDE.md or ./.claude/CLAUDE.md
    Local (gitignored)./CLAUDE.local.md
    User-level rules~/.claude/rules/*.md
    Project rules./.claude/rules/*.md

    Memory Shortcuts

  • Run /init to auto-generate CLAUDE.md from your codebase
  • Use @path/to/file inside CLAUDE.md to import other files (max 4 hops deep)
  • HTML comments () get stripped from Claude's context; use them for maintainer notes
  • CLAUDE.md survives /compact; your project rules stay intact after context summarization
  • Auto-memory stores to ~/.claude/projects//memory/MEMORY.md
  • After any correction: tell Claude "Update your CLAUDE.md so you don't make that mistake again"

  • Part 8: Hooks Reference

    Hooks run shell commands at specific lifecycle points. Set them up in /config or ~/.claude/settings.json.

    Official reference: code.claude.com/docs/en/hooks

    Hook EventBest Use Case
    SessionStartLoad dynamic context at session start
    PreToolUseLog bash commands before execution; validate inputs
    PostToolUseAuto-format files after Write/Edit; lint after edits
    PermissionRequestRoute permission prompts to Slack or another review system
    StopRun checks after long tasks; nudge Claude to continue
    PostCompactRe-inject critical instructions after compaction
    InstructionsLoadedLog which CLAUDE.md files loaded
    SubagentStopRun when a subagent completes

    Example: Sound on Completion (macOS)

    AI Prompt
    {
      "hooks": {
        "Stop": [{
          "hooks": [{
            "type": "command",
            "command": "afplay /System/Library/Sounds/Pop.aiff"
          }]
        }]
      }
    }

    Example: Auto-Lint After Edits

    AI Prompt
    {
      "hooks": {
        "PostToolUse": [{
          "matcher": "Write|Edit",
          "hooks": [{
            "type": "command",
            "command": "bun run format || true"
          }]
        }]
      }
    }

    Part 9: Power User Workflows

    Parallel Sessions with Worktrees

    Run claude --worktree feature-auth --tmux to start an isolated session in its own tmux pane. Changes happen in a separate git worktree, not your main branch. Color-code sessions with /color and name them with /rename so you know which pane does what.

    Use /batch for large-scale changes. It decomposes the task into independent units, sends each to a separate worktree agent, and merges results. Useful for renaming variables across 50 files or updating an API contract everywhere it appears.

    CI and Automation

    Use --bare -p --output-format stream-json as your standard CI pattern. The --bare flag skips CLAUDE.md, skills, plugins, and MCP auto-discovery, which makes startup roughly 10 times faster. The --output-format stream-json flag gives you newline-delimited JSON events for pipeline integration.

    Add --json-schema with a strict schema to get structured output without brittle text parsing.

    AI Prompt
    claude -p --bare --output-format json \
      --json-schema '{"type":"object","properties":{"risk":{"type":"string"}}}' \
      "Analyze this diff for security issues"

    Context Hygiene

    Use /clear between unrelated tasks. Context bleed from an earlier conversation can cause Claude to make wrong assumptions in the next one.

    Use /compact "keep only the authentication changes" with a specific focus instruction rather than plain /compact. The focus instruction tells Claude what to preserve in the summary, so important context survives the compression.

    Use /context before starting a long task to see how much budget you have left. If the window is nearly full, compact before you start, not after you run into limits mid-task.

    Verification Loop

    Give Claude a feedback mechanism and tell it to verify its own work. Browser automation via the Chrome extension, test suites via bash, and screenshot diffing all work as verification tools.

    Prompts that push Claude to self-verify: "Prove to me this works", "Run the tests and fix any failures", "Knowing everything you know now, is this the right implementation?"


    Frequently Asked Questions (FAQs)

    What does Shift+Tab do in Claude Code?

    Shift+Tab cycles through permission modes: Default, AcceptEdits, Plan, and (if enabled) Auto and BypassPermissions. Default mode asks before every action. AcceptEdits approves file edits but asks for shell commands. Plan mode lets Claude explore and propose changes but never executes anything. Cycling between them mid-session lets you tighten or loosen control without restarting.

    How do I interrupt Claude Code without losing the work it did?

    Press Esc once. Claude stops the current response or tool call but keeps everything it completed before you interrupted. This is different from Ctrl+C, which cancels the current input, and double Esc, which opens the rewind menu to roll back to a checkpoint.

    What is the fastest way to run Claude Code in a CI pipeline?

    Use claude -p --bare --output-format stream-json "your query". The -p flag runs non-interactively and exits after the response. The --bare flag skips CLAUDE.md, skills, plugins, hooks, and MCP auto-discovery, making startup roughly 10 times faster. The --output-format stream-json flag gives you parseable newline-delimited JSON events.

    How do I use multiple directories in one Claude Code session?

    Use --add-dir at launch: claude --add-dir ../backend ../frontend. You can also run /add-dir inside a session to add a directory without restarting. This tells Claude Code which directories it can read and write during the session.

    What is the difference between /compact and /clear?

    /compact summarizes the current conversation and replaces it with a condensed version. Your project memory (CLAUDE.md) stays intact and the session continues. /clear wipes all conversation history and starts fresh while keeping you in the same session. Use /compact when you want to free context but keep going. Use /clear when you're starting a completely different task.

    How do I create a custom slash command?

    Create a SKILL.md file in .claude/skills//SKILL.md (new format) or a .md file in .claude/commands/.md (legacy format). The filename becomes your /name command. Skills support frontmatter to control invocation, supporting files in the same directory, inline shell execution, and subagent delegation. Run /reload-skills to pick up changes without restarting.

    How do I stop Claude from asking for permissions on every action?

    Three options depending on your trust level. First: use Shift+Tab to switch to AcceptEdits mode (approves file edits automatically, still asks for shell commands). Second: use --allowedTools "Bash(git:*)" "Read" "Write" at launch to pre-approve specific tools by glob pattern. Third: use --permission-mode dontAsk or --dangerously-skip-permissions for fully automated environments where you accept the risk of unrestricted execution.


    Final Thoughts

    Claude Code's keyboard shortcuts, slash commands, and CLI flags are not just convenience features. They change how you work at a fundamental level. Knowing that Shift+Tab cycles permission modes means you can switch from careful to fast without touching the keyboard more than once. Knowing that --bare -p makes Claude Code 10 times faster in CI means your pipelines don't have to wait.

    The official documentation gets updated regularly as new versions ship. Run /release-notes inside any session to see what changed. Set up a ~/.claude/CLAUDE.md with your personal preferences so every project starts exactly the way you like it. And if something is not working the way you expect, /doctor usually tells you why.

    Share this article
    Ramanpal Singh

    Ramanpal Singh

    Ramanpal Singh Is the founder of Promptslove, kwebby and copyrocket ai. He has 10+ years of experience in web development and web marketing specialized in SEO. He has his own youtube channel and active on social media platform.