PanCode

Environment essentials

Read the full guide
On this pageUse settings for ordinary preferences Locate or separate installation state How each directory is resolved Credentials and terminal behavior Collect a trace

Environment essentials

Use directory overrides and existing provider credentials when needed.

Use settings for ordinary preferences

Choose models, permissions, output style, and context behavior in Settings. Environment variables are useful when a script, container, or separate installation needs a different directory or an existing credential.

Locate or separate installation state

Shell

pancode paths --json
Variable Purpose
PANCODE_HOME Set a shared root for PanCode's directories
PANCODE_CONFIG_DIR Override the configuration directory
PANCODE_DATA_DIR Override the data directory
PANCODE_STATE_DIR Override the state directory
PANCODE_CACHE_DIR Override the cache directory
PANCODE_BIN_DIR Choose where the installer puts the pancode launcher (default ~/.local/bin)
PANCODE_RELEASE_MIRROR Read releases and the channel files from a mirror, for the installer and the update check

Individual directory overrides take precedence over the shared root. Separate state is useful for an isolated evaluation or a dedicated automation environment.

How each directory is resolved

PanCode resolves the config, data, state, and cache directories one at a time. The first match wins:

Order Source Example
1 The per-role variable PANCODE_CONFIG_DIR
2 The shared root PANCODE_HOME
3 Platform defaults XDG_CONFIG_HOME on Linux, APPDATA or LOCALAPPDATA on Windows

So you can keep everything under one root and still move only the cache elsewhere:

Shell

export PANCODE_HOME="$HOME/pancode-eval"
export PANCODE_CACHE_DIR=/scratch/pancode-cache
pancode paths --json

pancode paths creates nothing, so it is a safe way to confirm a layout before the first run. Scripts should parse its --json output rather than repeat these rules. With PANCODE_HOME set, the installer root defaults to $PANCODE_HOME/install; PANCODE_INSTALL_DIR overrides it.

An isolated root still reads other coding agents' user skills and prompts from your real home. Set PANCODE_INTEROP_HOME=none to read none of them, or a path to read another home.

Credentials and terminal behavior

Supported providers can read their conventional credential variables, such as OPENAI_API_KEY, ANTHROPIC_API_KEY, or OPENROUTER_API_KEY, when that provider is selected. Prefer PanCode's managed authentication flow for normal interactive setup, and keep secrets out of project settings and transcripts.

Variable Used for
OPENAI_API_KEY OpenAI
ANTHROPIC_API_KEY Anthropic
OPENROUTER_API_KEY OpenRouter
GEMINI_API_KEY or GOOGLE_API_KEY Gemini
AWS_* Credentials for an existing Amazon Bedrock connection
OLLAMA_API_KEY An Ollama connection at https://ollama.com

The managed alternative is pancode auth, with auth login and auth status per connection.

HTTPS_PROXY, HTTP_PROXY, and their lowercase forms apply to model requests, discovery probes, sign-in refreshes, and web fetches. localhost and 127.0.0.1 always go direct; name any other local model server in NO_PROXY. pancode doctor shows the proxy in effect.

VISUAL and EDITOR select an external editor, with VISUAL taking precedence. Terminal variables such as TERM and COLORTERM describe the environment; they do not grant tool permissions.

Collect a trace

Debug toggles are off by default and turn on with 1. PANCODE_TRACE_BOOT=1 turns on a boot-phase timing trace for a slow startup. The render trace takes a file path instead, and records timing but no conversation text:

Shell

PANCODE_RENDER_TRACE="$PWD/render.jsonl" pancode

Setting it to 1 writes a file named 1 in the working directory.

The full guide lists provider-specific inputs, behavior overrides, and diagnostic switches. Use it when preparing automation or collecting a trace; most installations need no environment variables.