Skip to content

Environment Variables

Every KANNA_* env var Kanna reads, auto-extracted from source. These are tuning knobs — none of them is needed for a normal install.

VariableDefaultDescription
KANNA_BACKGROUND_TASK_MAX_WAKES3How many times a background task may wake its chat after the keep-alive deadline passes before Kanna stops re-waking it.
KANNA_BEACON_AUTO_UPDATEenabledRead by a beacon, not by the Kanna server. Set to "disabled" to stop the beacon from updating itself when it connects to a newer Kanna; Update now in Settings → Beacons still works. An app opened from Finder, the Start menu or at sign-in does not see shell variables.
KANNA_BEACON_HOME~/.kanna-beaconRead by a beacon, not by the Kanna server. The folder where the beacon keeps its key, its state and the app record; the app and the CLI on one machine share it.
KANNA_BEACON_RELEASE_BASEhttps://github.com/cuongtranba/kanna/releases/downloadRead by the command-line and Windows 7 beacons, not by the Kanna server or the desktop app. Replaces the location a beacon downloads its update from, for testing against a local copy of a release. Kanna cannot set it.
KANNA_CLAUDE_BACKGROUND_TASK_MAX_MS1800000How long a launched background task may hold a session warm against the idle reaper (30 min). Only applies to a session with no live task list from the SDK; when the SDK reports its background tasks, set membership decides and this deadline is never consulted.
KANNA_CLAUDE_DRIVER(unset)Ignored. The PTY driver was removed and every Claude chat runs on the Claude Agent SDK. Setting it to "pty" only logs a warning at boot; leave it unset.
KANNA_CLAUDE_SESSION_IDLE_MS600000Idle window before a resident Claude session is reaped (10 min).
KANNA_CLAUDE_SESSION_MAX_RESIDENT4Max simultaneously resident Claude sessions before the least-recently-used is reaped.
KANNA_CLAUDE_SESSION_SWEEP_INTERVAL_MS60000How often the resident-session reaper sweeps for idle sessions.
KANNA_CRON_CONFIRMenabledSet to "disabled" to stop the host from escalating a typed /cron arm to a model review turn. When enabled, the model presents the full job config and asks the user to confirm, change, or disarm. Only fires on the typed path — arm_cron already confirms in-turn.
KANNA_CRON_REPAIRenabledSet to "disabled" to stop handing an invalid /cron line to the agent for repair. It only ever fires where Kanna has no corrected command of its own; the validate_cron / arm_cron tools stay registered either way.
KANNA_DISABLE_SELF_UPDATE0Set to "1" to disable the in-app self-update path.
KANNA_GENUIenabledSet to "disabled" to stop teaching the agent the ```kanna-ui generative-UI format and to turn off the end-of-turn check that asks it to fix a view that would not render. Views already in a transcript keep rendering, and the validate_ui tool stays registered.
KANNA_HEAP_SNAPSHOTenabledSet to "disabled" to stop SIGUSR2 from writing a V8 heap snapshot under the data dir. `kill -USR2 <pid>` is how you find what is holding memory on a live process.
KANNA_IMPORT_FOLLOW_ACTIVE_WINDOW_MS600000A single-session import only auto-arms live-tailing when the source file mtime is within this window of "now".
KANNA_IMPORT_FOLLOW_IDLE_MS600000The live-tail registry stops following a session after this long with no source file growth.
KANNA_IMPORT_FOLLOW_POLL_MS2000Stat-poll tick interval driving the single-session-import live-tail FollowedSessionRegistry.
KANNA_LOG_ANALYTICS0Set to "1" to log analytics payloads to stderr. Debugging aid.
KANNA_LOG_CLAUDE_STEER0Set to "1" to log mid-turn steering messages sent to Claude. Debugging aid.
KANNA_MCP_TOOL_CALLBACKS0Set to "1" to route AskUserQuestion / ExitPlanMode / built-in shims through the durable approval protocol.
KANNA_MEMLOG_MS60000Interval between "[kanna/mem] rss=…" process-memory log lines. Set to 0 to disable.
KANNA_MERMAID_GUARDenabledSet to "disabled" to stop the end-of-turn check that asks the model to fix a mermaid diagram that would not render. The validate_mermaid tool stays registered either way.
KANNA_NATS_RELEASE_BASEhttps://github.com/nats-io/nats-server/releases/downloadWhere the embedded service bus downloads nats-server from. Machine-local test override; every download is still checked against that base's SHA256SUMS.
KANNA_OPENROUTER_FIRST_ENTRY_TIMEOUT_MS120000Fail-close timeout for an OpenRouter turn whose SDK stream stalls before the first transcript entry.
KANNA_OTEL(unset)Overrides the Settings telemetry toggle: "disabled" hard-disables export, "enabled" turns it on even when the setting is off. Unset means the setting decides.
KANNA_OTEL_METRIC_INTERVAL_MS15000How often metrics are exported to the OTLP endpoint.
KANNA_OTEL_SERVICE_NAMEkanna-<machine name>OTel service.name for this install. Overrides the name derived from the computer name.
KANNA_PROACTIVE_COMPACTdisabledSet to "enabled" to restore Kanna's own proactive /compact injection. Off by default because the Claude Code CLI auto-compacts on its own (Settings.autoCompactEnabled, on by default), and Kanna's threshold is lower, so both running means Kanna always wins and the CLI never compacts. Turn it on only if you have set autoCompactEnabled: false in your CLI settings.
KANNA_PROFILE_SEND_TO_STARTING0Set to "1" to log timing for each stage between a send and the turn actually starting. Use when a chat feels slow to begin.
KANNA_PTY_BACKGROUND_TASK_MAX_MS(unset)Former name of KANNA_CLAUDE_BACKGROUND_TASK_MAX_MS. Still read, but only when the new name is unset.
KANNA_RELOADERsupervisorSelf-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_PROFILEprodSet to "dev" to use a separate data root (~/.kanna-dev instead of ~/.kanna), so a development run cannot touch real chats. `bun run dev` sets this for you.
KANNA_SERVER_SECRET(random per process)Stabilises HMAC tool-request ids across process restarts.
KANNA_STACK_MEMORYenabledSet to "disabled" to stop a multi-root (stack) spawn from loading each additional project's CLAUDE.md / .claude/rules. Enabled, Kanna sets CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD on any spawn that has additional roots, so a chat that can WRITE a bound project also reads its conventions — at the cost of those memory files in every turn's context. A single-project chat is unaffected either way.
KANNA_SUBAGENT_IDLE_TIMEOUT_MS300000Idle window after which a keep-alive subagent session is auto-closed. Reset on each turn.
KANNA_SUBAGENT_MAX_LIVE5Max concurrent keep-alive (warm) subagent processes per chat. Over cap, delegate_subagent({keep_alive:true}) fails CAP_EXCEEDED.
KANNA_SUBAGENT_RUN_TIMEOUT_MS(orchestrator default)Stall watchdog for a single subagent run. The Settings value wins over this; this wins over the built-in default. Read once at server start.
KANNA_UPDATE_COMMAND(auto-detected)Overrides the command Kanna runs to install a self-update. Set it when npm, bun, pnpm and yarn are all absent or the wrong one is picked.
KANNA_WEBHOOKSenabledSet to "disabled" to turn off inbound webhooks. Every /hooks/<id> request then answers 404, as if the hook did not exist. Hooks you created are kept and work again when you remove the variable.

To regenerate this table after adding a new env var:

Terminal window
cd wiki && bun run scripts/extract-env-vars.ts

Hand-curated descriptions live in wiki/scripts/extract-env-vars.ts under DESCRIPTIONS. Vars with no description are flagged in the table.

Only vars the scan actually finds in src/ are published, so a description written for a var the code does not read is dropped rather than documented into existence. Test-only knobs are skipped.