Skip to main content
Pi uses JSON settings files with project settings overriding global settings. Edit directly or use /settings for common options.

Settings Files

Location: ~/.pi/agent/settings.jsonApplies to all projects and sessions.

Merging Behavior

Project settings override global settings. Nested objects are merged:

Model & Thinking

string
Default provider (e.g., "anthropic", "openai")
string
Default model ID
string
Default thinking level: "off", "minimal", "low", "medium", "high", "xhigh"
boolean
default:"false"
Hide thinking blocks in output
object
Custom token budgets per thinking level

UI & Display

string
default:"dark"
Theme name ("dark", "light", or custom theme)
boolean
default:"false"
Hide startup header
boolean
default:"false"
Show condensed changelog after updates
string
default:"tree"
Action for double-escape: "tree", "fork", or "none"
number
default:"0"
Horizontal padding for input editor (0-3)
number
default:"5"
Max visible items in autocomplete dropdown (3-20)
boolean
default:"false"
Show terminal hardware cursor

Compaction

boolean
default:"true"
Enable automatic compaction
number
default:"16384"
Tokens reserved for LLM response
number
default:"20000"
Recent tokens to keep (not summarized)
Example:

Branch Summary

number
default:"16384"
Tokens reserved for branch summarization when switching branches via /tree

Retry

boolean
default:"true"
Enable automatic retry on transient errors
number
default:"3"
Maximum retry attempts
number
default:"2000"
Base delay for exponential backoff (2s, 4s, 8s)
number
default:"60000"
Max server-requested delay before failing (60s)When a provider requests a retry delay longer than this (e.g., “quota resets in 5 hours”), the request fails immediately with an informative error. Set to 0 to disable the cap.
Example:

Message Delivery

string
default:"one-at-a-time"
How steering messages are sent: "all" or "one-at-a-time"
string
default:"one-at-a-time"
How follow-up messages are sent: "all" or "one-at-a-time"
string
default:"sse"
Preferred transport: "sse", "websocket", or "auto"For providers that support multiple transports.

Terminal & Images

boolean
default:"true"
Show images in terminal (if supported)
boolean
default:"false"
Clear empty rows when content shrinks (can cause flicker)
boolean
default:"true"
Resize images to 2000x2000 max before sending
boolean
default:"false"
Block all images from being sent to LLM

Shell

string
Custom shell path (e.g., for Cygwin on Windows)
string
Prefix for every bash command (e.g., "shopt -s expand_aliases")Useful for loading shell configuration:

Model Cycling

string[]
Model patterns for Ctrl+P cycling (same format as --models CLI flag)
Use wildcards to match multiple models. Ctrl+P cycles through matched models.

Markdown

string
default:" "
Indentation for code blocks (default: two spaces)

Resources

These settings define where to load extensions, skills, prompts, and themes.

Path Resolution

  • Paths in ~/.pi/agent/settings.json resolve relative to ~/.pi/agent
  • Paths in .pi/settings.json resolve relative to .pi
  • Absolute paths and ~ are supported

Packages

array
default:"[]"
npm/git packages to load resources fromString form (loads all resources):
Object form (filters resources):

Extensions

string[]
default:"[]"
Local extension file paths or directories

Skills

string[]
default:"[]"
Local skill file paths or directories
boolean
default:"true"
Register skills as /skill:name commands

Prompts

string[]
default:"[]"
Local prompt template paths or directories

Themes

string[]
default:"[]"
Local theme file paths or directories

Glob Patterns

Arrays support glob patterns and exclusions:
  • pattern - Glob match
  • !pattern - Exclude matches
  • +path - Force-include exact path
  • -path - Force-exclude exact path

Complete Example

The $schema field enables editor auto-completion and validation.

Interactive Settings

Use /settings to modify common options in interactive mode:
This opens a TUI settings menu where you can:
  • Change thinking level
  • Switch themes
  • Configure message delivery
  • Set transport preference
  • Toggle compaction
  • And more…
Changes are saved to the appropriate settings file based on scope.

Keybindings

Customize keyboard shortcuts via ~/.pi/agent/keybindings.json:
Available actions: App actions:
  • interrupt, clear, exit, suspend
  • cycleThinkingLevel
  • cycleModelForward, cycleModelBackward, selectModel
  • expandTools, toggleThinking
  • externalEditor
  • followUp, dequeue
  • pasteImage
  • newSession, tree, fork, resume
Editor actions:
  • Standard text editing actions (see packages/tui documentation)
See all available actions in packages/coding-agent/src/core/keybindings.ts.

Environment Variables

Example:

Next Steps

Extensions

Build TypeScript extensions

Skills

Create Agent Skills

Prompt Templates

Make reusable prompts

Themes

Customize colors

Pi Packages

Share via npm/git

CLI Reference

All CLI flags