This document provides a technical reference for the command-line interface (CLI) of Claude Code, detailing interaction patterns, slash commands, and execution modes. It covers the mechanisms by which users provide instructions—ranging from natural language prompts to structured slash commands—and how the system resolves these into tool calls, configuration changes, or session state transitions.
Claude Code operates through four primary input vectors: Slash Commands, CLI Flags, Keyboard Shortcuts, and the Agent View.
Slash commands are internal CLI directives processed by the terminal handler before being sent to the LLM. They allow users to control the agent's environment, manage sessions, and interact with plugins.
/model, /compact, /config). CHANGELOG.md13 CHANGELOG.md18/ralph-loop. README.md48-50/config key=value syntax allows setting any configuration directly from the prompt. CHANGELOG.md66/bug for reporting README.md52-54 and /code-review which now runs as a background subagent CHANGELOG.md36Flags modify the behavior of the claude process at launch.
| Flag | Description | Technical Detail |
|---|---|---|
-p | Print mode | Outputs response to stdout/stderr and exits. Now handles mid-stream API errors more gracefully. CHANGELOG.md15 |
--ax-screen-reader | Accessibility mode | Opt-in plain-text rendering for screen reader users. CHANGELOG.md23 |
--teleport | Repo Check | Shows which repo the current checkout points to when it doesn't match the session. CHANGELOG.md25 |
--mcp-config | MCP Setup | Allows specifying MCP server configurations; errors are listed in headless init events. CHANGELOG.md12 |
Sources: CHANGELOG.md12-25 README.md52-54
The terminal UI (TUI) provides low-level keyboard event handling.
| Key | Action | Technical Note |
|---|---|---|
Ctrl+B | Backgrounding | Triggers background shell caps to prevent resource exhaustion. CHANGELOG.md56 |
Left Arrow | Navigation | On empty prompts, returns to agent view; requires confirmation if pressed after editing. CHANGELOG.md39 |
Esc | Agent View Return | Returns the user to the conversation that was backgrounded. CHANGELOG.md39 |
Option+Delete | Word Deletion | Announced via screen-reader mode for accessibility. CHANGELOG.md37 |
Sources: CHANGELOG.md37-56
| Command | Description | Implementation Details |
|---|---|---|
/resume | Resume session | Restores previous conversation state. Resuming sessions with malformed delta attachments is now stabilized. CHANGELOG.md59 |
/compact | Manage context | Triggers context compaction. Fixed to report accurate post-compact token usage. CHANGELOG.md41 |
/context | Context usage | Reports token usage; previously showed stale data after compaction. CHANGELOG.md41 |
/add-dir | Register Directory | Mid-session directory registration; fires the DirectoryAdded hook. CHANGELOG.md11 |
| Command | Description | Implementation Details |
|---|---|---|
/model | Switch model | Picker now highlights the newest model release (e.g., Opus 5). CHANGELOG.md18-28 |
/mcp | MCP management | Configures MCP servers. Now provides HTTP status and error text on connection failure. CHANGELOG.md16 |
/fast | Fast Mode Toggle | Applies to specific models like Opus 5 and Opus 4.8. CHANGELOG.md30 |
/deep-research | Research Agent | Changed to manual invocation only; Claude no longer auto-launches this. CHANGELOG.md64 |
Sources: CHANGELOG.md11-64
The command system bridges the user's terminal input to the underlying TypeScript engine.
Natural Language to Code Entity Mapping
Sources: CHANGELOG.md12-45 CHANGELOG.md32
The primary mode featuring a status line and streaming output.
Claude can execute commands automatically based on user settings.
rm and suspicious Windows paths are now adjudicated by the auto-mode classifier rather than opening permission dialogs. CHANGELOG.md61Subagents are spawned via tools and can now be nested.
stream-json mode, subagents spawned at depth 2+ appear when --forward-subagent-text is set. CHANGELOG.md14/code-review and /ultrareview run as background subagents to prevent filling the main conversation transcript. CHANGELOG.md36 CHANGELOG.md42Agent & Tool State Transitions
Sources: CHANGELOG.md32 CHANGELOG.md36 CHANGELOG.md61
sandbox.network.strictAllowlist setting allows denying non-allowlisted hosts without prompting the user. CHANGELOG.md10C:\Users\unicorn) prevent corruption into CJK characters during tool input processing. CHANGELOG.md38${VAR} entries from the startup environment rather than settings-file environment. CHANGELOG.md27Sources: CHANGELOG.md10-67
Refresh this wiki
This wiki was recently refreshed. Please wait 4 days to refresh again.