Skip to content

Configuration

PanCode uses a 6-layer configuration system where each layer overrides the one below it. Configuration is conversational by default: ask the orchestrator to change settings rather than editing files manually.

Priority from highest to lowest:

  1. Runtime overrides: Changes made via /settings, conversational PanConfigure tools, or keyboard shortcuts during a session
  2. Environment variables: PANCODE_* variables from your shell or .env file
  3. Project config: .pancode/settings.json in the current project directory
  4. Global config: ~/.pancode/settings.json for user-wide preferences
  5. Preset values: Applied from panpresets.yaml when --preset is used
  6. Defaults: Hard-coded values from the PanCode source

The PanCodeConfig object contains all runtime configuration:

FieldTypeDefaultDescription
profilestring"standard"Config profile name
domainsstring[]9 domainsEnabled PanCode domains
safetySafetyLevel"auto-edit"Safety enforcement level
reasoningPreferencestring"medium"Reasoning/thinking level
themestring"dark"TUI theme name
promptstring"list files..."Default prompt
providerstring or nullnullProvider override
modelstring or nullnullModel override (provider/model-id)
preferredProviderstring or nullnullPreferred provider for resolution
preferredModelstring or nullnullPreferred model for resolution
toolsstring"read,bash,grep,find,ls"Default tool set
timeoutMsnumber120000Default timeout in milliseconds
LevelDescription
suggestRead-only. Model suggests changes but cannot write files.
auto-editFile reads and edits allowed. Destructive actions gated.
full-autoAll operations allowed without confirmation.
LevelDescription
offNo reasoning/thinking
minimalMinimal internal reasoning
lowLight reasoning
mediumBalanced (default)
highExtended reasoning
xhighMaximum reasoning depth
safety, session, agents, prompts, dispatch,
observability, scheduling, panconfigure, ui

The intelligence domain is opt-in and requires PANCODE_INTELLIGENCE=enabled.

Presets bundle model, reasoning, and safety settings into named configurations. They live in ~/.pancode/panpresets.yaml.

PanCode seeds four presets on first run:

PresetDescriptionModel Source
localLocal inference via homelab enginesPANCODE_MODEL env var
openaiOpenAI (user fills in model IDs)Not set by default
openai-maxOpenAI with high reasoningNot set by default
hybridLocal orchestrator, remote workersPANCODE_MODEL + custom worker
local:
description: "Local inference via homelab engines"
model: localhost-ollama/llama3.2 # Orchestrator model
workerModel: dynamo-ollama/codellama # Worker model override
scoutModel: localhost-ollama/llama3.2 # Scout model override
reasoning: medium # off|minimal|low|medium|high|xhigh
safety: auto-edit # suggest|auto-edit|full-auto
Terminal window
# At boot
pancode --preset local
# At runtime
/preset local
/preset # List available presets

CLI flags (--model, --safety) take precedence over preset values.

Edit ~/.pancode/panpresets.yaml directly. PanCode never overwrites this file after initial creation. Changes take effect on next boot or /preset application.

User-wide preferences persisted across all projects.

{
"theme": "dark",
"safetyMode": "auto-edit",
"reasoningPreference": "medium",
"preferredProvider": "localhost-ollama",
"preferredModel": "localhost-ollama/llama3.2"
}

Per-project overrides. Same fields as global settings. Takes priority over global.

{
"safetyMode": "full-auto",
"preferredModel": "dynamo-lmstudio/qwen2.5-coder"
}

PanCode provides two tools for the orchestrator to read and modify configuration through conversation:

Available in all modes. Reads current configuration values with types, defaults, and descriptions.

You: "Show me the current configuration"
You: "What is the budget ceiling?"
You: "Read the dispatch config"

Optional domain filter: runtime, models, budget, dispatch, preset.

Applies configuration changes. Some parameters are admin-only and require Admin mode (Alt+A).

You: "Set the budget ceiling to $20"
You: "Change safety to full-auto"

Admin-only parameters include dispatch.timeout, dispatch.maxDepth, and dispatch.concurrency.

Key environment variables for configuration:

VariablePurpose
PANCODE_MODELOrchestrator model (provider/model-id)
PANCODE_WORKER_MODELDefault worker model
PANCODE_SCOUT_MODELScout model
PANCODE_SAFETYSafety level
PANCODE_REASONINGReasoning preference
PANCODE_THEMETUI theme
PANCODE_PROFILEConfig profile
PANCODE_BUDGET_CEILINGBudget ceiling in dollars
PANCODE_LOCAL_MACHINESAdditional machines for discovery
PANCODE_VERBOSEEnable verbose logging
PANCODE_HOMEOverride base config directory

For the complete list, see the Environment Variables Reference.

PanCode reads a .env file from the project root at startup. Variables already set in the shell are not overwritten.

.env
PANCODE_MODEL=localhost-ollama/llama3.2
PANCODE_WORKER_MODEL=dynamo-ollama/codellama
PANCODE_BUDGET_CEILING=25.00
PANCODE_LOCAL_MACHINES=mini=192.168.86.141,dynamo=192.168.86.143
ANTHROPIC_API_KEY=sk-ant-...

PanCode maintains a clear separation:

User config (preserved across resets):

  • ~/.pancode/panpresets.yaml
  • ~/.pancode/panagents.yaml
  • ~/.pancode/settings.json
  • ~/.pancode/agent-engine/auth.json

Runtime state (cleared by pancode reset or --fresh):

  • .pancode/runs.json, metrics.json, budget.json, tasks.json
  • .pancode/runtime/ (board.json, worker results)
  • ~/.pancode/agent-engine/sessions/