Global Options

Global options fixed when the session is created: working directory, model, permission mode, resuming and forking sessions, --json and --remote.

These options are fixed when the session is created, so they go before the subcommand and cannot be changed mid-session:

  • -C, --cd <directory>: the working directory for the session; defaults to the current directory.
  • -m, --model <id>: which model this session uses.
  • -p, --permission-mode <mode>: the permission mode when the session starts.
  • --json: emit the engine's raw protocol JSON, one value per line. This form is meant for programs to read — what you get is exactly what the engine said, not a layer the command line wrapped around it. Diagnostics always go to stderr, so stdout can be treated as pure data.
  • --remote ws://host:port: drive an engine that is already running instead of starting one in this process. Use it together with klaus serve.
  • --config-json <JSON>: pass a chunk of engine configuration directly; it has lower precedence than the named options above.
  • --resume <session id>: pick up a previously saved session instead of starting a new one. --fork <session id> is a different thing: it seeds a brand-new session with that session's history and leaves the original untouched (the two cannot be given at the same time).
  • --provider <name>: the model backend (anthropic by default, openai, gemini). Choosing a backend is the engine endpoint's own concern, so this option is unavailable when driving someone else's engine with --remote.
  • --goal-mode: turn on goal mode — the goal tools, plus automatic continuation after each turn ends. It is off by default in the engine, because auto-continuation spends tokens without you asking again, so it must be requested explicitly per session.
  • --token <TOKEN>: the bearer token for --remote; only valid together with --remote.
  • --session-dir <directory>: where session records are written. Without it they go to ~/.klaus/sessions, so sessions opened from the CLI are also visible in the desktop app.
  • --no-discovery: for this run, do not read skills, sub-agents, hooks, or MCP servers from disk. --no-plugins only skips loading installed plugins; the other three categories are still read.
  • --skills-dir <directory> / --agents-dir <directory>: add an extra skills or sub-agents directory. Can be given repeatedly, and these are searched after the standard roots.
  • --plugin-home <directory>: the directory where the engine reads the plugin ledger.