Configure ~/.afk/ without reading the docs.
Pick what you need. Copy the output. Paste it once.
Your input never leaves your browser. No analytics, no telemetry, and zero third-party scripts — the generator runs entirely client-side and makes no network requests. Verify it yourself: open DevTools → Network and reload.
Quick setup — covers 80% of installs
I want to run AFK with using .My ANTHROPIC_API_KEY:
Show all 74 optionsEvery env var + JSON field, by category — skip anything you don't need
Model & Sampling
Default model for agent turns. Accepts short aliases (opus, sonnet, haiku, sonnet_1m, opus_1m) or full model IDs like claude-opus-4-5.
Cap on total tokens per turn (input + output). Default 4096.
Numeric temperature override for model sampling. Leave blank to use provider default.
Extended-thinking mode. Accepts adaptive | disabled | enabled:<N> | enabled:max. Defaults to the model-appropriate mode (adaptive on current models) when unset.
Per-turn USD budget ceiling. Aborts when projected spend would exceed this. Default $5.00.
Advanced options
Per-task token budget ceiling. Aborts when cumulative usage would exceed it. Default 100 000.
Cap on output tokens per turn only (not input). Falls back to provider default when unset.
Override the default model used when a subagent is dispatched without an explicit model.
Override the model used by the /compact summarizer. Falls back to a cheap haiku-class model when unset.
Number of recent turns the compactor keeps verbatim during /compact.
Per-turn timeout in milliseconds. Provider/SDK default when unset.
TTL for Anthropic prompt-cache blocks. Accepts 5m or 1h.
Disable Anthropic prompt caching when set to 1/true/yes/on. Unset = caching enabled (default).
Provider & Endpoints
Force provider selection. Overrides the model-name heuristic. The --provider CLI flag wins when both are set.
Effort hint guiding adaptive-thinking depth, forwarded as Anthropic output_config.effort (model-gated; ignored where unsupported). Accepts low | medium | high | xhigh | max.
Base URL for a self-hosted Anthropic-compatible server (e.g. vllm-mlx). When set, traffic is routed away from api.anthropic.com.
Placeholder API key for local Anthropic-compatible servers. Set when AFK_LOCAL_BASE_URL is configured. Default "local".
Base URL override for the OpenAI-compatible provider. Used for local shims (Ollama, vLLM, LM Studio, mlx_lm.server). Do not include a trailing /chat/completions — the SDK appends it automatically.
API Keys
Anthropic API key. Tier-1 credential — overrides keychain OAuth and CLAUDE_CODE_OAUTH_TOKEN.
OpenAI API key for the openai-compatible provider (gpt-*, o1*, o3*, o4* models).
Fallback OpenAI API key for the openai-compatible provider, read after OPENAI_API_KEY. Legacy name from the removed @openai/codex-sdk integration — prefer OPENAI_API_KEY.
Brave Search API subscription token, enabling web_scrape search mode. Free tier at https://brave.com/search/api/. When unset, search mode returns an actionable error; markdown and raw modes are unaffected.
System Prompt
Raw system-prompt string. Tier-1 source — highest priority over afk.config.json and AFK.md. Note: newlines are not valid in afk.env; if you need a multi-line prompt, use the JSON config systemPrompt field instead.
System prompt stored in afk.config.json. Tier-2 source (lower priority than AFK_SYSTEM_PROMPT env var). Supports multi-line content. Env var equivalent: AFK_SYSTEM_PROMPT.
Telegram
Telegram bot token from @BotFather. Required to run the Telegram bot surface (afk telegram start).
Comma-separated list of Telegram chat IDs allowed to interact with the bot. Required when the bot is running. Get your chat ID by messaging @userinfobot.
Advanced options
Set to 1 to log per-message details from the Telegram bot — chat IDs, message text, latency.
Override the working directory used by the Telegram bot when spawning agent sessions.
Override the directory where Telegram bot state is stored. Defaults to ~/.afk/state/telegram/.
Daemon
Default task description for the daemon. The daemon runs this when started with no explicit task. Env override: AFK_DAEMON_TASK.
Task identifier the daemon uses to scope its state directory and telemetry. Env override: AFK_DAEMON_TASK_ID.
Working directory used by the daemon process for spawned agent sessions.
Advanced options
Cooldown in milliseconds between SessionStart trigger fires. Prevents thundering-herd on rapid restarts.
Enable the scheduled worktree-prune job in daemon mode. Default: on.
Cron expression for the worktree-prune schedule. Default: 4 AM daily.
Max age in days before a clean (no uncommitted changes) worktree is auto-pruned. Env override: AFK_WORKTREE_MAX_AGE_CLEAN.
Max age in days before a dirty (uncommitted changes) worktree is auto-pruned. Env override: AFK_WORKTREE_MAX_AGE_DIRTY.
Scope of worktrees targeted by the prune job. Default: all.
Auto-routing
Auto-route bare slash inputs to matching skills in interactive (REPL) mode.
Auto-route bare slash inputs to matching skills in chat (afk chat) mode.
Auto-route bare slash inputs to matching skills in Telegram mode.
Auto-route bare slash inputs to matching skills in daemon mode.
Advanced options
Tier gate. Set to exactly 1 to unlock — surfaces internal skills (e.g. /forge, /audit-fit, harvest/distill) in the slash-command list, --help, and tab-complete. Default unset = public tier. Gates surfacing only, not access.
Interactive & Worktree
Auto-rename worktree branches based on the first user message. Default: on. Env override: AFK_WORKTREE_AUTONAME=0 to disable.
Branch namespace for AFK-managed worktrees. Default "afk/". Set to empty string to drop the prefix. Env override: AFK_WORKTREE_BRANCH_PREFIX.
Master toggle for REPL ghost-text suggestions (Tier-1 history + optional Tier-2 LLM). Default: on when unset. Env override: AFK_SUGGEST_GHOST=0.
Advanced options
Override the base git ref for worktrees created with --worktree. Defaults to the remote default branch, fetched fresh. Set to HEAD to base on the local checkout. Env override: AFK_WORKTREE_BASE; CLI: --worktree-base.
Enable REPL ghost-text inline suggestions (history dropdown + optional LLM). 1 = on (default), 0 = off. Disables all ghost text when off. Tier-2 LLM is separately gated by AFK_SUGGEST_ENABLED.
Enable the LLM-backed ghost-text suggestion tier in the interactive REPL. Set to 1/true/yes/on to activate. Off by default.
Override the small model used for REPL ghost-text suggestions. Falls back to AFK_COMPACT_MODEL or a haiku-class model.
Auto-rename worktree branches based on the first user message. 1 = on (default), 0 = off. JSON equivalent: interactive.worktreeAutoname.
Branch-name prefix for AFK-managed worktrees. Default afk/. Set to empty string to drop the prefix. JSON equivalent: interactive.worktreeBranchPrefix.
Override the base git ref for worktrees. Overridden per-session by --worktree-base. JSON equivalent: interactive.worktreeBase.
Maximum age (in days) before a clean worktree is auto-pruned. Default 14.
Maximum age (in days) before a dirty (uncommitted changes) worktree is auto-pruned. Default 30.
Browser Control
Advanced options
Override default headless mode for native browser-control tools. 1/true forces headless; 0/false forces headed. When unset: headless for daemon/subagent surfaces, headed for repl/interactive.
Comma-separated allowlist of URL host globs. When set, navigation to hosts outside the list returns blocked_by_policy. Unset = permissive. Combines with the blocklist — block wins.
Comma-separated blocklist of URL host globs. Browser navigation matching any entry returns blocked_by_policy regardless of the allowlist.
Session Behavior
Advanced options
When on (the default), the CLI auto-waits for the OAuth subscription reset and replays the failed turn rather than surfacing a raw 429 error.
Show background subagent job summaries in /bgsub:list. DATA EGRESS: sends redacted transcript tails (~4 KB) to claude-haiku-4-5 via the Anthropic API. Do NOT enable in air-gapped or secret-sensitive environments. Default: off.
Session-wide budget for background-summarizer LLM calls. Further refreshes are skipped silently after this count. Default 200, max 500.
Paths
Override the AFK home directory. All config, state, and traces live here. Default ~/.afk.
Advanced options
Override the AFK state directory (sessions, todos, daemon state). Default: $AFK_HOME/state/.
Updates
Update-checker policy. "notify" shows a banner on startup; "auto" installs automatically; "off" disables the check entirely.
Debug & UI
Show inline diffs in the tool-lane output for edit/write tool calls.
Suppress the ANSI-colored banner at REPL startup. Useful for non-TTY captures and CI logs.
Enable verbose debug logging across the codebase.
Advanced options
Show rotating tips in the loading spinner during long calls. 1 = on, 0 = off.
Enable the REPL !cmd / !&cmd shell-passthrough feature. On by default. Set 0/false/off/no to disable, so inputs beginning with ! are sent to the model as literal text. Equivalent to --no-shell-passthrough.
Maximum number of diff lines shown in the inline diff render during write_file tool calls. Set to 0 for no cap.
Maximum visual rows emitted by the user info card before collapsing the remainder into a "…(N lines collapsed)" row. Default 24.
Comma-separated list of additional path globs that the write_file tool refuses to write to.
Allow loading MCP configuration from <cwd>/.mcp.json. Disabled by default — opt-in to mitigate config-injection risks.
Disable the agent trace subsystem entirely. Set to skip trace file writes under ~/.afk/.
{}Choose options on the left — your config builds here as you go.
Fill in at least one field above and the install commands appear here.