Claude Code — AI Coding Agent for the Terminal
Anthropic's official AI coding agent: interactive or scripted sessions, MCP servers, subagents, plugins, worktrees and IDE integration.
Claude Code is Anthropic's official agentic coding tool: it reads, writes and runs code right in your terminal, driven by the claude command. By default it opens an interactive session in the current directory; with -p/--print it turns into a scriptable, pipe-friendly one-shot tool. Beyond the CLI it also runs as a desktop and web app and as an IDE extension, and it taps the latest Claude models — the Claude 5 family (Opus 5, Sonnet 5, Fable 5) plus Haiku 4.5. This cheat sheet collects the flags, subcommands and slash commands you reach for every day, from session management and permission modes to MCP servers, subagents, plugins and git worktrees. As of July 2026 — Claude Code moves fast, so a look at claude --help and /help pays off after every update.
Basic Usage
claude — Start an interactive Claude Code session in the current directory.
claudeclaude "<prompt>" — Start an interactive session with an initial prompt.
claude "Explain the architecture of this project"claude --version — Show the installed Claude Code version.
claude --versionclaude --help — Show all available options and commands.
claude --helpclaude update — Check for updates and install the latest version if available. Alias: claude upgrade
claude updateclaude doctor — Check the health of the Claude Code installation and auto-updater.
claude doctorclaude install <target> — Install a specific Claude Code native build (stable, latest, or version number).
claude install stableclaude project — Manage Claude Code project state.
claude projectclaude gateway --config <path> — Run the enterprise auth/telemetry gateway from a YAML config.
claude gateway --config ./gateway.yamlclaude ultrareview [target] — Run a cloud-hosted multi-agent code review of the current branch (or a PR number / base branch) and print the findings. In interactive sessions prefer /code-review ultra; /ultrareview is a deprecated alias for it.
claude ultrareview 42Session Management
claude -c — Continue the most recent conversation in the current directory. Long: --continue
claude -cclaude -r — Open an interactive picker to resume a previous conversation. Long: --resume
claude -rclaude -r <session-id> — Resume a specific conversation directly by its session ID.
claude -r a1b2c3d4-...claude -n <name> — Set a display name for this session (shown in /resume and terminal title).
claude -n "refactor auth module"claude --fork-session — When resuming, create a new session ID instead of continuing the original.
claude -c --fork-sessionclaude --session-id <uuid> — Use a specific UUID as the session ID.
claude --session-id 00000000-0000-0000-0000-000000000001claude --from-pr <number> — Resume a session linked to a pull request by number or URL.
claude --from-pr 42claude --bg "<prompt>" — Start the session as a background agent and return immediately. Manage running agents with claude agents. Long: --background
claude --bg "Run the full test suite and summarize failures"Non-Interactive Mode (--print)
claude -p "<prompt>" — Print the response and exit. Non-interactive for scripting and pipes.
claude -p "What does this function do?" < src/utils.jsecho "<prompt>" | claude -p — Pipe a prompt into Claude and get a single printed response.
echo "Summarize this" | claude -pcat <file> | claude -p "<prompt>" — Pipe file contents as context into a non-interactive prompt.
cat app.py | claude -p "Find security issues"claude -p --output-format json "<prompt>" — Output the response as a single JSON object. Formats: text, json, stream-json.
claude -p --output-format json "List 3 refactoring tips"claude -p --output-format stream-json "<prompt>" — Stream the response as newline-delimited JSON chunks in real-time.
claude -p --output-format stream-json "Explain async/await"claude -p --json-schema '<schema>' "<prompt>" — Validate output against a JSON Schema for structured, machine-readable responses.
claude -p --json-schema '{"type":"object","properties":{"name":{"type":"string"}}}' "Extract info"claude -p --max-budget-usd <amount> "<prompt>" — Set a maximum spend limit in USD for this call.
claude -p --max-budget-usd 0.10 "Summarize these logs"claude -p --no-session-persistence "<prompt>" — Don't save the session to disk (cannot be resumed).
claude -p --no-session-persistence "Quick question"claude -p --fallback-model <models> — Automatically fall back to the specified model when the default is overloaded or unavailable. Takes a comma-separated list tried in order; the primary model is retried at the start of each user turn.
claude -p --fallback-model sonnet,haiku "Generate unit tests"claude -p --input-format stream-json --output-format stream-json — Bidirectional streaming JSON for integration with custom tools or orchestrators.
claude -p --input-format stream-json --output-format stream-jsonclaude -p --include-partial-messages ... — Emit partial message chunks as they arrive (requires --output-format stream-json).
claude -p --output-format stream-json --include-partial-messages "Explain this"claude -p --include-hook-events ... — Include all hook lifecycle events in the output stream (requires --output-format stream-json).
claude -p --output-format stream-json --include-hook-events "Run the build"claude -p --replay-user-messages ... — Re-emit user messages from stdin back on stdout for acknowledgment (stream-json in+out only).
claude -p --input-format stream-json --output-format stream-json --replay-user-messagesclaude -p --prompt-suggestions "<prompt>" — Emit a prompt_suggestion message after each turn predicting the next user prompt. Can be switched off with an explicit value (--prompt-suggestions=false).
claude -p --prompt-suggestions "Refactor this module"claude -p --forward-subagent-text ... — Forward subagent text and thinking blocks as their own messages with parent_tool_use_id set (requires --output-format stream-json).
claude -p --output-format stream-json --forward-subagent-text "Audit the codebase"Model & Effort
claude --model opus — Use the current Claude Opus (Opus 5 at the time of writing). Accepts the aliases opus, sonnet, haiku and fable — each always points at the latest version of its line.
claude --model opusclaude --model fable — Use Claude Fable 5, the most capable widely released model (for the hardest tasks, priced above the Opus tier).
claude --model fableclaude --model sonnet — Use Claude Sonnet (balanced speed and capability).
claude --model sonnetclaude --model haiku — Use Claude Haiku (fastest, most cost-efficient).
claude --model haikuclaude --model <full-model-id> — Use a specific model by its full ID. Current: claude-opus-5, claude-sonnet-5, claude-fable-5, claude-haiku-4-5.
claude --model claude-opus-5claude --effort <level> — Set effort level: low, medium, high, xhigh, max. Higher = more thorough but slower.
claude --effort high "Perform a full security audit"Permission Modes & Tool Access
claude --permission-mode default — Normal mode: prompts for approval on potentially dangerous actions. Since version 2.1.200 the equivalent name manual also exists; both work.
claude --permission-mode defaultclaude --permission-mode acceptEdits — Auto-accept all file edits without prompting.
claude --permission-mode acceptEditsclaude --permission-mode plan — Plan mode: propose changes but don't execute until approved.
claude --permission-mode planclaude --permission-mode auto — Auto mode: classifies actions and auto-approves safe ones.
claude --permission-mode autoclaude --permission-mode dontAsk — Don't prompt for permissions; silently skip actions that would require approval instead of running them.
claude --permission-mode dontAskclaude --permission-mode bypassPermissions — Bypass all permission checks. Only for isolated sandboxes.
claude --permission-mode bypassPermissionsclaude --dangerously-skip-permissions — Bypass all permission checks (equivalent to bypassPermissions mode). Only for sandboxes with no internet access.
claude --dangerously-skip-permissionsclaude --allow-dangerously-skip-permissions — Make 'bypass permissions' available as an opt-in mode without enabling it by default.
claude --allow-dangerously-skip-permissionsclaude --allowed-tools "<tools>" — Restrict Claude to specific tools. Supports subcommand patterns.
claude --allowed-tools "Bash(git:*) Edit Read"claude --disallowed-tools "<tools>" — Block specific tools while allowing all others.
claude --disallowed-tools "Bash Write"claude --tools "<tools>" — Specify available built-in tools. Use "" to disable all, "default" for all.
claude --tools "Read,Glob,Grep"claude --add-dir <path> — Grant tool access to additional directories beyond the current working directory.
claude --add-dir ~/shared-libs --add-dir /etc/nginxSystem Prompts & Agents
claude --system-prompt "<prompt>" — Override the default system prompt for this session.
claude --system-prompt "Reply only in German."claude --append-system-prompt "<prompt>" — Append instructions to the default system prompt without replacing it.
claude --append-system-prompt "Always use Bootstrap 5."claude --system-prompt-file <path> — Load the system prompt override from a file instead of an inline string.
claude --system-prompt-file ./prompts/reviewer.mdclaude --append-system-prompt-file <path> — Append a system prompt loaded from a file to the default system prompt.
claude --append-system-prompt-file ./prompts/house-rules.mdclaude --brief — Enable the SendUserMessage tool so an agent can send messages back to the user.
claude --briefclaude --agent <agent-name> — Use a named agent configured in settings.
claude --agent reviewerclaude agents — Manage background agents: list, attach to, and stop sessions started with --bg/--background.
claude agentsclaude --agents '<json>' — Define inline agents as JSON for the current session.
claude --agents '{"tester":{"description":"Writes tests","prompt":"Write unit tests only"}}'claude --bare — Minimal mode: skip hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads and CLAUDE.md discovery; sets CLAUDE_CODE_SIMPLE=1. Auth is strictly ANTHROPIC_API_KEY or apiKeyHelper — OAuth and the keychain are never read. Provide context explicitly (--system-prompt, --add-dir, --mcp-config, --settings, --agents, --plugin-dir).
claude --bare -p "Quick question"Interactive Slash Commands: Session
/help — Show help and available commands.
/help/clear — Clear conversation history and free up context. Aliases: /reset, /new
/clear/compact [instructions] — Compact conversation to save context, with optional focus instructions.
/compact focus on the auth module changes/context — Visualize current context usage as a colored grid.
/context/resume [session] — Resume a conversation by ID or name. Alias: /continue
/resume/branch [name] — Create a branch of the current conversation at this point to try a different direction.
/branch experiment-1/fork [prompt] — Copy the current conversation into a new background session. Unlike /branch, the copy keeps running on its own.
/fork try the alternative approach/background [prompt] — Detach the current session and let it continue as a background agent.
/background finish the test suite/goal [condition|clear] — Set a goal: Claude keeps working until the condition is met. Useful for long autonomous runs.
/goal all tests pass and the linter is clean/cd <path> — Move the running session to a different working directory.
/cd ~/projects/other-repo/teleport — Pull a web session into this terminal.
/teleport/rename [name] — Rename the current session.
/rename auth-refactor/export [filename] — Export the current conversation as plain text.
/export conversation.txt/exit — Exit the CLI. Alias: /quit
/exitInteractive Slash Commands: Model & Tools
/model [model] — Switch the AI model mid-session and save the choice as your new default.
/model opus/effort [level|auto] — Set effort level: low, medium, high, xhigh, max, auto, ultracode. 'ultracode' = xhigh effort plus dynamic workflow orchestration (this session only).
/effort ultracode/advisor [model|off] — Enable the advisor tool, which consults a second, at-least-as-capable model for guidance.
/advisor opus/fast [on|off] — Toggle fast mode: the same Opus model at substantially higher output speed, with no downgrade to a smaller model. Available on Opus 5, 4.8 and 4.7.
/fast on/usage — Show usage, cost, plan limits and rate limit status. Alias: /cost
/usage/permissions — View or update permissions. Alias: /allowed-tools
/permissions/tasks — List and manage background tasks.
/tasksInteractive Slash Commands: Code & Git
/diff — Open interactive diff viewer showing uncommitted changes.
/diff/rewind — Rewind conversation and code to a previous point. Alias: /checkpoint
/rewind/pr-comments [PR] — Fetch and display comments from a GitHub pull request.
/pr-comments 42/code-review [level] [--fix] [--comment] — Review the current working diff for bugs and cleanups. Levels: low, medium, high, xhigh, max, or ultra (cloud-hosted multi-agent review). --fix applies the fixes directly, --comment leaves findings as comments. Replaces /ultrareview.
/code-review ultra --fix/review [PR] — Review a GitHub pull request. For your local working diff use /code-review instead.
/review 42/security-review — Analyze pending changes on current branch for security vulnerabilities.
/security-review/copy [N] — Copy the last (or Nth-latest) assistant response to clipboard.
/copy/btw <question> — Ask a quick side question without adding to conversation context.
/btw what's the syntax for a ternary in PHP?Interactive Slash Commands: Configuration
/config — Open settings interface (theme, model, output style). Alias: /settings
/config/status — Show version, model, account, and connectivity status.
/status/theme — Change color theme (light/dark, colorblind-accessible, ANSI).
/theme/color [color] — Set the prompt bar color (red, blue, green, yellow, purple, etc.).
/color blue/vim — Toggle between Vim and Normal editing modes.
/vim/voice — Toggle push-to-talk voice dictation.
/voice/keybindings — Open or create keybindings configuration file.
/keybindings/terminal-setup — Configure terminal keybindings for Shift+Enter and other shortcuts.
/terminal-setup/tui [default|fullscreen] — Set the terminal UI renderer. 'fullscreen' uses the flicker-free alt-screen renderer with virtualized scrollback (equivalent to CLAUDE_CODE_NO_FLICKER=1); 'default' uses the classic main-screen renderer. The choice is saved to your preferences.
/tui fullscreen/statusline — Configure Claude Code's status line (or auto-configure from shell prompt).
/statusline/focus — Toggle the focus view.
/focus/debug [description] — Enable debug logging for the current session and troubleshoot issues.
/debug mcp server keeps disconnecting/heapdump — Write a JavaScript heap snapshot for diagnosing memory usage.
/heapdump/memory — Edit CLAUDE.md, enable/disable auto-memory, view auto-memory entries.
/memory/init — Initialize project with CLAUDE.md guide.
/init/hooks — View hook configurations for tool events.
/hooks/add-dir <path> — Add a new working directory to the current session.
/add-dir ~/other-projectInteractive Slash Commands: Integrations
/mcp — Manage MCP server connections and OAuth authentication.
/mcp/ide — Manage IDE integrations (VS Code, JetBrains) and show status.
/ide/chrome — Configure Claude in Chrome integration.
/chrome/plugin — Manage Claude Code plugins.
/plugin/skills — List available skills (custom slash commands).
/skills/agents — Manage agent configurations.
/agents/plan [description] — Enter plan mode directly from the prompt.
/plan refactor the authentication module/schedule [description] — Create, update, list, or run cloud scheduled tasks (triggers).
/scheduleInteractive Slash Commands: Account & Info
/login — Sign in to your Anthropic account.
/login/logout — Sign out from your Anthropic account.
/logout/doctor — Diagnose and verify Claude Code installation and settings.
/doctor/stats — Visualize daily usage, session history, streaks, and model preferences.
/stats/insights — Generate a report analyzing your Claude Code sessions.
/insights/release-notes — View the full changelog with recent versions first.
/release-notes/feedback [report] — Submit feedback about Claude Code. Alias: /bug
/feedback/desktop — Continue current session in Claude Code Desktop app. Alias: /app
/desktop/mobile — Show QR code to download Claude mobile app. Aliases: /ios, /android
/mobile/remote-control — Make session available for remote control from claude.ai. Alias: /rc
/remote-control/install-github-app — Set up Claude GitHub Actions app for a repository.
/install-github-app/extra-usage — Configure extra usage to keep working when rate limits hit.
/extra-usageBundled Skills & Workflows
Skills are slash commands shipped as instructions and loaded only when needed. Claude Code ships with the following; /skills lists everything available.
/batch <instruction> — Orchestrate large-scale changes across the codebase in parallel.
/batch replace all deprecated API calls with the v2 equivalent/loop [interval] [prompt] — Run a prompt repeatedly while the session stays open. Without an interval the model paces itself.
/loop 5m check whether the deploy finished/verify — Verify the code changes you made (runs only when you invoke it).
/verify/fewer-permission-prompts — Scan your transcripts and propose an allowlist that cuts down on repeated permission prompts.
/fewer-permission-prompts/dataviz [request] — Design guidance for charts, graphs and dashboards.
/dataviz a bar chart comparing quarterly revenue/deep-research <question> — Workflow: fan out web searches, cross-check sources and write a cited report.
/deep-research how do European accessibility laws differ from WCAG?/autofix-pr [prompt] — Workflow: spawn a session that watches a pull request and pushes fixes when CI fails.
/autofix-prMCP Servers
claude mcp list — List all configured MCP (Model Context Protocol) servers.
claude mcp listclaude mcp add <name> -- <command> [args...] — Add a stdio MCP server as a subprocess.
claude mcp add my-server -- npx my-mcp-server --port 3000claude mcp add --transport http <name> <url> — Add an HTTP/SSE MCP server by URL.
claude mcp add --transport http sentry https://mcp.sentry.dev/mcpclaude mcp add -e <KEY>=<val> <name> -- <command> — Add a stdio MCP server with environment variables.
claude mcp add -e GITHUB_TOKEN=ghp_xxx github -- npx @modelcontextprotocol/server-githubclaude mcp add --transport http <name> <url> --header "Authorization: Bearer <token>" — Add an HTTP MCP server with a custom auth header.
claude mcp add --transport http api https://api.example.com/mcp --header "Authorization: Bearer xxx"claude mcp add-json <name> '<json>' — Add an MCP server with a full JSON config string.
claude mcp add-json myserver '{"type":"stdio","command":"npx","args":["my-server"]}'claude mcp get <name> — Show full configuration details of a specific MCP server.
claude mcp get sentryclaude mcp remove <name> — Remove a configured MCP server.
claude mcp remove my-serverclaude mcp add-from-claude-desktop — Import MCP servers from the Claude Desktop app (Mac and WSL only).
claude mcp add-from-claude-desktopclaude mcp serve — Start Claude Code itself as an MCP server (for integration with other tools).
claude mcp serveclaude --mcp-config <path> — Load additional MCP servers from a JSON config file for this session.
claude --mcp-config ~/.config/mcp-servers.jsonclaude --strict-mcp-config --mcp-config <path> — Only use MCP servers from the specified config, ignore all others.
claude --strict-mcp-config --mcp-config config.jsonclaude mcp reset-project-choices — Reset all approved/rejected project-scoped MCP server choices.
claude mcp reset-project-choicesAuthentication
claude auth login — Sign in to your Anthropic account (opens browser for OAuth).
claude auth loginclaude auth logout — Log out from the current Anthropic account.
claude auth logoutclaude auth status — Show the current authentication status and active account.
claude auth statusclaude setup-token — Set up a long-lived authentication token (requires Claude subscription).
claude setup-tokenWorktrees & IDE
claude -w — Create a new git worktree for this session (isolated branch). Long: --worktree
claude -wclaude -w <name> — Create a named git worktree.
claude -w feature-refactorclaude -w --tmux — Create a worktree and open it in a new tmux session (iTerm2 native panes when available; --tmux=classic forces traditional tmux).
claude -w --tmuxclaude --ide — Auto-connect to an open IDE (VS Code, JetBrains) on startup.
claude --ideclaude --remote-control [name] — Start an interactive session with Remote Control enabled (optionally named) for control from claude.ai.
claude --remote-control "laptop session"claude --remote-control-session-name-prefix <prefix> — Set the prefix for auto-generated Remote Control session names (default: hostname).
claude --remote-control --remote-control-session-name-prefix laptopPlugins
claude plugin list — List all installed plugins.
claude plugin listclaude plugin install <plugin> — Install a plugin from the marketplace.
claude plugin install my-pluginclaude plugin enable <plugin> — Enable a previously disabled plugin.
claude plugin enable my-pluginclaude plugin disable <plugin> — Disable an installed plugin without removing it.
claude plugin disable my-pluginclaude plugin update <plugin> — Update a plugin to the latest version (restart required).
claude plugin update my-pluginclaude plugin uninstall <plugin> — Uninstall a plugin completely.
claude plugin uninstall my-pluginclaude plugin validate <path> — Validate a local plugin or marketplace manifest.
claude plugin validate ./my-plugin/claude --plugin-dir <path> — Load a local plugin directory or .zip for this session only (repeatable).
claude --plugin-dir ./my-plugin/ --plugin-dir ./other.zipclaude --plugin-url <url> — Fetch a plugin .zip from a URL for this session only (repeatable).
claude --plugin-url https://example.com/my-plugin.zipAuto Mode
claude auto-mode config — Print the effective auto mode config as JSON.
claude auto-mode configclaude auto-mode defaults — Print the shipped default auto mode rules as JSON (environment, allow, soft_deny, hard_deny).
claude auto-mode defaultsclaude auto-mode critique — Get AI feedback on your custom auto mode rules.
claude auto-mode critiqueclaude auto-mode reset — Reset auto mode to the shipped defaults by removing the autoMode section from your user settings file.
claude auto-mode resetDebugging & Diagnostics
claude --debug — Enable debug mode: verbose logs, tool calls, API requests.
claude --debugclaude --debug <filter> — Filter debug output by category. Prefix with ! to exclude.
claude --debug api,hooksclaude --debug-file <path> — Write debug logs to a file (implicitly enables debug mode).
claude --debug-file /tmp/claude-debug.logclaude --verbose — Enable verbose output mode.
claude --verboseclaude --safe-mode — Start with all customizations disabled (CLAUDE.md, skills, plugins, hooks, MCP servers, custom commands/agents, output styles, themes, keybindings) to troubleshoot a broken config. Policy settings, auth, model, built-in tools, and permissions still work. Sets CLAUDE_CODE_SAFE_MODE=1.
claude --safe-modeclaude --ax-screen-reader — Render screen-reader friendly output (flat text, no decorative borders or animations).
claude --ax-screen-readerScripting & Automation
git diff HEAD~1 | claude -p "Summarize these changes" — Pipe git diff into Claude to generate a commit message.
git diff HEAD~1 | claude -p "Write a conventional commit message"claude -p --output-format json "<prompt>" | jq '.result' — Pipe JSON output to jq for processing in shell scripts.
claude -p --output-format json "Extract function names" | jq '.result'claude --settings '<json>' — Load settings from a JSON file path or inline JSON string.
claude --settings '{"model":"sonnet","verbose":true}'claude --setting-sources <sources> — Control which setting sources are loaded: user, project, local.
claude --setting-sources user,projectclaude -p --betas <feature> "<prompt>" — Enable a beta feature via header (API key users only).
claude -p --betas interleaved-thinking "Think step by step"claude --disable-slash-commands — Disable all slash command skills for this session.
claude --disable-slash-commandsclaude --chrome — Enable Claude in Chrome integration for this session.
claude --chromeclaude --no-chrome — Disable the Claude in Chrome integration for this session.
claude --no-chromeclaude --file <file_id:path> — Download file resources at startup. Format: file_id:relative_path (repeatable).
claude --file file_abc:doc.txt --file file_def:img.pngclaude --exclude-dynamic-system-prompt-sections — Move per-machine sections (cwd, env, memory paths, git status) into the first user message for better cross-user prompt-cache reuse.
claude --exclude-dynamic-system-prompt-sections -p "Review"Environment Variables
CLAUDE_CONFIG_DIR=<path> claude — Use a custom config directory instead of the default ~/.claude. Enables separate configs for different projects or contexts.
CLAUDE_CONFIG_DIR=~/.claude-work claudealias claude-<name>="CLAUDE_CONFIG_DIR=~/.<dir> claude" — Create shell aliases for different Claude configurations (add to .bashrc/.zshrc).
alias claude-private="CLAUDE_CONFIG_DIR=~/.claude-private claude"
alias claude-work="CLAUDE_CONFIG_DIR=~/.claude-work claude"ANTHROPIC_API_KEY=<key> claude — Set the API key directly instead of using OAuth login.
ANTHROPIC_API_KEY=sk-ant-xxx claude -p "Hello"CLAUDE_MODEL=<model> claude — Set the default model without using --model flag.
CLAUDE_MODEL=claude-sonnet-5 claudeCLAUDE_CODE_SIMPLE=1 claude — Simplified mode (same as --bare): skip hooks, LSP, plugins, auto-memory.
CLAUDE_CODE_SIMPLE=1 claude -p "Quick question"ANTHROPIC_BASE_URL=<url> claude — Use a custom API endpoint (proxy or compatible provider).
ANTHROPIC_BASE_URL=https://my-proxy.example.com claudeDISABLE_AUTOUPDATE=1 claude — Disable the automatic update check on startup.
DISABLE_AUTOUPDATE=1 claudeCLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1 — Always reset the Bash tool's working directory to the project root between commands.
CLAUDE_BASH_MAINTAIN_PROJECT_WORKING_DIR=1 claudeCLAUDE_CODE_NO_FLICKER=1 claude — Force the flicker-free fullscreen alt-screen renderer with virtualized scrollback (same as /tui fullscreen).
CLAUDE_CODE_NO_FLICKER=1 claudeUseful Aliases & Tips
alias claude-private="CLAUDE_CONFIG_DIR=~/.claude-private claude" — Separate config for creative/personal projects — own settings, memory, and MCP servers.
# In ~/.bashrc or ~/.zshrc:
alias claude-private="CLAUDE_CONFIG_DIR=~/.claude-private claude"alias claude-work="CLAUDE_CONFIG_DIR=~/.claude-work claude" — Separate config for work projects — own API key, permissions, and agents.
# In ~/.bashrc or ~/.zshrc:
alias claude-work="CLAUDE_CONFIG_DIR=~/.claude-work claude"alias cq='claude -p' — Quick alias for non-interactive one-shot queries.
cq "What's the regex for an email address?"alias cr='claude -c' — Quick alias to continue the last conversation.
cralias claude-review='claude -p --model opus "Review this code for bugs and security issues"' — Predefined alias for code review with a specific model.
cat src/auth.py | claude-reviewccommit() { git diff --cached | claude -p "Write a conventional commit message for these staged changes"; } — Shell function to generate commit messages from staged changes.
git add -p && ccommitcexplain() { cat "$1" | claude -p "Explain this file concisely"; } — Shell function to quickly explain any file.
cexplain src/config.tsultracode — Keyword trigger: include the word 'ultracode' anywhere in a prompt to opt that turn into the Workflow tool (xhigh effort + dynamic workflow orchestration). On by default; toggle in /config. Same effect as /effort ultracode.
ultracode: refactor the auth module and add full test coverageKeyboard Shortcuts (interactive session)
Enter — Submit the current prompt (configurable in /keybindings).
Type your prompt and press Enter to sendShift+Enter — Insert a newline without submitting (requires /terminal-setup).
Write multi-line prompts with Shift+EnterCtrl+C — Cancel the current operation or generation.
Press Ctrl+C to stop a long responseEscape — Cancel or go back in menus and pickers.
Press Escape to close the session pickerUp / Down Arrow — Navigate through prompt history.
Press Up to recall previous prompts/ — Open slash command autocomplete. Type to filter.
Type / to see all available commands Conclusion
Claude Code rewards a deliberate setup: pin sensitive operations behind permission modes, reserve --dangerously-skip-permissions for throwaway sandboxes only, and lean on -p plus --output-format json when you wire it into scripts and CI. Once you have a feel for sessions, agents and MCP servers, the same binary scales from a quick one-off question to a long-running, multi-step refactor. Treat the flags here as a starting point and check the official docs for new commands between releases.
Further Reading
- Claude Code documentation – Anthropic's official guide to installation, configuration, slash commands, hooks and MCP
- Commands reference – the full list of built-in slash commands and bundled skills
- anthropics/claude-code on GitHub – issue tracker, release notes and reference material