PiG Documentation

Guides and references for configuring, using, and extending PiG.

Settings

PiG reads settings from ~/.pig/agent/settings.json. The file is optional. Every key is optional, and a key you leave out keeps its default.

Set PIG_HOME to move the whole configuration root. Set PIG_CODING_AGENT_DIR to move only this directory.

{
  "defaultModel": "claude-sonnet-4",
  "theme": "dark",
  "compaction": { "enabled": true }
}

Use /settings to change a setting from inside a session. PiG writes the file for you and applies the change without a restart.

Where PiG reads settings

PiG merges two files. A key set in the project file overrides the same key in the global file. defaultProjectTrust is the exception: PiG reads it from the global file only.

Scope
Path
global~/.pig/agent/settings.json
project<project>/.pig/settings.json

PiG reads the project file only after you trust the project. An untrusted project contributes nothing, so cloning a repository cannot change your shell, your model or your packages before you agree to it. See Security.

An empty default column means PiG has no value for the key until you set one, or the value depends on what it detects.

Models and providers

Key
Type
Default
Meaning
defaultProviderstringProvider used when none is chosen.
defaultModelstringModel used when none is chosen.
defaultThinkingLevelstringThinking level applied to a new session.
modelThinkingLevelsobjectThinking level for a new session per model, keyed by provider/modelId. It overrides defaultThinkingLevel.
enabledModelsstring[]allModels offered in the model selector.
thinkingBudgetsobjectToken budget per thinking level: minimal, low, medium, high.
transportstringautoTransport for providers that support more than one: auto, sse, websocket, or websocket-cached.
retryobjectsee meaningRetry policy: enabled (default true), maxRetries (default 3), baseDelayMs (default 2000), maxAgentDelayMs (the cap on each retry delay, default 60000), and a per-provider override. An explicit 0 is kept.
httpIdleTimeoutMsnumber300000Idle timeout for provider requests, in milliseconds. 0 or "disabled" turns it off.
cacheWarmingstringstreamingoff, streaming, or idle. Keeps the provider's prompt cache warm with periodic requests. Global setting only: PiG ignores it in a project file. See cache warming.

Cache warming

Cache warming is on by default, as in Pi. Each refresh is a real provider request that you pay for. PiG replays the last request with a one-token output limit shortly before the prompt cache expires, so the next request reads the cache instead of writing it again at full price.

  • off: PiG never sends refreshes.
  • streaming: only while the agent is running. This is the default.
  • idle: while the agent runs, and between runs for up to 30 minutes after the last request.

A refresh is sent only when the model declares a prompt cache lifetime and PiG expects it to save at least $0.05 in avoided cache-miss cost. Warming stops when the conversation or model changes, after one hour (30 minutes when idle), and when the session ends. Refresh usage counts toward the session's token and cost totals, but it never enters the model's context. /session shows the mode, the next decision, and its estimated cost.

To turn cache warming off, choose off for Cache warming in /settings, or set it in ~/.pig/agent/settings.json:

{
  "cacheWarming": "off"
}

Session behavior

Key
Type
Default
Meaning
compactionobjectsee meaningAutomatic compaction: enabled (default true), reserveTokens (default 16384), keepRecentTokens (default 20000), and modelOverrides (per-model reserveTokens and keepRecentTokens keyed by exact provider/modelId). See compaction.
branchSummaryobjectsee meaningSummary written when you leave a branch: reserveTokens (default 16384) and skipPrompt (default false, skip the prompt and write no summary).
steeringModestringone-at-a-timeHow queued steering messages are dispatched.
followUpModestringone-at-a-timeHow queued follow-up messages are dispatched.
sessionDirstringDirectory that holds session files.
defaultProjectTruststringaskTrust decision applied to a project that has none: ask, always, or never. PiG reads this key from the global file only.

Interface

Key
Type
Default
Meaning
themestringActive theme name.
tuiModestringregularregular or fullscreen.
fullscreenScrollbarstringautoScrollbar in fullscreen mode: auto, always, or hidden. No effect in regular mode.
fullscreenExitOutputstringtranscripttranscript prints the final transcript when fullscreen exits. resume-hint restores the previous screen and prints only the resume hint.
fullscreenCopyOnSelectbooleantrueCopy selected fullscreen text automatically. When disabled, ctrl+x copies the active selection. No effect in regular mode.
hideThinkingBlockbooleanfalseHide thinking blocks in the transcript.
doubleEscapeActionstringtreeAction bound to pressing escape twice.
treeFilterModestringdefaultFilter /tree opens with.
editorPaddingXnumber0Horizontal padding inside the editor.
outputPadnumber1Horizontal padding for messages and thinking blocks: 0 or 1.
autocompleteMaxVisiblenumber5Rows shown in the autocomplete list.
showHardwareCursorbooleanfalseShow the terminal's own cursor.
markdownobjectMarkdown rendering: codeBlockIndent, mermaid.
quietStartupbooleanfalseSuppress the startup banner.
collapseChangelogbooleanfalseShow a condensed changelog.
lastChangelogVersionstringLast changelog version shown. PiG writes this.

Images and terminal

Key
Type
Default
Meaning
terminalobjectsee meaningTerminal image, width, shrink-repaint, and progress settings described below.
imagesobjectsee meaningImage resize and transcript-blocking settings described below.
showImagesbooleantrueOlder flat form of terminal.showImages.
imageWidthCellsnumber60Older flat form of terminal.imageWidthCells.
clearOnShrinkbooleanfalseOlder flat form of terminal.clearOnShrink.
imageAutoResizebooleantrueOlder flat form of images.autoResize.
blockImagesbooleanfalseOlder flat form of images.blockImages.
terminal.showImagesbooleantrueRender images when the terminal accepts them.
terminal.imageWidthCellsnumber60Width of a rendered image, in terminal cells.
terminal.clearOnShrinkbooleanfalseRepaint the screen when content shrinks.
terminal.showTerminalProgressbooleanfalseShow OSC 9;4 progress in the terminal tab.
images.autoResizebooleantrueResize an image to fit the width.
images.blockImagesbooleanfalseHide images in the transcript. Pi also removes images from model requests. PiG does not yet: it still sends them to the provider.

PiG also reads the older flat keys showImages, imageWidthCells, clearOnShrink, imageAutoResize, and blockImages. A nested key wins over the flat key with the same meaning.

Resources

Key
Type
Default
Meaning
packagesobject[]Packages to load. See packages.
extensionsstring[]Extension paths to load. See extensions.
skillsstring[]Skill paths to load. See skills.
promptsstring[]Prompt paths to load.
themesstring[]Theme paths to load.
enableSkillCommandsbooleantrueOffer skills as slash commands.

Terminal capability overrides

Key
Type
Default
Meaning
terminal.hyperlinksboolean \| "auto""auto"Override OSC 8 hyperlink detection.
terminal.images"kitty" \| "iterm2" \| "auto" \| false"auto"Override inline-image protocol detection. false turns images off.
terminal.trueColorboolean \| "auto""auto"Override true-color detection.

A setting wins over the matching PI_HYPERLINKS, PI_IMAGE_PROTOCOL or PI_TRUE_COLOR variable, and the variable wins over detection. "auto" and any other value leave detection in charge. Without true color, PiG draws the theme in the 256-color palette, as Pi does. See terminal setup.

Shell and tools

Key
Type
Default
Meaning
shellPathstringShell used by the bash tool.
shellCommandPrefixstringPrefix applied to every shell command.
commandPrefixstringFormer name of shellCommandPrefix. PiG still reads it.
externalEditorstringEditor opened by app.editor.external.
npmCommandstring[]["npm"]Command and arguments used to run npm for package lookup and installation.

Tools

Key
Type
Default
Meaning
defaultToolsstring[]read, bash, edit, writeBuilt-in tools active at startup. An empty array turns off every built-in tool but keeps extension and SDK tools.

The built-in tools are read, bash, powershell, edit, write, grep, find, and ls. The CLI tool options override this setting for one run. See Tools.

Notices

Key
Type
Default
Meaning
warningsobjectsee meaningWarning toggles: anthropicExtraUsage (default true) warns when Anthropic subscription auth may use paid extra usage.
showCacheMissNoticesbooleanReport a prompt cache miss and each successful cache-warming refresh.
enableInstallTelemetrybooleantrueGate for the anonymous install/update ping and the pig-branded OpenRouter, NVIDIA, and Cloudflare attribution headers. When on, PiG sends one HTTPS GET carrying only your PiG version (?version=<version>) and PiG's User-Agent header to https://pi-in-go.dev/api/report-install, after a fresh install and after an update that has new changelog entries, and at no other time. The site stores one data point (the version and arrival time) per call and never logs your IP address or User-Agent. Set to false, or set PI_TELEMETRY=0, to opt out; PI_OFFLINE=1 also stops it. Override with PI_TELEMETRY.
enableAnalyticsbooleanfalseOpt in to analytics data sharing. PiG stores the choice; nothing sends data.
trackingIdstringAnalytics tracking identifier. PiG writes this on the first opt-in and keeps it when you toggle enableAnalytics. Bug reports omit it.
Adapted from upstream Pi documentation · Upstream documentation ↗ · MIT License