# Claude Code Anthropic's official CLI for Claude. An interactive tool for software engineering tasks, code exploration, and file management. ## Keyboard Shortcuts ### Quick Prefixes | Prefix | Action | |--------|--------| | **#** | Add to CLAUDE.md memory | | **/** | Trigger slash commands | | **!** | Bash mode (run commands directly) | | **@** | File path autocomplete | | **&** | Send task to run on web (creates new claude.ai session) | ### Input & Editing | macOS | Windows/Linux | Action | |-------|---------------|--------| | `Esc` | `Esc` | Interrupt Claude (stops thinking/tool calls/edits) | | `Ctrl+C` | `Ctrl+C` | Interrupt Claude / Cancel current input | | `\+Enter` or `Opt+Enter` | `\+Enter` | Multiline input | | `Ctrl+G` | `Ctrl+G` | Open prompt in system text editor | | `Ctrl+J` | `Ctrl+J` | Line feed for multiline | | `Ctrl+V` | `Ctrl+V` | Paste image from clipboard (not Cmd+V on Mac) | | `Ctrl+R` | `Ctrl+R` | Reverse search command history | | `Up/Down` | `Up/Down` | Navigate command history | | `Ctrl+A` | `Ctrl+A` | Move cursor to start of line | | `Ctrl+E` | `Ctrl+E` | Move cursor to end of line | | `Opt+F` | `Alt+F` | Move cursor word forward | | `Opt+B` | `Alt+B` | Move cursor word backward | | `Ctrl+W` | `Ctrl+W` | Delete previous word | | `?` | `?` | Show available shortcuts | ### Permission Dialog When Claude proposes a bash command and shows the permission prompt: | macOS | Windows/Linux | Action | |-------|---------------|--------| | `Esc` | `Esc` | Cancel the command | | `Tab` | `Tab` | Amend the command before running | | `Ctrl+E` | `Ctrl+E` | Explain + risk assessment for the proposed command | ### Session Control | macOS | Windows/Linux | Action | |-------|---------------|--------| | `Opt+P` | `Alt+P` | Switch models (Opus/Sonnet/Haiku) | | `Shift+Tab` | `Shift+Tab` | Toggle permission modes (Auto-Accept/Plan/Normal) | | `Ctrl+O` | `Ctrl+O` | Toggle verbose output | | `Ctrl+S` | `Ctrl+S` | Stash the current prompt | | `Ctrl+B` | `Ctrl+B` | Move bash operation to background (tmux: press twice) | | `Esc+Esc` | `Esc+Esc` | Rewind conversation (also interrupts current generation) | | `Ctrl+Z` | `Ctrl+Z` | Suspend Claude Code (resume with `fg`) | | `Ctrl+L` | `Ctrl+L` | Clear terminal (keeps history) | | `Ctrl+D` | `Ctrl+D` | Exit session | --- ## Slash Commands ### Configuration | Command | Description | |---------|-------------| | **/config** | Configure thinking mode and other settings | | **/statusline** | Configure status line display ([docs](https://code.claude.com/docs/en/statusline)) | | **/memory** | Manage CLAUDE.md notes | | **/context** | Show context window usage | ### Navigation | Command | Description | |---------|-------------| | **/tasks** | List running background tasks | | **/todo** | Manage task list | | **/clear** | Clear conversation history | | **/help** | Display help information | | **/btw** | Ask a quick side question without interrupting current work | ### Development | Command | Description | |---------|-------------| | **/review** | Code review mode | | **/test** | Run tests | | **/debug** | Debugging assistance | --- ## Skills Markdown instructions in `.claude/skills/<skill-name>/` that extend Claude Code with project-specific workflows. Invoked with `/<skill-name>` or auto-matched from the skill's description. Keep skills single-purpose, kebab-cased, and idempotent. Examples: `process-inbox`, `obsidian-sync`, `add-quote`. --- ## Worktrees Parallel agents can each run in an isolated git worktree, so they don't interfere with one another. Each agent gets its own working directory while sharing the same `.git` object store. Set `isolation: "worktree"` when spawning a Task agent, or use the CLI flag to start a session in a new worktree: ```bash claude --worktree ``` - If the agent makes **no changes** → worktree is automatically cleaned up - If the agent makes **changes** → worktree path and branch are returned for review/merge Supported in the Desktop app and the CLI. See also: [git-worktree docs](https://git-scm.com/docs/git-worktree) --- ## Session Teleporting & Parallel Workflows Seamless session handoff between local CLI and web, enabling parallel workflows across multiple instances. ### Terminal to Web Type `&` followed by your task to send it to a new web session: ```text & Fix the authentication bug in src/auth/login.ts ``` Or via CLI flag: ```bash claude --remote "Fix the authentication bug in src/auth/login.ts" ``` This creates a new web session on claude.ai with your current conversation context. The task runs in the cloud while you continue working locally. Sessions persist even if you close your laptop. Each `&` creates an independent session — run multiple in parallel: ```text & Fix the flaky test in auth.spec.ts & Update the API documentation & Refactor the logger to use structured output ``` Monitor all with `/tasks`. **Tip:** Use plan mode locally first (`claude --permission-mode plan`), then send to web for autonomous execution. ### Web to Terminal | Method | How | |--------|-----| | `/teleport` or `/tp` | Interactive picker of web sessions | | `claude --teleport` | CLI flag (add `<session-id>` for direct resume) | | `/tasks` → press `t` | Teleport into a specific task | | Web UI → "Open in CLI" | Copy command to paste in terminal | ### Teleport Requirements | Requirement | Details | |-------------|---------| | Clean git state | No uncommitted changes (prompted to stash if needed) | | Correct repository | Must be the same repo, not a fork | | Branch available | Web session branch must be pushed to remote | | Same account | Same Claude.ai account as web session | ### Environment Setup - `/remote-env` — choose cloud environment for web sessions - `SessionStart` hooks in `.claude/settings.json` — automatic dependency installation - Cloud environments come with Python, Node.js, Go, Rust, PostgreSQL 16, Redis 7.0, and more ### References - [Official Docs: Claude Code on the Web](https://code.claude.com/docs/en/claude-code-on-the-web) - [Simon Willison: Claude Code for Web](https://simonwillison.net/2025/Oct/20/claude-code-for-web/) - [Boris Cherny on X: Parallel workflows](https://x.com/bcherny/status/1885411069065584914) --- ## Remote Control Continue a local Claude Code session from your phone, tablet, or any browser. Unlike teleporting (which runs in the cloud), Remote Control keeps the session running on your machine — your filesystem, MCP servers, tools, and project config all stay available. ### Starting a Session | Method | Command | |--------|---------| | New session | `claude remote-control` | | From existing session | `/remote-control` or `/rc` | | Enable for all sessions | `/config` → Enable Remote Control for all sessions | Press `Space` to show a QR code for quick phone access. Flags for `claude remote-control`: `--verbose`, `--sandbox` / `--no-sandbox`. ### Connecting - Open the session URL in any browser - Scan the QR code with the Claude app ([iOS](https://apps.apple.com/us/app/claude-by-anthropic/id6473753684) / [Android](https://play.google.com/store/apps/details?id=com.anthropic.claude)) - Find the session in [claude.ai/code](https://claude.ai/code) (green dot = online) Use `/rename` before `/rc` to give the session a findable name. Use `/mobile` to show a download QR for the Claude app. ### How It Works - Outbound HTTPS only — no inbound ports opened on your machine - All traffic routed through Anthropic API over TLS - Session survives laptop sleep and network drops; reconnects automatically - Extended outage (~10 min) times out the session ### Limitations - One remote session per Claude Code instance - Terminal must stay open (the local process is the session) ### Remote Control References - [Official Docs: Remote Control](https://code.claude.com/docs/en/remote-control) --- *Last updated: 2026-02-28*