---
title: "Autohand Code CLI Reference"
description: "Complete reference for all CLI options, slash commands, tools, and keyboard shortcuts available in the Autohand Code CLI."
seo:
  description: "Complete reference for all Autohand Code CLI commands, flags, and options."
---

## CLI options

```bash
autohand [options]
autohand resume [name-or-id] [--last] [--all] [options]
```

| Option | Description |
| --- | --- |
| `[prompt]` | Run a single instruction in command mode (same as `-p`) |
| `-p, --prompt [text]` | Run a single instruction in command mode; with piped stdin, combines stdin and prompt text |
| `--path <path>` | Workspace path to operate in |
| `--dir <path>` | Alias for `--path` |
| `-y, --yes` | Auto-confirm risky actions |
| `--y` | Alias for `--yes` |
| `--model <model>` | Override the configured LLM model |
| `--config <path>` | Path to config file |
| `--profile <name>` | Layer `profiles.<name>` from the config onto this run without saving it. See [Profiles](/working-with-autohand-code/configuration#profiles) |
| `--set <key=value>` | Override one setting for this run by dotted path, e.g. `--set ui.theme=aurora`. Repeatable; never saved |
| `--temperature <value>` | Sampling temperature for the model |
| `--dry-run` | Preview actions without applying changes |
| `--bare` | Skip ambient hooks, LSP, plugin sync, attribution, auto-memory, background prefetches, keychain reads, and AGENTS.md auto-discovery |
| `--offline` | Disable startup network operations, including model catalog refreshes |
| `--unrestricted` | Run without approval prompts |
| `--restricted` | Deny all dangerous operations |
| `--no-idle-logout` | Disable authenticated idle logout for a long-running agent session |
| `--auto-skill` | Auto-generate skills based on project structure |
| `--learn` | Run skill advisor non-interactively (analyze project and install recommended skills) |
| `--learn-update` | Re-analyze project and regenerate outdated LLM-generated skills |
| `-c, --auto-commit` | Auto-commit changes after completing tasks (runs lint and test first) |
| `-v, --version` | Show version number |
| `-d, --debug` | Enable verbose debug output |
| `--thinking [level]` | Set reasoning depth (none, normal, extended) |
| `--patch` | Generate a git-compatible patch file |
| `--output <file>` | Write patch output to a specific file |
| `--output-format stream-json` | Emit command lifecycle events as JSON Lines |
| `--json [stream\|local]` | Stream JSON Lines by default, or emit exactly one final result/error object with `local` |
| `--output-schema <file>` | Command mode only (requires `--prompt`): the final answer must be one JSON document that validates against this JSON Schema file |
| `--mode <mode>` | Run mode: interactive, rpc, or acp |
| `--acp` | Shorthand for `--mode acp` (Agent Client Protocol over stdio) |
| `--goal [input]` | Experimental: run `/goal` non-interactively when `slash_goal` is enabled; omitted input prints goal status |
| `--teammate-mode <mode>` | Team display mode: auto, in-process, or tmux |
| `--worktree [name]` | Run session in isolated git worktree (optional branch name) |
| `--tmux` | Launch in a dedicated tmux session (implies `--worktree`) |
| `--setup` | Run the setup wizard |
| `--about` | Show version and system information |
| `--add-dir <path...>` | Add additional directories to the workspace |
| `--display-language <locale>` | Set the display language (e.g., en, es, fr, ja) |
| `--cc, --context-compact` | Enable context compaction |
| `--no-cc, --no-context-compact` | Disable context compaction |
| `--search-engine <provider>` | Set web search provider (browser-profile, exa, google, brave, duckduckgo, parallel) |
| `--sys-prompt <value>` | Replace the default system prompt (accepts text or file path) |
| `--system-prompt <value>` | Alias for `--sys-prompt` |
| `--system-prompt-file <path>` | Replace the default system prompt with a file's contents; wins over `--system-prompt` and `--sys-prompt` |
| `--append-sys-prompt <value>` | Append to the default system prompt (accepts text or file path) |
| `--append-system-prompt <value>` | Alias for `--append-sys-prompt` |
| `--append-system-prompt-file <path>` | Append a file's contents to the system prompt; wins over the other append forms |
| `--mcp-config <path>` | Load an explicit MCP configuration file |
| `--agents <json\|path>` | Load custom agents from inline JSON or an external agents directory |
| `--plugin-dir <path>` | Load an explicit plugin or meta-tool directory |
| `--yolo [pattern]` | Auto-approve tool calls matching a pattern, such as `allow:read_file,write_file` or `deny:delete_path` |
| `--timeout <seconds>` | Time window for auto-approve mode (accepted, not yet enforced in the current release) |
| `--allowed-tools <patterns>` | Only offer and authorize these tools for this run, comma-separated or repeated (e.g. `read_file,find_grep,list_tree`) |
| `--disallowed-tools <patterns>` | Never offer or authorize these tools for this run (e.g. `delete_path,run_command`) |
| `--max-requests <n>` | Stop the run after this many model requests, sub-agents included |
| `--max-tokens <n>` | Stop the run once reported token usage reaches this total, sub-agents included |
| `--max-duration <seconds>` | Stop the run after this much wall time |
| `--ephemeral` | Keep this run out of session history: no session files, no auto-memory, no session sync |
| `--fork <path-or-id>` | Create and resume a new session branch from an existing session reference |
| `--rename <name>` | Name the most recent session of this workspace (or `--path`) and exit |
| `--skill-install [name]` | Install a community skill |
| `--project` | Install skill at project level instead of global |
| `--sync-settings [bool]` | Toggle settings sync across devices |
| `--login` | Authenticate with the Autohand service |
| `--logout` | Sign out from the Autohand service |
| `--settings` | Configure Autohand settings and exit |
| `--permissions` | Display current permissions and exit |
| `--feedback` | Submit feedback |
| `--browser` | Enable browser integration (same as `/browser`) |
| `--no-browser` | Disable browser integration |
| `--interactive-on-complete` | After auto-mode ends, hand off to interactive mode (TTY only) |

### Auto-mode options [#automode-options]

Options for autonomous development loops. See the [Auto-mode guide](/guides/auto-mode) for details.

| Option | Description | Default |
| --- | --- | --- |
| `--auto-mode [prompt]` | Enable interactive auto-mode, or start a standalone loop with an inline task | \- |
| `--max-iterations <n>` | Maximum loop iterations | 50 |
| `--completion-promise <text>` | Text marker signaling task completion | "DONE" |
| `--no-worktree` | Disable git worktree isolation | false |
| `--checkpoint-interval <n>` | Git commit every N iterations | 5 |
| `--max-runtime <m>` | Maximum runtime in minutes | 120 |
| `--max-cost <d>` | Maximum API cost in dollars | 10 |

### Headless output and sessions [#headless-output]

Command mode is designed for scripts, cron jobs, CI, and remote runners. Plain text is the human-readable default. Use `--json local` for one final object, or `--output-format stream-json` and `--json stream` when progress should appear incrementally.

| Command | Use case |
| --- | --- |
| `autohand -p "review this repo" --restricted` | Read-only analysis with no dangerous operations |
| `autohand -p "run tests and fix failures" --output-format stream-json` | Stream progress into logs or a remote job UI |
| `autohand -p "summarize this diff" --json local` | Capture exactly one final `result` or `error` object |
| `autohand -p "review this diff" --json stream` | Use the shorter alias for streamed JSON Lines |
| `autohand -p "list failing tests" --output-schema ./result.schema.json` | Require the final answer to be JSON valid against a schema |
| `autohand --profile ci -p "run tests"` | Apply a saved `profiles.ci` config for this run only |
| `autohand --fork <session-id>` | Branch from an existing session without mutating its history |

### Subcommands

Standalone subcommands that run outside interactive mode.

| Command | Description |
| --- | --- |
| `autohand resume [name-or-id]` | Resume a saved session by name, ID, path, or unique ID prefix; with no reference, open the session picker for this project. See [Resuming sessions](#resume) |
| `autohand resume --last` | Resume the most recently active session in this project |
| `autohand resume --all` | Open the picker across all projects; combine with `--last` for the most recent session anywhere |
| `autohand doctor [--json] [--skip-mcp]` | Check runtime, config, tools, terminal, account, MCP servers, and extensions; exits non-zero when a check fails. `--skip-mcp` skips connecting to configured MCP servers |
| `autohand login` | Sign in to your Autohand account |
| `autohand logout` | Sign out of your Autohand account |
| `autohand config` | Configure Autohand settings (same as `/settings`) |
| `autohand config set <key> <value>` | Update one supported configuration value non-interactively |
| `autohand sessions` | List saved sessions (filter with `--project`) |
| `autohand agents [--once]` | Open the agent activity dashboard, or print one snapshot and exit |
| `autohand extensions` | Validate, install, inspect, enable, disable, remove, and diagnose extension packages |
| `autohand experiments` | List and toggle feature flags |
| `autohand squad [args...]` | Run the local Squad runtime |
| `autohand queue [args...]` | Manage queued agent work |
| `autohand init` | Create an AGENTS.md file in the workspace |
| `autohand update [--check\|--models]` | Update the CLI, check availability, or refresh only the model catalog |
| `autohand upgrade [--check]` | Alias for `update` |
| `autohand auto-research [args...]` | Run or operate an autonomous research loop |
| `autohand browser install` | Install and configure the native bridge for supported browsers |
| `autohand import [source]` | Import data from other coding agents; supports `--all`, `--categories`, `--dry-run`, and `--retry-failed` |
| `autohand completion <shell>` | Generate shell completion scripts (bash, zsh, fish) |
| `autohand mcp` | Manage MCP (Model Context Protocol) servers |

### MCP subcommands

Manage MCP servers from outside interactive mode.

| Command | Description |
| --- | --- |
| `autohand mcp add <name> <target> [args...]` | Add an MCP server to config and auto-connect it next session |
| `autohand mcp add -t <transport> -s <scope> <name> <target>` | Add with transport `stdio`, `http`, or `sse` and scope `user` or `project` |
| `autohand mcp list [-s <scope>]` | List configured MCP servers |
| `autohand mcp remove <name> [-s <scope>]` | Remove an MCP server from config |
| `autohand mcp install [server-name] [-s <scope>]` | Browse and install community MCP servers |

## Slash commands

Type `/` to see available commands. These work inside an interactive session:

| Command | Description |
| --- | --- |
| `/help` or `/?` | Show available commands and tips |
| `/model` | Configure or switch LLM providers |
| `/session` | Show current session details |
| `/sessions` | List past sessions |
| `/resume` | Resume a previous session by ID |
| `/new` | Start a fresh conversation |
| `/clear` | Clear the conversation with automatic memory extraction |
| `/undo` | Revert the agent's last file edit and remove the last turn. Other file changes from that turn stay in place. Shell command changes are not undone. |
| `/memory` | View stored project and user memories |
| `/init` | Create an AGENTS.md file |
| `/agents` | List available sub-agents |
| `/agents new` or `/agents-new` | Create a new sub-agent via wizard |
| `/skills` | List available skills |
| `/skills use <name>` | Activate a skill for the current session |
| `/skills info <name>` | Show details about a specific skill |
| `/skills search` | Search for skills in the community registry |
| `/skills trending` | Show trending community skills |
| `/skills install` | Install a community skill from the registry |
| `/skills remove <name>` | Remove an installed skill |
| `/skills deactivate <name>` | Deactivate a skill for the current session |
| `/skills feedback <name>` | Send skill feedback |
| `/skills new` or `/skills-new` | Create a new custom skill interactively |
| `/learn` | Get LLM-powered skill recommendations for your project |
| `/learn deep` | Deep-analyze the project for better skill matching |
| `/learn update [deep]` | Regenerate stale LLM-generated skills |
| `/feedback` | Send feedback with environment details |
| `/formatters` | List available code formatters |
| `/lint` | List available code linters |
| `/completion` | Generate shell completion scripts |
| `/export` | Export session to markdown, JSON, or HTML |
| `/quit` | Exit the session |
| `/mcp` | Interactive MCP server manager (toggle enable/disable) |
| `/mcp connect <name>` | Connect to a configured MCP server |
| `/mcp disconnect <name>` | Disconnect from an MCP server |
| `/mcp add` | Add custom server or browse community registry |
| `/mcp list` | List tools from connected MCP servers |
| `/mcp tools` | Alias for listing available MCP tools |
| `/mcp remove <name>` | Remove an MCP server |
| `/mcp install` | Install a new MCP server from the registry |
| `/cc` | Toggle context compaction on or off |
| `/search` | Configure web search provider |
| `/sync` | Configure settings sync |
| `/settings` | Configure application settings (ui, agent, permissions, network, telemetry) |
| `/theme` | Change terminal color theme |
| `/plan` | Toggle plan mode (read-only planning before execution) |
| `/goal` | Experimental persistent goals, queues, budgets, templates, and status; requires `slash_goal` |
| `/status` | Show current session status and statistics |
| `/login` | Authenticate with the Autohand service |
| `/logout` | Sign out from the Autohand service |
| `/permissions` | Inspect current permission settings |
| `/hooks` | Manage project hooks |
| `/add-dir <path...>` | Add directories to the current workspace scope |
| `/language` | Change the display language |
| `/history` | Browse session history |
| `/about` | Show version and system information |
| `/ide` | Show IDE integration info |
| `/share` | Share the current session |
| `/repeat [interval] <prompt>` | Schedule a recurring prompt at a fixed interval |
| `/repeat list` | Show active recurring jobs |
| `/repeat cancel <id>` | Cancel a recurring job |
| `/repeat help` | Show repeat usage and examples |
| `/team` | Manage agent teams |
| `/team create` | Create a new team |
| `/team status` | Show team status |
| `/team shutdown` | Shut down all teammates |
| `/tasks` | List and manage team tasks |
| `/message` | Send a direct message to a teammate |
| `/browser` | Continue the session in the browser extension |
| `/browser disconnect` | Disconnect the browser bridge |
| `/extensions` | Validate, install, inspect, and manage extension packages |
| `/ps` | List background shell processes started by the agent |
| `/stop [index]` | Stop one background shell process |
| `/whatsnew` | View and dismiss CLI announcements |
| `/changelog` | View recent GitHub release notes |
| `/import [source]` | Import data from other coding agents |
| `/review` | Run a staff-level code review with actionable findings |
| `/pr-review` | Review a pull request using gh metadata and diff context |
| `/setup` | Run the setup wizard |
| `/yolo` | Toggle YOLO mode for auto-approving actions |
| `/tools` | List, inspect, disable, rename, or delete persisted meta-tools |

### Settings editor

`/settings` opens the interactive settings editor in the terminal. It organizes configuration into UI, Agent, Sessions, Permissions, Network, Telemetry, Auto-mode, Teams, and Search categories, then saves changes to the selected `config.toml`, `config.yaml`, `config.yml`, or `config.json` file.

Use the editor for common changes such as theme, display language, provider redirects, permission defaults, retry behavior, telemetry, team display mode, and search provider. Use `--config <path>` or `AUTOHAND_CONFIG` when automation needs a dedicated config file.

### Goal commands

`/goal` is an experimental durable goal surface behind the `slash_goal` feature flag. Enable it with `/features enable slash_goal` before using the slash command, `--goal`, JSON-RPC goal methods, ACP command metadata, or the goal tools.

| Command | Description |
| --- | --- |
| `/goal` | Show the active goal and queued goals |
| `/goal <objective>` | Create a persistent active goal |
| `/goal queue <objective>` | Add a goal to the FIFO queue without replacing the active goal |
| `/goal pause` | Pause the active goal |
| `/goal resume` | Resume a paused goal, or start the next queued goal when no active goal exists |
| `/goal complete` | Mark the active goal complete |
| `/goal clear` | Clear the active goal |
| `/goal templates` | List reusable templates from `.pi-goals/` and `.ai/.pi-goals/` |
| `autohand --goal [input]` | Run the same goal surface outside interactive mode |

### Auto-mode commands [#automode-commands]

| Command | Description |
| --- | --- |
| `/automode <prompt>` | Start auto-mode with a task |
| `/automode on` | Enable interactive auto-mode for this session |
| `/automode off` | Disable interactive auto-mode for this session |
| `/automode status` | Show current loop state |
| `/automode pause` | Pause the loop |
| `/automode resume` | Resume paused loop |
| `/automode cancel` | Cancel the loop |
| `/automode help` | Show auto-mode help |

## Interactive input

Autohand accepts several terminal-native inputs in addition to normal prompts and slash commands.

| Input | Behavior |
| --- | --- |
| `!` | Run a shell command directly without asking the model, such as `! git status` or `! npm test` |
| `@` | Open file and directory mention autocomplete |
| `#` | Save a project or user memory for future sessions |
| `/` | Open slash command suggestions |
| `Shift+Tab` | Cycle edit, plan, auto and YOLO modes when supported by the terminal |
| `Esc` | Cancel the current operation or close the active picker |
| `Ctrl+C` | Warn on first press during active work; press again to force exit |
| Large paste | Compact pasted content into a paste indicator while still sending the full content to the model on submit |

## File mentions

Type `@` followed by a filename to include file context in your prompt. Autohand shows an autocomplete palette with your workspace files.

```bash
# Include a specific file
"Fix the bug in @src/utils/parser.ts"

# Mention multiple files
"Compare @package.json with @package-lock.json"
```

Use arrow keys to navigate suggestions and Tab to autocomplete.

## Memory

Store context for reuse across sessions by typing `#` followed by your memory content:

```bash
# always use TypeScript strict mode for this project
# prefer functional components over class components
# run npm test before committing
```

When you save a memory, Autohand asks where to store it:

- **Project level**: Saved to `.autohand/memory/` in your repo. Shared with your team via version control.
- **User level**: Saved to `~/.autohand/memory/`. Personal preferences that apply across all projects.

Autohand detects similar existing memories and offers to update them instead of creating duplicates. View all stored memories with `/memory`.

## Configuration lookup

Autohand loads configuration from the first available source in this order:

1. `--config <path>` command-line flag
2. `AUTOHAND_CONFIG` environment variable
3. `~/.autohand/config.toml`
4. `~/.autohand/config.yaml`
5. `~/.autohand/config.yml`
6. `~/.autohand/config.json`

`AUTOHAND_HOME` defaults to `~/.autohand` and changes the base directory for the standard file names. Multiple standard config formats in the selected directory are rejected rather than merged.

Use a dedicated config file for CI, cron, VPS, Docker, or webhook runners so automation does not inherit personal interactive settings by accident.

### Local project permissions

Project-level approvals can be saved to `.autohand/settings.local.json`. Local permissions take priority over global settings, which is useful when a trusted repository can auto-approve narrow commands while other projects remain interactive.

```json
{
  "permissions": {
    "allowList": ["run_command:npm test", "run_command:npm run lint"],
    "denyList": ["run_command:rm *", "delete_path:*"]
  }
}
```

## Tools

Autohand has access to a comprehensive set of tools for working with your codebase:

### File operations

- `read_file`: Read file contents
- `write_file`: Write full contents to a file
- `notebook_edit`: Edit Jupyter notebook cells by index or cell ID
- `append_file`: Append text to a file
- `apply_patch`: Apply a unified diff patch
- `search_replace`: Apply exact SEARCH/REPLACE blocks
- `create_directory`: Create directories
- `delete_path`: Remove files or directories (requires approval)
- `rename_path`: Rename or move files
- `copy_path`: Copy files or directories
- `list_tree`: Show directory structure
- `file_stats`: Get file metadata
- `checksum`: Compute file checksums

### Search

- `fff_grep`: Content search with frecency ranking, definition detection, and ripgrep fallback
- `fff_find`: Path and filename search with frecency ranking and ripgrep fallback
- `tool_search`: Search built-in and meta tools by capability, name, or description

### Git operations

- `git_status`, `git_diff`, `git_log`: View repository state
- `git_list_untracked`, `git_diff_range`, `git_apply_patch`: Inspect untracked files, staged changes, ranges, and patches
- `git_add`, `git_commit`, `git_reset`, `auto_commit`: Stage, reset, and commit changes
- `git_branch`, `git_switch`, `git_checkout`: Branch management
- `git_stash`, `git_stash_list`, `git_stash_pop`, `git_stash_apply`, `git_stash_drop`: Stash operations
- `git_merge`, `git_merge_abort`, `git_rebase`, `git_rebase_abort`, `git_rebase_continue`, `git_rebase_skip`: Integration and conflict workflows
- `git_cherry_pick`, `git_cherry_pick_abort`, `git_cherry_pick_continue`: Cherry-pick workflows
- `git_fetch`, `git_pull`, `git_push`: Remote operations
- `git_worktree_*`: Advanced worktree management

### Development

- `run_command`: Execute shell commands (requires approval)
- `shell`: Execute shell commands with live TUI output
- `custom_command`: Define reusable commands
- `add_dependency`: Add npm packages
- `remove_dependency`: Remove npm packages
- `format_file`: Format with prettier, black, rustfmt, etc.
- `code_review`: Run a staff-engineer-level code review

### Planning

- `plan`: Capture planning notes
- `exit_plan_mode`: Present a plan for approval and exit planning
- `todo_write`: Create structured task lists
- `tools_registry`: List all available tools
- `ask_followup_question`: Ask the user for clarification in interactive or plan mode

### Memory and skills

- `save_memory`, `recall_memory`: Store and retrieve reusable project or user context
- `skill`: Invoke an installed skill
- `find_agent_skills`, `install_agent_skill`: Discover and install agent skills
- `create_meta_tool`: Persist a reusable meta-tool

### Agents, teams, and tasks

- `delegate_task`, `delegate_parallel`: Send work to one or more sub-agents
- `create_team`, `add_teammate`, `team_status`, `send_team_message`: Manage collaborative agent teams
- `create_task`, `task_get`, `task_list`, `task_update`, `task_stop`, `task_output`: Track and inspect team tasks
- `enter_worktree`, `exit_worktree`: Move between isolated worktree contexts

### Web and browser

- `web_search`, `fetch_url`, `package_info`, `web_repo`: Search the web, fetch pages, inspect packages, and look up repository metadata
- `browser_screenshot`, `browser_click`, `browser_type`, `browser_navigate`, `browser_scroll`: Drive the connected Chrome tab
- `browser_find_element`, `browser_get_element`, `browser_wait_for_element`, `browser_press_key`: Inspect and interact with page elements
- `browser_get_page_context`, `browser_read_network`, `browser_read_console`, `browser_execute_js`: Debug and extract browser context
- `browser_get_tabs`, `browser_get_tab_groups`: Inspect open tabs and tab groups

### Scheduling and workspace access

- `cron_create`, `cron_delete`, `list_schedules`, `cancel_schedule`: Create and manage recurring work
- `sleep`: Pause execution for a duration
- `request_directory_access`: Request permission to work outside currently allowed directories
- `project_tracker`: Track project progress

## Sub-agents

Define specialized sub-agents in `~/.autohand/agents/` as markdown files. Each agent has a name, description, optional model override, and allowed tools.

View available agents with `/agents`. Create new ones with `/agents new` or `/agents-new`.

Autohand can delegate tasks to sub-agents:

- `delegate_task`: Send a task to a specific sub-agent
- `delegate_parallel`: Run up to 5 sub-agents in parallel

## Permissions

Autohand operates in three permission modes:

- **Interactive** (default): Asks for confirmation before destructive operations like deleting files or running shell commands.
- **Unrestricted** (`--unrestricted`): No approval prompts. Use with caution.
- **Restricted** (`--restricted`): Automatically denies all dangerous operations.

Configure fine-grained permissions in your config file:

```json
{
  "permissions": {
    "allowList": ["run_command:npm *", "run_command:bun *"],
    "denyList": ["run_command:rm -rf *", "run_command:sudo *"]
  }
}
```

## Sessions

Sessions are automatically saved to `~/.autohand/sessions/`. Each session tracks:

- Conversation history
- Tool outputs and agent reasoning
- Project path and model used
- Timestamps and message counts

### Resuming sessions [#resume]

```bash
# Pick from this project's sessions
autohand resume

# Resume by saved name, session ID, unique ID prefix, or session path
autohand resume release-prep
autohand resume abc123

# Most recent session in this project, or across all projects
autohand resume --last
autohand resume --last --all

# Picker across all projects
autohand resume --all

# Name the most recent session of this workspace, then exit
autohand --rename release-prep

# Inside an interactive session
/resume abc123
/sessions
```

A saved name wins over an ID prefix. If a name matches more than one session, Autohand reports the ambiguity and asks for an ID prefix. A session reference cannot be combined with `--last` or `--all`. `autohand resume` also accepts `--path`, `--config`, `--model`, and `--offline`; `--path` sets the workspace and the project used to filter sessions.

Export sessions for sharing or archiving:

```bash
/export markdown ./session-report.md
/export json ./session-data.json
/export html ./session-report.html
```

## AGENTS.md [#agents-md]

Create an `AGENTS.md` file in your project root to guide Autohand's behavior. Use `/init` to generate a template.

Include information like:

- Framework and build commands
- Testing requirements
- Code style preferences
- Project-specific constraints

Autohand reads this file automatically and follows its guidelines.

## Keyboard shortcuts [#keyboard]

| Key | Action |
| --- | --- |
| <kbd>ESC</kbd> | Cancel current operation |
| <kbd>Ctrl+C</kbd> (twice) | Force exit |
| <kbd>Tab</kbd> | Autocomplete file paths |
| <kbd>Shift+Tab</kbd> | Cycle edit, plan, auto and YOLO modes |
| <kbd>Up</kbd> <kbd>Down</kbd> | Navigate suggestions |
| <kbd>/</kbd> | Open slash command menu |
| <kbd>@</kbd> | Open file mention palette |

## YOLO mode

YOLO mode auto-approves tool calls without confirmation prompts. Use it to skip repetitive approvals for trusted operations.

```bash
# Auto-approve all tools
autohand --yolo

# Auto-approve only the listed tools
autohand --yolo "allow:read_file,write_file,run_command"

# Auto-approve every tool except the listed ones
autohand --yolo "deny:delete_path"
```

A pattern has one mode, `allow:` or `deny:`, followed by a comma-separated list of tool names. Use `--disallowed-tools` to block a tool for a run, and config `permissions.denyList` entries such as `run_command:rm -rf *` to block specific shell commands.

:::tip
**Tip:** Combine `--yolo` with `--max-duration` or `--max-requests` to put a hard limit on unattended runs.
:::

## Context compaction

Context compaction automatically compresses conversation history when it approaches the model's context window limit. This lets you work in long sessions without losing important context.

```bash
# Enable via CLI flag
autohand --cc

# Disable via CLI flag
autohand --no-cc

# Toggle during a session
/cc
```

Compaction triggers at tiered thresholds:

- **70%** — Light compression, removing redundant tool outputs
- **80%** — Medium compression, summarizing older conversation turns
- **90%** — Aggressive compression, keeping only essential context

The status bar shows `[CC: ON]` or `[CC: OFF]` to indicate the current state.

## Thinking and reasoning [#thinking]

Control how much reasoning the model performs before responding. Extended thinking produces better results for complex tasks but uses more tokens.

```bash
# No extended thinking
autohand --thinking none

# Normal reasoning (default)
autohand --thinking normal

# Extended deep reasoning
autohand --thinking extended
```

You can also enable extended thinking by default in your settings:

```json
{
  "alwaysThinkingEnabled": true
}
```

<AcademyCta course="autohand-code-101" title="Autohand Code 101" blurb="Install the CLI, complete a real task, and learn to instruct, supervise and review an agent." />

## Frequently asked questions [#faq]

**What are the most common Autohand Code CLI flags?**

The most used flags are --prompt (-p) for single instructions, --model to override the AI model, --yes (-y) to auto-confirm actions, --thinking to set reasoning depth, --auto-mode for autonomous loops, and --yolo for auto-approving trusted commands. Run autohand --help for the full list.

**How do I run Autohand Code CLI in auto-mode?**

Start auto-mode with autohand --auto-mode 'your task description' from the command line, or type /automode inside an interactive session. Set limits with --max-iterations, --max-cost, and --max-runtime. Auto-mode runs in a git worktree by default for safety.

**How do I change the AI model in Autohand?**

Use the `--model` flag when starting a session: `autohand --model claude-4-sonnet`. Inside a running session, type `/model` to see available models and switch. Persist the default in the active provider block, for example `openrouter.model`, inside the selected config file.

**What is the difference between --unrestricted and --yolo?**

The --unrestricted flag skips all approval prompts for every operation. The --yolo flag gives finer control by tool name: --yolo 'allow:read\_file,write\_file' auto-approves file reads and writes, and --yolo 'deny:delete\_path' auto-approves everything except deletes. Use --yolo for targeted automation and --unrestricted only when you trust every action.
