Every key in .alan/settings.json with its default, type, and effect. See guides/configuration.md for how settings resolve through the priority chain.
| Key | Type | Default | Area |
|---|---|---|---|
backend |
string | anthropic-native |
Backend |
model |
string | claude-sonnet-4-6 |
Backend |
api_key |
string | null | null (from env) |
Backend — ephemeral, not persisted |
base_url |
string | null | null |
Backend |
tool_call_format |
string | null | null |
Backend — hermes, glm, alan |
permission_mode |
string | edit |
Session |
max_iterations_per_turn |
int | null | null (unlimited) |
Session |
max_output_tokens |
int | null | null |
Session |
custom_system_prompt |
string | null | null |
System prompt |
append_system_prompt |
string | null | null |
System prompt |
memory |
string | off |
Memory |
verbose |
bool | false |
Logging |
hooks |
object | {} |
Hooks |
compact_max_output_tokens |
int | 20_000 |
Compaction |
capped_default_max_tokens |
int | 8_000 |
Output control |
escalated_max_tokens |
int | 64_000 |
Output control |
auto_compact_buffer_tokens |
int | 13_000 |
Compaction |
warning_threshold_buffer_tokens |
int | 20_000 |
Compaction |
blocking_limit_buffer_tokens |
int | 3_000 |
Compaction |
max_consecutive_compact_failures |
int | 3 |
Compaction |
compaction_threshold_percent |
int | 80 |
Compaction |
max_compact_ptl_retries |
int | 3 |
Compaction |
max_output_tokens_recovery_limit |
int | 3 |
Error recovery |
max_tool_concurrency |
int | 10 |
Tool execution |
tool_result_max_chars |
int | 20_000 |
Tool execution |
compact_clear_keep_recent |
int | 10 |
Compaction |
thinking_budget_default |
int | 10_000 |
Thinking |
memory_reminder_threshold |
int | 10 |
Memory |
max_scratchpad_sessions |
int | 5 |
Sessions |
compaction_truncate_enabled |
bool | true |
Compaction layer toggle |
compaction_clear_enabled |
bool | true |
Compaction layer toggle |
compaction_auto_enabled |
bool | true |
Compaction layer toggle |
Source of truth: alancode/settings.py::SETTINGS_DEFAULTS.
Transport (advanced — inferred from model when not set explicitly).
"anthropic-native"— direct Anthropic SDK (cache_control, native thinking, nativetool_use). Default for bareclaude-*model names."auto"— universal LiteLLM transport (OpenAI, OpenRouter, Gemini, Vertex, Bedrock, Ollama, vLLM, SGLang, local servers). Default for everything else."scripted"— deterministic test backend. See reference/python-api.md.
The legacy provider key ("litellm" / "anthropic" / "scripted") is auto-migrated to backend on first read.
Model identifier. Bare names (claude-sonnet-4-6, gpt-4o) or LiteLLM-style provider/model prefixes (openrouter/google/gemini-2.5-pro, ollama/llama3.1, anthropic/claude-sonnet-4-6).
Changing model mid-session also re-infers backend (bare claude-* → anthropic-native, anything else → auto).
If null, read from the provider's environment variable at init time. Never persisted to disk (flagged ephemeral).
Override the API endpoint. Set for local servers (http://localhost:8000/v1).
Text-based tool-call protocol for models without native function calling. Options: "hermes", "glm", "alan". When set, tool definitions are injected into the system prompt instead of being passed as API tool schemas, and the model's text output is parsed for tool calls. null (default) means use the model's native function calling.
"yolo"— allow everything without asking."edit"(default) — allow read, ask for write/exec."safe"— ask for everything except pure reads.
Hard cap on API calls per user message. null = unlimited. Prevents runaway loops; ignores reasoning-loops that should stop naturally.
Ceiling on output tokens per call. Internally escalated up to escalated_max_tokens on recovery.
Replaces Alan's built-in system prompt entirely (sections 1–9). Sections 10–14 (skills, memory, scratchpad, ALAN.md, tool format) still append. Use with care — you lose all the tool-use guidance and safety instructions baked in.
Appended to Alan's built-in system prompt. Safer way to inject project-specific nudges beyond what ALAN.md offers. Not cacheable by Anthropic (changes per session).
"off"(default) — no read/write of memory files."on"— read on start, write only on explicit/saveor user request."intensive"— also proactively save after significant turns.
In intensive mode, iterations between memory-save reminders. Default 10.
If true, debug-level logging to stderr. Same effect as --verbose flag.
Dict mapping hook-type name to list of hook configs. See guides/hooks.md for the schema and examples.
When Layer C (auto-compact) kicks in, as a percentage of the context window. Default 80.
Layer A truncates any single tool result exceeding this. Default 20 000 chars.
Layer B clears old tool results but keeps the most recent N. Default 10.
Output budget for the Layer C summarization call. Default 20 000.
Emergency compaction trigger — if predicted tokens would land within this margin of the context ceiling. Default 13 000.
User-facing "context is filling up" warning trigger. Default 20 000.
Hard floor — refuses API calls that would land this close to the ceiling. Default 3 000.
Circuit-breaker threshold. After N failed compactions in a row, Alan surfaces an error and stops trying. Default 3.
Prompt-too-long retries during the compaction summarize step itself. Default 3.
Independent toggles for compaction layers A/B/C. All true by default.
Default max_tokens per API call, even when the model would accept more. A slot-reservation optimization: by keeping this small, more context-window space is available for input. Default 8 000.
Retry budget after the capped default is hit mid-generation. Default 64 000 — practical ceiling for most current models.
When the model keeps getting cut off at max_tokens, how many "Resume directly" injections to try before giving up. Default 3.
Max parallel read-only tool executions. Write and exec tools always run serially. Default 10.
For models supporting extended thinking (Claude Sonnet 4, DeepSeek R1, o1-style): token budget the model can burn on reasoning before the visible response. 0 disables. Default 10 000.
How many scratchpad directories to keep. Older ones are GC'd. Default 5.
Invalid values at load-time (wrong type, out-of-enum string, negative integer where positive required) fall back to the default with a WARNING logged to stderr. Settings are never silently dropped — bad values are visible.
Validators live in alancode/settings.py::_VALIDATORS.
- guides/configuration.md — priority chain, how to change settings at runtime.
- reference/cli.md — CLI flags map 1-to-1 with the most common settings.
- reference/slash-commands.md —
/settingsand/settings-project.