Skip to content

Modes and Presets

PanCode’s behavior is configured through activity modes (what the system does) and presets (named boot configurations). This document covers both systems and how they interact.

PanCode operates in one of four activity modes. Modes physically gate which tools the LLM sees, providing structural control over the orchestrator’s capabilities.

ModeKeyboardDescription
PlanShift+TabAnalysis and exploration. Read-only tools + shadow explore. No dispatch, no mutations.
BuildShift+TabFull development. All tools including edit, write, dispatch.
ReviewShift+TabQuality checks. Read-only tools + dispatch for review workers. No mutations.
AdminAlt+AGod mode. Full system management, config tools, diagnostic dispatch. No file mutations.

Shift+Tab cycles through plan, build, review in order. Admin is excluded from this cycle to prevent accidental activation.

Alt+A toggles Admin mode directly. Pressing Alt+A from any mode enters Admin. Pressing Alt+A while in Admin returns to the previous mode.

Each mode defines exactly which tools the LLM can see:

Tool CategoryAdminPlanBuildReview
Read-only (read, bash, grep, find, ls)YesYesYesYes
Mutable (edit, write)NoNoYesNo
Shadow exploreYesYesYesYes
Task tools (task_write, task_check, etc.)YesYesYesNo
Dispatch (dispatch_agent, batch_dispatch, chain)YesNoYesYes
Config (pan_read_config, pan_apply_config)YesYesYesYes

Each mode has a preferred reasoning level that controls how deeply the LLM thinks:

ModeReasoning LevelRationale
AdminxhighSystem management needs deep analysis
PlanhighPlanning benefits from thorough reasoning
BuildmediumExecution needs efficiency over depth
ReviewxhighQuality review needs careful analysis

The reasoning level is clamped to model capabilities at runtime. If the model does not support xhigh reasoning, the system falls back to the highest supported level.

The current mode is managed by src/core/modes.ts:

export type OrchestratorMode = "admin" | "plan" | "build" | "review";
let currentMode: OrchestratorMode = "build";
export function getCurrentMode(): OrchestratorMode;
export function setCurrentMode(mode: OrchestratorMode): void;
export function getModeDefinition(mode?: OrchestratorMode): ModeDefinition;

The default mode at boot is build.

Presets are named boot configurations stored in ~/.pancode/panpresets.yaml. Each preset bundles model selection, reasoning level, and safety mode into a single named configuration.

interface Preset {
name: string;
description: string;
model: string; // Orchestrator model
workerModel: string | null; // Worker model (null = use orchestrator model)
scoutModel: string | null; // Scout model for shadow explore
reasoning: PanCodeReasoningPreference;
safety: SafetyLevel;
}

PanCode seeds panpresets.yaml on first run with four default presets:

local:
description: Local inference via homelab engines
model: <from PANCODE_MODEL env var>
workerModel: <from PANCODE_WORKER_MODEL>
scoutModel: <from PANCODE_SCOUT_MODEL>
reasoning: medium
safety: auto-edit
openai:
description: OpenAI (edit model IDs to match your subscription)
reasoning: medium
safety: auto-edit
openai-max:
description: OpenAI high reasoning (edit model IDs to match your subscription)
reasoning: high
safety: full-auto
hybrid:
description: Local orchestrator with remote workers (edit worker model)
model: <from PANCODE_MODEL>
scoutModel: <from PANCODE_SCOUT_MODEL>
reasoning: medium
safety: auto-edit

PanCode never overwrites this file after creation. Users edit it directly to add or modify presets.

At boot:

Terminal window
pancode --preset local

During a session:

/preset local

Edit ~/.pancode/panpresets.yaml to add custom presets:

fast-local:
description: Fast local models for quick iterations
model: qwen2.5-coder:7b
workerModel: qwen2.5-coder:3b
scoutModel: qwen2.5-coder:1.5b
reasoning: low
safety: full-auto
cloud-review:
description: Cloud models for thorough code review
model: claude-sonnet-4-20250514
reasoning: high
safety: suggest

The presets file lives at ~/.pancode/panpresets.yaml. The path is derived from the PanCode home directory. PanCode seeds the file on first run and never modifies it afterward.

PanCode resolves configuration from multiple sources, highest priority first:

  1. Runtime overrides: /settings command during a session
  2. Environment variables: PANCODE_* prefix
  3. Preset overrides: --preset flag at boot
  4. Project config: <project>/.pancode/settings.json
  5. Global config: ~/.pancode/settings.json
  6. Defaults: src/core/defaults.ts
VariablePurposeDefault
PANCODE_MODELOrchestrator model(none)
PANCODE_WORKER_MODELDefault worker model(none)
PANCODE_SCOUT_MODELScout/shadow model(none)
PANCODE_SAFETYSafety levelauto-edit
PANCODE_REASONINGReasoning preferencemedium
PANCODE_THEMETUI themedark
PANCODE_TIMEOUT_MSTool execution timeout120000
PANCODE_PROJECTProject working directory.
PANCODE_PROFILEBoot profilestandard
PANCODE_INTELLIGENCEIntelligence domain(disabled)

Projects can override global settings via <project>/.pancode/settings.json:

{
"theme": "light",
"safetyMode": "auto-edit",
"reasoningPreference": "high",
"preferredProvider": "ollama",
"preferredModel": "qwen2.5-coder:32b"
}

Mode and safety are independent axes. Mode controls tool visibility (structural). Safety controls action permission (policy). They compose multiplicatively:

ConfigurationEffect
Build + auto-editStandard development. Full tool access, standard permissions.
Build + suggestTools visible but most actions blocked. Useful for dry-run exploration.
Plan + full-autoShadow explore works, but dispatch is structurally invisible.
Review + auto-editDispatch enabled for review workers. No file mutations.
Admin + full-autoMaximum system access. Dispatch enabled, all config accessible.

The /modes command shows the current mode and available modes. The /safety command shows the current safety level.

During a session, configuration can be changed through:

  • Keyboard shortcuts: Shift+Tab (mode), Ctrl+Y (safety), Alt+A (Admin)
  • Slash commands: /preset, /settings, /safety, /modes, /reasoning
  • Config tools: pan_read_config and pan_apply_config (LLM-callable)

Changes take effect immediately. Mode changes update the active tool set. Safety changes update the policy matrix. Preset changes update model, reasoning, and safety simultaneously.