Command Reference

July 27, 2026 ยท View on GitHub

Claude Code Haha starts an interactive session by default. With --print, it can also run as a non-interactive agent in scripts, CI, or another program. The command in a source checkout is ./bin/claude-haha; the installed executable name depends on the installation method.

./bin/claude-haha --help

--help is the source of truth for the installed version. This page explains common options by task instead of duplicating a complete help listing that would quickly become stale.

Quick examples

# Start an interactive session in the current directory
./bin/claude-haha

# Start with an initial request
./bin/claude-haha "Explain how this repository starts"

# Return text and exit
./bin/claude-haha --print "Summarize the latest commit"

# Return one complete JSON result
./bin/claude-haha --print --output-format json "List the main modules"

# Continue the latest session in this directory
./bin/claude-haha --continue

# Resume a session but fork it to a new session ID
./bin/claude-haha --resume <session-id> --fork-session

# Work in a new Git worktree
./bin/claude-haha --worktree docs-refresh

Understand the --print trust boundary first

-p, --print skips the workspace trust dialog. It can still load enabled user, project, and local settings. Hooks, MCP servers, tool permissions, and environment configuration in a trusted project can also affect execution.

Consequently:

  • Run --print, doctor, and automation only in directories you trust.
  • Before processing an unfamiliar repository, inspect .claude/, .mcp.json, plugins, and workspace instructions.
  • --dangerously-skip-permissions bypasses every permission check. Use it only in a disposable, isolated sandbox with no network access.
  • --allow-dangerously-skip-permissions only makes bypass mode selectable; it does not enable bypass by itself.
  • In automation, explicitly limit tools, allowed directories, and budget.

Non-interactive input and output

OptionDescription
-p, --printProcess a request, write the result, and exit
--output-format textPlain text; the default
--output-format jsonOne complete JSON result
--output-format stream-jsonA stream of JSON events
--input-format textPlain-text input; the default
--input-format stream-jsonReceive a stream of JSON events on standard input
--json-schema '<schema>'Require the final structured output to match a JSON Schema
--include-partial-messagesInclude incremental message chunks in stream-json
--include-hook-eventsInclude hook lifecycle events in stream-json
--replay-user-messagesEcho streamed user messages to standard output as acknowledgements
--no-session-persistenceDo not save the non-interactive session
--max-budget-usd <amount>Set the maximum API spend for --print

Structured output example:

./bin/claude-haha --print \
  --output-format json \
  --json-schema '{"type":"object","properties":{"risk":{"type":"string"}},"required":["risk"]}' \
  "Review the current changes and return only the risk level"

Streaming output is an event protocol, not ordinary JSON split across lines. Consumers should dispatch on type and tolerate additional event fields.

Sessions and workspaces

OptionDescription
-c, --continueContinue the latest session in the current directory
-r, --resume [value]Resume by session ID; omit the value for the picker, or pass a search term
--fork-sessionCreate a new session ID when resuming
--session-id <uuid>Use a specific session ID
-n, --name <name>Set the name shown in the resume list and terminal title
--from-pr [value]Resume a session linked to a PR number or URL
--add-dir <paths...>Allow tools to access additional directories
-w, --worktree [name]Create a Git worktree for the session
--tmuxCreate a tmux session with --worktree; uses an iTerm2 pane when supported

--worktree changes the local Git workspace layout. Check repository status first and provide an explicit name in automation.

Models and context

OptionDescription
--model <model>Select a model alias or complete model ID
--fallback-model <model>Use a fallback if the primary model is overloaded in --print mode
--effort <level>Set reasoning effort, such as low, medium, high, xhigh, or max
--agent <agent>Use a configured agent
--agents '<json>'Define custom agents for this session
--system-prompt <text>Replace the system prompt for this session
--append-system-prompt <text>Append text to the default system prompt
--file <specs...>Download file resources at startup as file_id:relative_path
--bareStart a minimal runtime without hooks, LSP, plugin sync, auto-memory, or other automatic discovery

--bare is not a less restricted mode. It reduces implicit context and credential sources, so the caller must explicitly provide prompts, directories, MCP configuration, settings, agents, or plugins.

Tools and permissions

OptionDescription
--tools <tools...>Select built-in tools; "" disables all tools and default uses the default set
--allowed-tools <tools...>Allow matching tools, for example Bash(git:*) Edit
--disallowed-tools <tools...>Deny matching tools
--permission-mode <mode>Choose default, acceptEdits, plan, dontAsk, bypassPermissions, or auto
--no-computer-useDo not load the Computer Use MCP for this session
--chrome / --no-chromeEnable or disable Chrome integration
--ideConnect automatically when exactly one valid IDE is available

Deny rules and platform policy can still override allow rules. Production automation should select the smallest tool set instead of relying on approvals stored on a developer machine.

Settings, MCP, and plugins

OptionDescription
--settings <file-or-json>Load an additional settings file or JSON string
--setting-sources <sources>Select user, project, and local settings sources
--mcp-config <configs...>Load MCP servers from JSON files or JSON strings
--strict-mcp-configIgnore other MCP configuration and use only command-line entries
--plugin-dir <path>Load a plugin directory for this session; repeat the option for multiple paths
--disable-slash-commandsDisable all skills
-d, --debug [filter]Enable debug logging with optional category filtering
--debug-file <path>Write debug logs to a file

--mcp-debug is deprecated; use --debug.

Subcommands

SubcommandPurpose
agentsList configured agents
authManage authentication
auto-modeInspect the Auto mode classifier configuration
doctorCheck updater and runtime health
installInstall a selected native-build channel or version
mcpConfigure and manage MCP servers
plugin / pluginsManage plugins
setup-tokenCreate a long-lived token for a Claude subscription
update / upgradeCheck for and install updates

Each subcommand has separate help:

./bin/claude-haha mcp --help
./bin/claude-haha plugin --help

Interactive commands

Enter /help in an interactive session to see the commands available in the current build. Commands such as /commit and /review come from the built-in command set. Skills and plugins can add commands dynamically, so do not rely on a fixed list in documentation.

If a command is missing, trust the current /help output first and check whether --disable-slash-commands was used.