Pi reads JSON settings and applies them with clear precedence rules.
Pi loads settings from (up to) two files:
| Location | Scope |
|---|---|
~/.pi/agent/settings.json |
Global (all projects) |
.pi/settings.json |
Project (current directory) |
You can override the path entirely with PI_CONFIG_PATH (see below).
Run pi config to print the effective paths and precedence.
- CLI flags
- Environment variables
- Project settings (
.pi/settings.json) - Global settings (
~/.pi/agent/settings.json) - Built-in defaults
If PI_CONFIG_PATH is set, Pi loads only that file and skips the global/project merge.
Project settings override global settings on a per-field basis.
Important detail: nested objects like compaction, retry, images, terminal, branch_summary,
and thinking_budgets are treated as single fields. If .pi/settings.json contains a
compaction object, it replaces the entire global compaction object.
Within a single file, missing nested keys fall back to built-in defaults when accessed (see
src/config.rs).
Example:
// ~/.pi/agent/settings.json (global)
{ "compaction": { "enabled": false, "reserve_tokens": 16384 } }// .pi/settings.json (project)
{ "compaction": { "reserve_tokens": 8192 } }Resulting behavior:
compaction.reserve_tokensbecomes8192compaction.enableddoes not inheritfalsefrom global; it falls back to its built-in default
theme(string): Theme name to apply. Defaults todarkif unset.hide_thinking_block(bool): Hide thinking blocks in interactive output. Defaultfalse.show_hardware_cursor(bool): Show terminal hardware cursor. DefaultfalseunlessPI_HARDWARE_CURSOR=1.
default_provider(string)default_model(string)default_thinking_level(string)enabled_models(array of model patterns)
Example:
{
"default_provider": "anthropic",
"default_model": "claude-sonnet-4-20250514",
"default_thinking_level": "medium",
"enabled_models": ["claude-*", "gpt-*"]
}steering_mode(string):one-at-a-timeorall(defaultone-at-a-time).follow_up_mode(string):one-at-a-timeorall(defaultone-at-a-time).
Legacy aliases: steeringMode, followUpMode.
{
"steering_mode": "one-at-a-time",
"follow_up_mode": "one-at-a-time"
}double_escape_action(string):treeorfork(defaulttree). Alias:doubleEscapeAction.editor_padding_x(u32): Horizontal editor padding (clamped to 0–3). Default0.autocomplete_max_visible(u32): Max autocomplete rows (clamped 3–20). Default5.session_picker_input(u32): Non-interactive session picker selection (1-based). Alias:sessionPickerInput.quiet_startup(bool): Suppress the startup header.collapse_changelog(bool): Condense “What’s New” output when present.
Accessor defaults:
compaction.enabled:truecompaction.reserve_tokens:16384compaction.keep_recent_tokens:20000
{
"compaction": {
"enabled": true,
"reserve_tokens": 16384,
"keep_recent_tokens": 20000
}
}branch_summary.reserve_tokens(u32): Defaults tocompaction.reserve_tokens.
Accessor defaults:
retry.enabled:trueretry.max_retries:3retry.base_delay_ms:2000retry.max_delay_ms:60000
{
"retry": {
"enabled": true,
"max_retries": 3,
"base_delay_ms": 2000,
"max_delay_ms": 60000
}
}shell_path(string): Shell binary path. Default/bin/bash.shell_command_prefix(string): Defaultset -e.gh_path(string): Override path toghfor/share. Alias:ghPath.
{
"shell_path": "/bin/bash",
"shell_command_prefix": "set -e"
}images.auto_resize(bool): Defaulttrue.images.block_images(bool): Defaultfalse.
{
"images": {
"auto_resize": true,
"block_images": false
}
}terminal.show_images(bool): Defaulttrue. Whenfalse, Pi hides image blocks in terminal tool output (images are still stored in sessions/exports).terminal.clear_on_shrink(bool): Defaultfalse. Whentrue, Pi purges scrollback on terminal shrink to avoid stale rows reappearing after resize.
thinking_budgets.minimal: default1024thinking_budgets.low: default2048thinking_budgets.medium: default8192thinking_budgets.high: default16384thinking_budgets.xhigh: default32768
packages(array): package sources (string or{ source, local, kind }).extensions,skills,prompts,themes(arrays): resource filters.enable_skill_commands(bool): defaulttrue.
These settings are defined in src/config.rs but are not fully wired into behavior yet:
quiet_startup,collapse_changelog→ tracked bybd-35y0andbd-217r.session_picker_input→ tracked bybd-14cc.
src/config.rs is the authoritative list of supported fields and defaulting behavior.