Environment Variables
Every KANNA_* env var Kanna reads, auto-extracted from source.
| Variable | Default | Description |
|---|---|---|
KANNA_CLAUDE_DRIVER | sdk | Driver mode: "sdk" (API rates) or "pty" (subscription billing, macOS/Linux only). |
KANNA_CLAUDE_SESSION_IDLE_MS | 600000 | Idle window before a resident Claude session is reaped (10 min). |
KANNA_CLAUDE_SESSION_MAX_RESIDENT | 4 | Max simultaneously resident Claude sessions before the least-recently-used is reaped. |
KANNA_CLAUDE_SESSION_SWEEP_INTERVAL_MS | 60000 | How often the resident-session reaper sweeps for idle sessions. |
KANNA_DISABLE_SELF_UPDATE | 0 | Set to "1" to disable the in-app self-update path. |
KANNA_LOG_ANALYTICS | (undocumented) | (no description — add one to extract-env-vars.ts DESCRIPTIONS) |
KANNA_LOG_CLAUDE_STEER | (undocumented) | (no description — add one to extract-env-vars.ts DESCRIPTIONS) |
KANNA_MAX_AGENT_WAKES | 25 | Max consecutive agent self-scheduled wakes per chat before the runaway-loop cap trips. Resets on a real user turn. |
KANNA_MCP_TOOL_CALLBACKS | 0 | Set to "1" to route AskUserQuestion / ExitPlanMode / built-in shims through the durable approval protocol. |
KANNA_OPENROUTER_FIRST_ENTRY_TIMEOUT_MS | 120000 | Fail-close timeout for an OpenRouter turn whose SDK stream stalls before the first transcript entry. |
KANNA_PENDING_WORKFLOW_POLL_MS | 120000 | Interval the pending-workflow harvest wake re-polls a still-running background Workflow. |
KANNA_PROFILE_SEND_TO_STARTING | (undocumented) | (no description — add one to extract-env-vars.ts DESCRIPTIONS) |
KANNA_PTY_BACKGROUND_TASK_MAX_MS | 1800000 | Max time a launched background Bash task keeps the PTY session warm before the idle reaper may reclaim it (30 min). |
KANNA_PTY_E2E | (undocumented) | (no description — add one to extract-env-vars.ts DESCRIPTIONS) |
KANNA_RELOADER | supervisor | Self-update reload strategy: "supervisor" (default, end-user) or "pm2" (self-host, requires KANNA_REPO_DIR). |
KANNA_REPO_DIR | (unset) | Repo checkout the pm2 reloader pulls/rebuilds. Required when KANNA_RELOADER=pm2. |
KANNA_RUNTIME_PROFILE | (undocumented) | (no description — add one to extract-env-vars.ts DESCRIPTIONS) |
KANNA_RUN_LIVE_TITLE_TESTS | (undocumented) | (no description — add one to extract-env-vars.ts DESCRIPTIONS) |
KANNA_SERVER_SECRET | (random per process) | Stabilises HMAC tool-request ids across process restarts. |
KANNA_SUBAGENT_IDLE_TIMEOUT_MS | 300000 | Idle window after which a keep-alive subagent session is auto-closed. Reset on each turn. |
KANNA_SUBAGENT_MAX_LIVE | 5 | Max concurrent keep-alive (warm) subagent processes per chat. Over cap, delegate_subagent({keep_alive:true}) fails CAP_EXCEEDED. |
To regenerate this table after adding a new env var:
cd wiki && bun run scripts/extract-env-vars.tsHand-curated descriptions live in wiki/scripts/extract-env-vars.ts under DESCRIPTIONS. Vars with no description are flagged in the table.