Changelog
[Unreleased]
[0.55.3] - 2026-02-27
Fixed
- Changed the default image paste keybinding on Windows to
alt+vto avoidctrl+vconflicts with terminal paste behavior (#1682 by @mrexodia).
[0.55.2] - 2026-02-27
New Features
- Extensions can dynamically remove custom providers via
pi.unregisterProvider(name), restoring any built-in models that were overridden, without requiring/reload(docs). pi.registerProvider()now takes effect immediately when called outside the initial extension load phase (e.g. from a command handler), removing the need for/reloadafter late registrations.
Added
pi.unregisterProvider(name)removes a dynamically registered provider and its models from the registry without requiring/reload. Built-in models that were overridden by the provider are restored (#1669 by @aliou).
Fixed
pi.registerProvider()now takes effect immediately when called after the initial extension load phase (e.g. from a command handler). Previously the registration sat in a pending queue that was never flushed until the next/reload(#1669 by @aliou).- Fixed duplicate session headers when forking from a point before any assistant message.
createBranchedSessionnow defers file creation to_persist()when the branched path has no assistant message, matching thenewSession()contract (#1672 by @w-winter). - Fixed SIGINT being delivered to pi while the process is suspended (e.g. via
ctrl+z), which could corrupt terminal state on resume (#1668 by @aliou). - Fixed Z.ai thinking control using wrong parameter name, causing thinking to always be enabled and wasting tokens/latency (#1674 by @okuyam2y)
- Fixed
redacted_thinkingblocks being silently dropped during Anthropic streaming, and related issues with interleaved-thinking beta headers and temperature being sent alongside extended thinking (#1665 by @tctev) - Fixed
(external, cli)user-agent flag causing 401 errors on Anthropic setup-token endpoint (#1677 by @LazerLance777) - Fixed crash when OpenAI-compatible provider returns a chunk with no
choicesarray (#1671)
[0.55.1] - 2026-02-26
New Features
- Added offline startup mode via
--offline(orPI_OFFLINE) to disable startup network operations, with startup network timeouts to avoid hangs in restricted or offline environments. - Added
gemini-3.1-pro-previewmodel support to thegoogle-gemini-cliprovider (#1599 by @audichuang).
Fixed
- Fixed offline startup hangs by adding offline startup behavior and network timeouts during managed tool setup (#1631 by @mcollina)
- Fixed Windows VT input initialization in ESM by loading koffi via createRequire, avoiding runtime and bundling issues in end-user environments (#1627 by @kaste)
- Fixed managed
fd/rgbootstrap on Windows in Git Bash by usingextract-zipfor.ziparchives, searching extracted layouts more robustly, and isolating extraction temp directories to avoid concurrent download races (#1348) - Fixed extension loading on Windows when resolving
@sinclair/typeboxaliases so subpath imports like@sinclair/typebox/compilerresolve correctly. - Fixed adaptive thinking for Claude Sonnet 4.6 in Anthropic and Bedrock providers, and clamped unsupported
xhigheffort values to supported levels (#1548 by @tctev) - Fixed Vertex ADC credential detection race by avoiding caching a false negative during async import initialization (#1550 by @jeremiahgaylord-web)
- Fixed subagent extension example to resolve user agents from the configured agent directory instead of hardcoded paths (#1559 by @tianshuwang)
[0.55.0] - 2026-02-24
Breaking Changes
- Resource precedence for extensions, skills, prompts, themes, and slash-command name collisions is now project-first (
cwd/.pi) before user-global (~/.pi/agent). If you relied on global resources overriding project resources with the same names, rename or reorder your resources. - Extension registration conflicts no longer unload the entire later extension. All extensions stay loaded, and conflicting command/tool/flag names are resolved by first registration in load order.
[0.54.2] - 2026-02-23
Fixed
- Fixed
.pifolder being created unnecessarily when only reading settings. The folder is now only created when writing project-specific settings. - Fixed extension-driven runtime theme changes to persist in settings so
/settingsreflects the activecurrentThemeafterctx.ui.setTheme(...)(#1483 by @ferologics) - Fixed interactive mode freezes during large streaming
writetool calls by using incremental syntax highlighting while partial arguments stream, with a final full re-highlight after tool-call arguments complete.
[0.54.1] - 2026-02-22
Fixed
- Externalized koffi from bun binary builds, reducing archive sizes by ~15MB per platform (e.g. darwin-arm64: 43MB -> 28MB). Koffi's Windows-only
.nodefile is now shipped alongside the Windows binary only.
[0.54.0] - 2026-02-19
Added
- Added default skill auto-discovery for
.agents/skillslocations. Pi now discovers project skills from.agents/skillsincwdand ancestor directories (up to git repo root, or filesystem root when not in a repo), and global skills from~/.agents/skills, in addition to existing.piskill paths.
[0.53.1] - 2026-02-19
Changed
- Added Gemini 3.1 model catalog entries for all built-in providers that currently expose it:
google,google-vertex,opencode,openrouter, andvercel-ai-gateway. - Added Claude Opus 4.6 Thinking to the
google-antigravitymodel catalog.
[0.53.0] - 2026-02-17
Breaking Changes
SettingsManagerpersistence semantics changed for SDK consumers. Setters now update in-memory state immediately and queue disk writes. Code that requires durable on-disk settings must callawait settingsManager.flush().AuthStorageconstructor is no longer public. Use static factories (AuthStorage.create(...),AuthStorage.fromStorage(...),AuthStorage.inMemory(...)). This breaks code that usednew AuthStorage(...)directly.
Added
- Added
SettingsManager.drainErrors()for caller-controlled settings I/O error handling without manager-side console output. - Added auth storage backends (
FileAuthStorageBackend,InMemoryAuthStorageBackend) andAuthStorage.fromStorage(...)for storage-first auth persistence wiring. - Added Anthropic
claude-sonnet-4-6model fallback entry to generated model definitions.
Changed
SettingsManagernow uses scoped storage abstraction with per-scope locked read/merge/write persistence for global and project settings.
Fixed
- Fixed project settings persistence to preserve unrelated external edits via merge-on-write, while still applying in-memory changes for modified keys.
- Fixed auth credential persistence to preserve unrelated external edits to
auth.jsonvia locked read/merge/write updates. - Fixed auth load/persist error surfacing by buffering errors and exposing them via
AuthStorage.drainErrors().
[0.52.12] - 2026-02-13
Added
- Added
transportsetting ("sse","websocket","auto") to/settingsandsettings.jsonfor providers that support multiple transports (currentlyopenai-codexvia OpenAI Codex Responses).
Changed
- Interactive mode now applies transport changes immediately to the active agent session.
- Settings migration now maps legacy
websockets: booleanto the newtransportsetting.
[0.52.11] - 2026-02-13
Added
- Added MiniMax M2.5 model entries for
minimax,minimax-cn,openrouter, andvercel-ai-gatewayproviders, plusminimax-m2.5-freeforopencode.
[0.52.10] - 2026-02-12
New Features
- Extension terminal input interception via
terminal_input, allowing extensions to consume or transform raw input before normal TUI handling. See docs/extensions.md. - Expanded CLI model selection:
--modelnow supportsprovider/id, fuzzy matching, and:<thinking>suffixes. See README.md and docs/models.md. - Safer package source handling with stricter git source parsing and improved local path normalization. See docs/packages.md.
- New built-in model definition
gpt-5.3-codex-sparkfor OpenAI and OpenAI Codex providers. - Improved OpenAI stream robustness for malformed trailing tool-call JSON in partial chunks.
- Added built-in GLM-5 model support via z.ai and OpenRouter provider catalogs.
Breaking Changes
ContextUsage.tokensandContextUsage.percentare nownumber | null. After compaction, context token count is unknown until the next LLM response, so these fields returnnull. Extensions that readContextUsagemust handle thenullcase. RemovedusageTokens,trailingTokens, andlastUsageIndexfields fromContextUsage(implementation details that should not have been public) (#1382 by @ferologics)- Git source parsing is now strict without
git:prefix: only protocol URLs are treated as git (https://,http://,ssh://,git://). Shorthand sources likegithub.com/org/repoandgit@github.com:org/reponow require thegit:prefix. (#1426)
Added
- Added extension event forwarding for message and tool execution lifecycles (
message_start,message_update,message_end,tool_execution_start,tool_execution_update,tool_execution_end) (#1375 by @sumeet) - Added
terminal_inputextension event to intercept, consume, or transform raw terminal input before normal TUI handling. - Added
gpt-5.3-codex-sparkmodel definition for OpenAI and OpenAI Codex providers (research preview).
Changed
- Routed GitHub Copilot Claude 4.x models through Anthropic Messages API, with updated Copilot header handling for Claude model requests.
Fixed
- Fixed context usage percentage in footer showing stale pre-compaction values. After compaction the footer now shows
?/200kuntil the next LLM response provides accurate usage (#1382 by @ferologics) - Fixed
_checkCompaction()using the first compaction entry instead of the latest, which could cause incorrect overflow detection with multiple compactions (#1382 by @ferologics) --modelnow works without--provider, supportsprovider/idsyntax, fuzzy matching, and:<thinking>suffix (e.g.,--model sonnet:high,--model openai/gpt-4o) (#1350 by @mitsuhiko)- Fixed local package path normalization for extension sources while tightening git source parsing rules (#1426)
- Fixed extension terminal input listeners not being cleared during session resets, which could leave stale handlers active.
- Fixed Termux bootstrap package name for
fdinstallation (#1433) - Fixed
@file autocomplete fuzzy matching to prioritize path-prefix and segment matches for nested paths (#1423) - Fixed OpenAI streaming tool-call parsing to tolerate malformed trailing JSON in partial chunks (#1424)
[0.52.9] - 2026-02-08
New Features
- Extensions can trigger a full runtime reload via
ctx.reload(), useful for hot-reloading configuration or restarting the agent. See docs/extensions.md and the (#1371) - Short CLI disable aliases:
-ne(--no-extensions),-ns(--no-skills), and-np(--no-prompt-templates) for faster interactive usage and scripting. /exportHTML now includes collapsible tool input schemas (parameter names, types, and descriptions), improving session review and sharing workflows (#1416 by @marchellodev).pi.getAllTools()now exposes tool parameters in addition to name and description, enabling richer extension integrations (#1416 by @marchellodev).
Added
- Added
ctx.reload()to the extension API for programmatic runtime reload (#1371) - Added short aliases for disable flags:
-nefor--no-extensions,-nsfor--no-skills,-npfor--no-prompt-templates /exportHTML now includes tool input schema (parameter names, types, descriptions) in a collapsible section under each tool (#1416 by @marchellodev)pi.getAllTools()now returns tool parameters in addition to name and description (#1416 by @marchellodev)
Fixed
- Fixed extension source parsing so dot-prefixed local paths (for example
.pi/extensions/foo.ts) are treated as local paths instead of git URLs - Fixed fd/rg download failing on Windows due to
unzipnot being available; now usestarfor both.tar.gzand.zipextraction, with proper error reporting (#1348) - Fixed RPC mode documentation incorrectly stating
ctx.hasUIisfalse; it istruebecause dialog and fire-and-forget UI methods work via the RPC sub-protocol. Also documented missing unsupported/degraded methods (pasteToEditor,getAllThemes,getTheme,setTheme) (#1411 by @aliou) - Fixed
rgnot available in bash tool by downloading it at startup alongsidefd(#1348) - Fixed
custom-compactionexample to useModelRegistry(#1387) - Google providers now support full JSON Schema in tool declarations (anyOf, oneOf, const, etc.) (#1398 by @jarib)
- Reverted incorrect Antigravity model change:
claude-opus-4-6-thinkingback toclaude-opus-4-5-thinking(model does not exist on Antigravity endpoint) - Updated the Antigravity system instruction to a more compact version for Google Gemini CLI compatibility
- Corrected opencode context windows for Claude Sonnet 4 and 4.5 (#1383)
- Fixed subagent example unknown-agent errors to include available agent names (#1414 by @dnouri)
[0.52.8] - 2026-02-07
New Features
- Emacs-style kill ring (
ctrl+k/ctrl+y/alt+y) and undo (ctrl+z) in the editor input (#1373 by @Perlence) - OpenRouter
automodel alias (openrouter:auto) for automatic model routing (#1361 by @yogasanas) - Extensions can programmatically paste content into the editor via
pasteToEditorin the extension UI context. See docs/extensions.md (#1351 by @kaofelix) pi <package> --helpand invalid subcommands now show helpful output instead of failing silently (#1347 by @ferologics)
Added
- Added
pasteToEditorto extension UI context for programmatic editor paste (#1351 by @kaofelix) - Added package subcommand help and friendly error messages for invalid commands (#1347 by @ferologics)
- Added OpenRouter
automodel alias for automatic model routing (#1361 by @yogasanas) - Added kill ring (ctrl+k/ctrl+y/alt+y) and undo (ctrl+z) support to the editor input (#1373 by @Perlence)
Changed
- Replaced Claude Opus 4.5 with Opus 4.6 as default model (#1345 by @calvin-hpnet)
Fixed
- Fixed temporary git package caches (
-e <git-url>) to refresh on cache hits for unpinned sources, including detached/no-upstream checkouts - Fixed aborting retries when an extension customizes the editor (#1364 by @Perlence)
- Fixed autocomplete not propagating to custom editors created by extensions (#1372 by @Perlence)
- Fixed extension shutdown to use clean TUI shutdown path, preventing orphaned processes
[0.52.7] - 2026-02-06
New Features
- Per-model overrides in
models.jsonviamodelOverrides, allowing customization of built-in provider models without replacing provider model lists. See docs/models.md#per-model-overrides. models.jsonprovidermodelsnow merge with built-in models byid, so custom models can be added or replace matching built-ins without full provider replacement. See docs/models.md#overriding-built-in-providers.- Bedrock proxy support for unauthenticated endpoints via
AWS_BEDROCK_SKIP_AUTHandAWS_BEDROCK_FORCE_HTTP1. See docs/providers.md.
Breaking Changes
- Changed
models.jsonprovidermodelsbehavior from full replacement to merge-by-id with built-in models. Built-in models are now kept by default, and custom models upsert byid.
Added
- Added
modelOverridesinmodels.jsonto customize individual built-in models per provider without full provider replacement (#1332 by @charles-cooper) - Added
AWS_BEDROCK_SKIP_AUTHandAWS_BEDROCK_FORCE_HTTP1environment variables for connecting to unauthenticated Bedrock proxies (#1320 by @virtuald)
Fixed
- Fixed extra spacing between thinking-only assistant content and subsequent tool execution blocks when assistant messages contain no text
- Fixed queued steering/follow-up/custom messages remaining stuck after threshold auto-compaction by resuming the agent loop when Agent-level queues still contain pending messages (#1312 by @ferologics)
- Fixed
tool_resultextension handlers to chain result patches across handlers instead of last-handler-wins behavior (#1280) - Fixed compromised auth lock files being handled gracefully instead of crashing auth storage initialization (#1322)
- Fixed Bedrock adaptive thinking handling for Claude Opus 4.6 with interleaved thinking beta responses (#1323 by @markusylisiurunen)
- Fixed OpenAI Responses API requests to use
store: falseby default to avoid server-side history logging (#1308) - Fixed interactive mode startup by initializing autocomplete after resources are loaded (#1328)
- Fixed
modelOverridesmerge behavior for nested objects and documented usage details (#1062)
[0.52.6] - 2026-02-05
Breaking Changes
- Removed
/exitcommand handling. Use/quitto exit (#1303)
Fixed
- Fixed
/quitbeing shadowed by fuzzy slash command autocomplete matches from skills by adding/quitto built-in command autocomplete (#1303) - Fixed local package source parsing and settings normalization regression that misclassified relative paths as git URLs and prevented globally installed local packages from loading after restart (#1304)
[0.52.5] - 2026-02-05
Fixed
- Fixed thinking level capability detection so Anthropic Opus 4.6 models expose
xhighin selectors and cycling
[0.52.4] - 2026-02-05
Fixed
- Fixed extensions setting not respecting
package.jsonpi.extensionsmanifest when directory is specified directly (#1302 by @hjanuschka)
[0.52.3] - 2026-02-05
Fixed
- Fixed git package parsing fallback for unknown hosts so enterprise git sources like
git:github.tools.sap/org/repoare treated as git packages instead of local paths - Fixed git package
@refparsing for shorthand, HTTPS, and SSH source formats, including branch refs with slashes - Fixed Bedrock default model ID from
us.anthropic.claude-opus-4-6-v1:0tous.anthropic.claude-opus-4-6-v1 - Fixed Bedrock Opus 4.6 model metadata (IDs, cache pricing) and added missing EU profile
- Fixed Claude Opus 4.6 context window metadata to 200000 for Anthropic and OpenCode providers
[0.52.2] - 2026-02-05
Changed
- Updated default model for
anthropicprovider toclaude-opus-4-6 - Updated default model for
openai-codexprovider togpt-5.3-codex - Updated default model for
amazon-bedrockprovider tous.anthropic.claude-opus-4-6-v1:0 - Updated default model for
vercel-ai-gatewayprovider toanthropic/claude-opus-4-6 - Updated default model for
opencodeprovider toclaude-opus-4-6
[0.52.1] - 2026-02-05
[0.52.0] - 2026-02-05
New Features
- Claude Opus 4.6 model support.
- GPT-5.3 Codex model support (OpenAI Codex provider only).
- SSH URL support for git packages. See docs/packages.md.
auth.jsonAPI keys now support shell command resolution (!command) and environment variable lookup. See docs/providers.md.- Model selectors now display the selected model name.
Added
- API keys in
auth.jsonnow support shell command resolution (!command) and environment variable lookup, matching the behavior inmodels.json - Added
minimal-mode.tsexample extension demonstrating how to override built-in tool rendering for a minimal display mode - Added Claude Opus 4.6 model to the model catalog
- Added GPT-5.3 Codex model to the model catalog (OpenAI Codex provider only)
- Added SSH URL support for git packages (#1287 by @markusn)
- Model selectors now display the selected model name (#1275 by @haoqixu)
Fixed
- Fixed HTML export losing indentation in ANSI-rendered tool output (e.g. JSON code blocks in custom tool results) (#1269 by @aliou)
- Fixed images being silently dropped when
prompt()is called with bothimagesandstreamingBehaviorduring streaming.steer(),followUp(), and the corresponding RPC commands now accept optional images. (#1271 by @aliou) - CLI
--help,--version,--list-models, and--exportnow exit even if extensions keep the event loop alive (#1285 by @ferologics) - Fixed crash when models send malformed tool arguments (objects instead of strings) (#1259)
- Fixed custom message expand state not being respected (#1258 by @Gurpartap)
- Fixed skill loader to respect .gitignore, .ignore, and .fdignore when scanning directories
[0.51.6] - 2026-02-04
New Features
- Configurable resume keybinding action for opening the session resume selector. See docs/keybindings.md. (#1249 by @juanibiapina)
Added
- Added
resumeas a configurable keybinding action, allowing users to bind a key to open the session resume selector (likenewSession,tree, andfork) (#1249 by @juanibiapina)
Changed
- Slash command menu now triggers on the first line even when other lines have content, allowing commands to be prepended to existing text (#1227 by @aliou)
Fixed
- Ignored unknown skill frontmatter fields when loading skills
- Fixed
/reloadnot picking up changes in global settings.json (#1241) - Fixed forked sessions to persist the user message after forking
- Fixed forked sessions to write to new session files instead of the parent (#1242)
- Fixed local package removal to normalize paths before comparison (#1243)
- Fixed OpenAI Codex Responses provider to respect configured baseUrl (#1244)
- Fixed
/settingscrashing in narrow terminals by handling small widths in the settings list (#1246 by @haoqixu) - Fixed Unix bash detection to fall back to PATH lookup when
/bin/bashis unavailable, including Termux setups (#1230 by @VaclavSynacek)
[0.51.5] - 2026-02-04
Changed
Fixed
- Fixed Windows package installs regression by using shell execution instead of
.cmdresolution (#1220)
[0.51.4] - 2026-02-03
New Features
- Share URLs now default to pi.dev, graciously donated by exe.dev.
Changed
- Share URLs now use pi.dev by default while shittycodingagent.ai and buildwithpi.ai continue to work.
Fixed
[0.51.3] - 2026-02-03
New Features
- Command discovery for extensions via
ExtensionAPI.getCommands(), withcommands.tsexample for invocation patterns. See docs/extensions.md#pigetcommands and . - Local path support for
pi installandpi remove, with relative path resolution against the settings file. See docs/packages.md#local-paths.
Breaking Changes
- RPC
get_commandsresponse andSlashCommandSourcetype: renamed"template"to"prompt"for consistency with the rest of the codebase
Added
- Added
ExtensionAPI.getCommands()to let extensions list available slash commands (extensions, prompt templates, skills) for invocation viaprompt(#1210 by @w-winter) - Added
commands.tsexample extension and exportedSlashCommandInfotypes for command discovery integrations (#1210 by @w-winter) - Added local path support for
pi installandpi removewith relative paths stored against the target settings file (#1216)
Fixed
- Fixed default thinking level persistence so settings-derived defaults are saved and restored correctly
- Fixed Windows package installs by resolving
npm.cmdwhennpmis not directly executable (#1220) - Fixed xhigh thinking level support check to accept gpt-5.2 model IDs (#1209)
[0.51.2] - 2026-02-03
New Features
- Extension tool output expansion controls via ExtensionUIContext getToolsExpanded and setToolsExpanded. See docs/extensions.md and docs/rpc.md.
Added
- Added ExtensionUIContext getToolsExpanded and setToolsExpanded for controlling tool output expansion (#1199 by @academo)
- Added install method detection to show package manager specific update instructions (#1203 by @Itsnotaka)
Fixed
- Fixed Kitty key release events leaking to parent shell over slow SSH connections by draining stdin for up to 1s on exit (#1204)
- Fixed legacy newline handling in the editor to preserve previous newline behavior
- Fixed @ autocomplete to include hidden paths
- Fixed submit fallback to honor configured keybindings
- Fixed extension commands conflicting with built-in commands by skipping them (#1196 by @haoqixu)
- Fixed @-prefixed tool paths failing to resolve by stripping the prefix (#1206)
- Fixed install method detection to avoid stale cached results
[0.51.1] - 2026-02-02
New Features
- Extension API switchSession: Extensions can now programmatically switch sessions via
ctx.switchSession(sessionPath). See docs/extensions.md. (#1187) - Clear on shrink setting: New
terminal.clearOnShrinksetting keeps the editor and footer pinned to the bottom of the terminal when content shrinks. May cause some flicker due to redraws. Disabled by default. Enable via/settingsorPI_CLEAR_ON_SHRINK=1env var.
Fixed
- Fixed scoped models not finding valid credentials after logout (#1194 by @terrorobe)
- Fixed Ctrl+D exit closing the parent SSH session due to stdin buffer race condition (#1185)
- Fixed emoji cursor positioning in editor input (#1183 by @haoqixu)
[0.51.0] - 2026-02-01
Breaking Changes
- Extension tool signature change:
ToolDefinition.executenow uses(toolCallId, params, signal, onUpdate, ctx)parameter order to matchAgentTool.execute. Previously it was(toolCallId, params, onUpdate, ctx, signal). This makes wrapping built-in tools trivial since the first four parameters now align. Update your extensions by swapping thesignalandonUpdateparameters:// Before
async execute(toolCallId, params, onUpdate, ctx, signal) { ... }
// After
async execute(toolCallId, params, signal, onUpdate, ctx) { ... }
New Features
- Android/Termux support: Pi now runs on Android via Termux. Install with:
Clipboard operations fall back gracefully when
pkg install nodejs termux-api git
npm install -g @mariozechner/pi-coding-agent
mkdir -p ~/.pi/agent
echo "You are running on Android in Termux." > ~/.pi/agent/AGENTS.mdtermux-apiis unavailable. (#1164) - Bash spawn hook: Extensions can now intercept and modify bash commands before execution via
pi.setBashSpawnHook(). Adjust the command string, working directory, or environment variables. See docs/extensions.md. (#1160 by @mitsuhiko) - Linux ARM64 musl support: Pi now runs on Alpine Linux ARM64 (linux-arm64-musl) via updated clipboard dependency.
- Nix/Guix support:
PI_PACKAGE_DIRenvironment variable overrides the package path for content-addressed package managers where store paths tokenize poorly. See README.md#environment-variables. (#1153 by @odysseus0) - Named session filter:
/resumepicker now supports filtering to show only named sessions via Ctrl+N. Configurable viatoggleSessionNamedFilterkeybinding. See docs/keybindings.md. (#1128 by @w-winter) - Typed tool call events: Extension developers can narrow
ToolCallEventtypes usingisToolCallEventType()for better TypeScript support. See docs/extensions.md#tool-call-events. (#1147 by @giuseppeg) - Extension UI Protocol: Full RPC documentation and examples for extension dialogs and notifications, enabling headless clients to support interactive extensions. See docs/rpc.md#extension-ui-protocol. (#1144 by @aliou)
Added
- Added Linux ARM64 musl (Alpine Linux) support via clipboard dependency update
- Added Android/Termux support with graceful clipboard fallback (#1164)
- Added bash tool spawn hook support for adjusting command, cwd, and env before execution (#1160 by @mitsuhiko)
- Added typed
ToolCallEvent.inputper tool withisToolCallEventType()type guard for narrowing built-in tool events (#1147 by @giuseppeg) - Exported
discoverAndLoadExtensionsfrom package to enable extension testing without a local repo clone (#1148) - Added Extension UI Protocol documentation to RPC docs covering all request/response types for extension dialogs and notifications (#1144 by @aliou)
- Added
rpc-demo.tsexample extension exercising all RPC-supported extension UI methods (#1144 by @aliou) - Added
rpc-extension-ui.tsTUI example client demonstrating the extension UI protocol with interactive dialogs (#1144 by @aliou) - Added
PI_PACKAGE_DIRenvironment variable to override package path for content-addressed package managers (Nix, Guix) where store paths tokenize poorly (#1153 by @odysseus0) /resumesession picker now supports named-only filter toggle (default Ctrl+N, configurable viatoggleSessionNamedFilter) to show only named sessions (#1128 by @w-winter)
Fixed
- Fixed
pi updatenot updating npm/git packages when called without arguments (#1151) - Fixed
models.jsonvalidation requiring fields documented as optional. Model definitions now only requireid; all other fields (name,reasoning,input,cost,contextWindow,maxTokens) have sensible defaults. (#1146) - Fixed models resolving relative paths in skill files from cwd instead of skill directory by adding explicit guidance to skills preamble (#1136)
- Fixed tree selector losing focus state when navigating entries (#1142 by @Perlence)
- Fixed
cacheRetentionoption not being passed through inbuildBaseOptions(#1154) - Fixed OAuth login/refresh not using HTTP proxy settings (
HTTP_PROXY,HTTPS_PROXYenv vars) (#1132) - Fixed
pi update <source>installing packages locally when the source is only registered globally (#1163 by @aliou) - Fixed tree navigation with summarization overwriting editor content typed during the summarization wait (#1169 by @aliou)
[0.50.9] - 2026-02-01
Added
- Added
titlebar-spinner.tsexample extension that shows a braille spinner animation in the terminal title while the agent is working. - Added
PI_AI_ANTIGRAVITY_VERSIONenvironment variable documentation to help text (#1129) - Added
cacheRetentionstream option with provider-specific mappings for prompt cache controls, defaulting to short retention (#1134)
[0.50.8] - 2026-02-01
Added
- Added
newSession,tree, andforkkeybinding actions for/new,/tree, and/forkcommands. All unbound by default. (#1114 by @juanibiapina) - Added
retry.maxDelayMssetting to cap maximum server-requested retry delay. When a provider requests a longer delay (e.g., Google's "quota will reset after 5h"), the request fails immediately with an informative error instead of waiting silently. Default: 60000ms (60 seconds). (#1123) /resumesession picker: new "Threaded" sort mode (now default) displays sessions in a tree structure based on fork relationships. Compact one-line format with message count and age on the right. (#1124 by @pasky)- Added Qwen CLI OAuth provider extension example. (#940 by @4h9fbZ)
- Added OAuth
modifyModelshook support for extension-registered providers at registration time. (#940 by @4h9fbZ) - Added Qwen thinking format support for OpenAI-compatible completions via
enable_thinking. (#940 by @4h9fbZ) - Added sticky column tracking for vertical cursor navigation so the editor restores the preferred column when moving across short lines. (#1120 by @Perlence)
- Added
resources_discoverextension hook to supply additional skills, prompts, and themes on startup and reload.
Fixed
- Fixed
switchSession()appending spuriousthinking_level_changeentry to session log on resume.setThinkingLevel()is now idempotent. (#1118) - Fixed clipboard image paste on WSL2/WSLg writing invalid PNG files when clipboard provides
image/bmpformat. BMP images are now converted to PNG before saving. (#1112 by @lightningRalf) - Fixed Kitty keyboard protocol base layout fallback so non-QWERTY layouts do not trigger wrong shortcuts (#1096 by @rytswd)
[0.50.7] - 2026-01-31
Fixed
- Multi-file extensions in packages now work correctly. Package resolution now uses the same discovery logic as local extensions: only
index.ts(or manifest-declared entries) are loaded from subdirectories, not helper modules. (#1102)
[0.50.6] - 2026-01-30
Added
- Added
ctx.getSystemPrompt()to extension context for accessing the current effective system prompt (#1098 by @kaofelix)
Fixed
- Fixed empty rows appearing below footer when content shrinks (e.g., closing
/tree, clearing multi-line editor) (#1095 by @marckrenn) - Fixed terminal cursor remaining hidden after exiting TUI via
stop()when a render was pending (#1099 by @haoqixu)
[0.50.5] - 2026-01-30
[0.50.4] - 2026-01-30
New Features
- OSC 52 clipboard support for SSH/mosh - The
/copycommand now works over remote connections using the OSC 52 terminal escape sequence. No more clipboard frustration when using pi over SSH. (#1069 by @gturkoglu) - Vercel AI Gateway routing - Route requests through Vercel's AI Gateway with provider failover and load balancing. Configure via
vercelGatewayRoutingin models.json. (#1051 by @ben-vargas) - Character jump navigation - Bash/Readline-style character search: Ctrl+] jumps forward to the next occurrence of a character, Ctrl+Alt+] jumps backward. (#1074 by @Perlence)
- Emacs-style Ctrl+B/Ctrl+F navigation - Alternative keybindings for word navigation (cursor word left/right) in the editor. (#1053 by @ninlds)
- Line boundary navigation - Editor jumps to line start when pressing Up at first visual line, and line end when pressing Down at last visual line. (#1050 by @4h9fbZ)
- Performance improvements - Optimized image line detection and box rendering cache in the TUI for better rendering performance. (#1084 by @can1357)
set_session_nameRPC command - Headless clients can now set the session display name programmatically. (#1075 by @dnouri)- Disable double-escape behavior - New
"none"option fordoubleEscapeActionsetting completely disables the double-escape shortcut. (#973 by @juanibiapina)
Added
- Added "none" option to
doubleEscapeActionsetting to disable double-escape behavior entirely (#973 by @juanibiapina) - Added OSC 52 clipboard support for SSH/mosh sessions.
/copynow works over remote connections. (#1069 by @gturkoglu) - Added Vercel AI Gateway routing support via
vercelGatewayRoutingin models.json (#1051 by @ben-vargas) - Added Ctrl+B and Ctrl+F keybindings for cursor word left/right navigation in the editor (#1053 by @ninlds)
- Added character jump navigation: Ctrl+] jumps forward to next character, Ctrl+Alt+] jumps backward (#1074 by @Perlence)
- Editor now jumps to line start when pressing Up at first visual line, and line end when pressing Down at last visual line (#1050 by @4h9fbZ)
- Optimized image line detection and box rendering cache for better TUI performance (#1084 by @can1357)
- Added
set_session_nameRPC command for headless clients to set session display name (#1075 by @dnouri)
Fixed
- Read tool now handles macOS filenames with curly quotes (U+2019) and NFD Unicode normalization (#1078)
- Respect .gitignore, .ignore, and .fdignore files when scanning package resources for skills, prompts, themes, and extensions (#1072)
- Fixed tool call argument defaults when providers omit inputs (#1065)
- Invalid JSON in settings.json no longer causes the file to be overwritten with empty settings (#1054)
- Config selector now shows folder name for extensions with duplicate display names (#1064 by @Graffioh)
[0.50.3] - 2026-01-29
New Features
- Kimi For Coding provider: Access Moonshot AI's Anthropic-compatible coding API. Set
KIMI_API_KEYenvironment variable. See README.md#kimi-for-coding.
Added
- Added Kimi For Coding provider support (Moonshot AI's Anthropic-compatible coding API). Set
KIMI_API_KEYenvironment variable. See README.md#kimi-for-coding.
Fixed
- Resources now appear before messages when resuming a session, preventing loaded context from appearing at the bottom of the chat.
[0.50.2] - 2026-01-29
New Features
- Hugging Face provider: Access Hugging Face models via OpenAI-compatible Inference Router. Set
HF_TOKENenvironment variable. See README.md#hugging-face. - Extended prompt caching:
PI_CACHE_RETENTION=longenables 1-hour caching for Anthropic (vs 5min default) and 24-hour for OpenAI (vs in-memory default). Only applies to direct API calls. See README.md#prompt-caching. - Configurable autocomplete height:
autocompleteMaxVisiblesetting (3-20 items, default 5) controls dropdown size. Adjust via/settingsorsettings.json. - Shell-style keybindings:
alt+b/alt+ffor word navigation,ctrl+dfor delete character forward. See docs/keybindings.md. - RPC
get_commands: Headless clients can now list available commands programmatically. See docs/rpc.md.
Added
- Added Hugging Face provider support via OpenAI-compatible Inference Router (#994)
- Added
PI_CACHE_RETENTIONenvironment variable to control cache TTL for Anthropic (5m vs 1h) and OpenAI (in-memory vs 24h). Set tolongfor extended retention. (#967) - Added
autocompleteMaxVisiblesetting for configurable autocomplete dropdown height (3-20 items, default 5) (#972 by @masonc15) - Added
/filescommand to list all file operations (read, write, edit) in the current session - Added shell-style keybindings:
alt+b/alt+ffor word navigation,ctrl+dfor delete character forward (when editor has text) (#1043 by @jasonish) - Added
get_commandsRPC method for headless clients to list available commands (#995 by @dnouri)
Changed
- Improved
extractCursorPositionperformance in TUI: scans lines in reverse order, early-outs when cursor is above viewport (#1004 by @can1357) - Autocomplete improvements: better handling of partial matches and edge cases (#1024 by @Perlence)
Fixed
- External edits to
settings.jsonare now preserved when pi reloads or saves unrelated settings. Previously, editing settings.json directly (e.g., removing a package frompackagesarray) would be silently reverted on next pi startup when automatic setters likesetLastChangelogVersion()triggered a save. - Fixed custom header not displaying correctly with
quietStartupenabled (#1039 by @tudoroancea) - Empty array in package filter now disables all resources instead of falling back to manifest defaults (#1044)
- Auto-retry counter now resets after each successful LLM response instead of accumulating across tool-use turns (#1019)
- Fixed incorrect
.mdfile names in warning messages (#1041 by @llimllib) - Fixed provider name hidden in footer when terminal is narrow (#981 by @Perlence)
- Fixed backslash input buffering causing delayed character display in editor (#1037 by @Perlence)
- Fixed markdown table rendering with proper row dividers and minimum column width (#997 by @tmustier)
- Fixed OpenAI completions
toolChoicehandling (#998 by @williamtwomey) - Fixed cross-provider handoff failing when switching from OpenAI Responses API providers due to pipe-separated tool call IDs (#1022)
- Fixed 429 rate limit errors incorrectly triggering auto-compaction instead of retry with backoff (#1038)
- Fixed Anthropic provider to handle
sensitivestop_reason returned by API (#978) - Fixed DeepSeek API compatibility by detecting
deepseek.comURLs and disabling unsupporteddeveloperrole (#1048) - Fixed Anthropic provider to preserve input token counts when proxies omit them in
message_deltaevents (#1045) - Fixed
autocompleteMaxVisiblesetting not persisting tosettings.json
[0.50.1] - 2026-01-26
Fixed
- Git extension updates now handle force-pushed remotes gracefully instead of failing (#961 by @aliou)
- Extension
ctx.newSession({ setup })now properly syncs agent state and renders messages after setup callback runs (#968) - Fixed extension UI bindings not initializing when starting with no extensions, which broke UI methods after
/reload - Fixed
/hotkeysoutput to title-case extension hotkeys (#969 by @Perlence) - Fixed model catalog generation to exclude deprecated OpenCode Zen models (#970 by @DanielTatarkin)
- Fixed git extension removal to prune empty directories
[0.50.0] - 2026-01-26
New Features
- Pi packages for bundling and installing extensions, skills, prompts, and themes. See docs/packages.md.
- Hot reload (
/reload) of resources including AGENTS.md, SYSTEM.md, APPEND_SYSTEM.md, prompt templates, skills, themes, and extensions. See README.md#commands and README.md#context-files. - Custom providers via
pi.registerProvider()for proxies, custom endpoints, OAuth or SSO flows, and non-standard streaming APIs. See docs/custom-provider.md. - Azure OpenAI Responses provider support with deployment-aware model mapping. See docs/providers.md#azure-openai.
- OpenRouter routing support for custom models via
openRouterRouting. See docs/providers.md#api-keys and docs/models.md. - Skill invocation messages are now collapsible and skills can opt out of model invocation via
disable-model-invocation. See docs/skills.md#frontmatter. - Session selector renaming and configurable keybindings. See README.md#commands and docs/keybindings.md.
models.jsonheaders can resolve environment variables and shell commands. See docs/models.md#value-resolution.--verboseCLI flag to override quiet startup. See README.md#cli-reference.
Read the fully revamped docs in README.md, or have your clanker read them for you.
SDK Migration Guide
There are multiple SDK breaking changes since v0.49.3. For the quickest migration, point your agent at packages/coding-agent/docs/sdk.md, the SDK examples in packages/coding-agent/examples/sdk, and the SDK source in packages/coding-agent/src/core/sdk.ts and related modules.
Breaking Changes
- Header values in
models.jsonnow resolve environment variables (if a header value matches an env var name, the env var value is used). This may change behavior if a literal header value accidentally matches an env var name. (#909) - External packages (npm/git) are now configured via
packagesarray in settings.json instead ofextensions. Existing npm:/git: entries inextensionsare auto-migrated. (#645) - Resource loading now uses
ResourceLoaderonly and settings.json uses arrays for extensions, skills, prompts, and themes (#645) - Removed
discoverAuthStorageanddiscoverModelsfrom the SDK.AuthStorageandModelRegistrynow default to~/.pi/agentpaths unless you pass anagentDir(#645)
Added
- Session renaming in
/resumepicker viaCtrl+Rwithout opening the session (#863 by @svkozak) - Session selector keybindings are now configurable (#948 by @aos)
disable-model-invocationfrontmatter field for skills to prevent agentic invocation while still allowing explicit/skill:namecommands (#927)- Exposed
copyToClipboardutility for extensions (#926 by @mitsuhiko) - Skill invocation messages are now collapsible in chat output, showing collapsed by default with skill name and expand hint (#894)
- Header values in
models.jsonnow support environment variables and shell commands, matchingapiKeyresolution (#909) - Added HTTP proxy environment variable support for API requests (#942 by @haoqixu)
- Added OpenRouter provider routing support for custom models via
openRouterRoutingcompat field (#859 by @v01dpr1mr0s3) - Added
azure-openai-responsesprovider support for Azure OpenAI Responses API. (#890 by @markusylisiurunen) - Added changelog link to update notifications (#925 by @dannote)
- Added
--verboseCLI flag to override quietStartup setting (#906 by @Perlence) markdown.codeBlockIndentsetting to customize code block indentation in rendered output- Extension package management with
pi install,pi remove,pi update, andpi listcommands (#645) - Package filtering: selectively load resources from packages using object form in
packagesarray (#645) - Glob pattern support with minimatch in package filters, top-level settings arrays, and pi manifest (e.g.,
"!funky.json","*.ts") (#645) /reloadcommand to reload extensions, skills, prompts, and themes (#645)pi configcommand with TUI to enable/disable package and top-level resources via patterns (#938)- CLI flags for
--skill,--prompt-template,--theme,--no-prompt-templates, and--no-themes(#645) - Package deduplication: if same package appears in global and project settings, project wins (#645)
- Unified collision reporting with
ResourceDiagnostictype for all resource types (#645) - Show provider alongside the model in the footer if multiple providers are available
- Custom provider support via
pi.registerProvider()withstreamSimplefor custom API implementations - Added
custom-provider.tsexample extension demonstrating custom Anthropic provider with OAuth
Changed
/resumepicker sort toggle moved toCtrl+Sto freeCtrl+Rfor rename (#863 by @svkozak)- HTML export: clicking a sidebar message now navigates to its newest leaf and scrolls to it, instead of truncating the branch (#853 by @mitsuhiko)
- HTML export: active path is now visually highlighted with dimmed off-path nodes (#929 by @hewliyang)
- Azure OpenAI Responses provider now uses base URL configuration with deployment-aware model mapping and no longer includes service tier handling
/reloadnow re-renders the entire scrollback so updated extension components are visible immediately (#928 by @ferologics)- Skill, prompt template, and theme discovery now use settings and CLI path arrays instead of legacy filters (#645)
Fixed
- Extension
setWorkingMessage()calls inagent_starthandlers now work correctly; previously the message was silently ignored because the loading animation didn't exist yet (#935) - Fixed package auto-discovery to respect loader rules, config overrides, and force-exclude patterns
- Fixed /reload restoring the correct editor after reload (#949 by @Perlence)
- Fixed distributed themes breaking
/export(#946 by @mitsuhiko) - Fixed startup hints to clarify thinking level selection and expanded thinking guidance
- Fixed SDK initial model resolution to use
findInitialModeland default to Claude Opus 4.5 for Anthropic models - Fixed no-models warning to include the
/modelinstruction - Fixed authentication error messages to point to the authentication documentation
- Fixed bash output hint lines to truncate to terminal width
- Fixed custom editors to honor the
paddingXsetting (#936 by @Perlence) - Fixed system prompt tool list to show only built-in tools
- Fixed package manager to check npm package versions before using cached copies
- Fixed package manager to run
npm installafter cloning git repositories with a package.json - Fixed extension provider registrations to apply before model resolution
- Fixed editor multi-line insertion handling and lastAction tracking (#945 by @Perlence)
- Fixed editor word wrapping to reserve a cursor column (#934 by @Perlence)
- Fixed editor word wrapping to use single-pass backtracking for whitespace handling (#924 by @Perlence)
- Fixed Kitty image ID allocation and cleanup to prevent image ID collisions
- Fixed overlays staying centered after terminal resizes (#950 by @nicobailon)
- Fixed streaming dispatch to use the model api type instead of hardcoded API defaults
- Fixed Google providers to default tool call arguments to an empty object when omitted
- Fixed OpenAI Responses streaming to handle
arguments.doneevents on OpenAI-compatible endpoints (#917 by @williballenthin) - Fixed OpenAI Codex Responses tool strictness handling after the shared responses refactor
- Fixed Azure OpenAI Responses streaming to guard deltas before content parts and correct metadata and handoff gating
- Fixed OpenAI completions tool-result image batching after consecutive tool results (#902 by @terrorobe)
- Off-by-one error in bash output "earlier lines" count caused by counting spacing newline as hidden content (#921)
- User package filters now layer on top of manifest filters instead of replacing them (#645)
- Auto-retry now handles "terminated" errors from Codex API mid-stream failures
- Follow-up queue (Alt+Enter) now sends full paste content instead of
[paste #N ...]markers (#912) - Fixed Alt-Up not restoring messages queued during compaction (#923 by @aliou)
- Fixed session corruption when loading empty or invalid session files via
--sessionflag (#932 by @armanddp) - Fixed extension shortcuts not firing when extension also uses
setEditorComponent()(#947 by @Perlence) - Session "modified" time now uses last message timestamp instead of file mtime, so renaming doesn't reorder the recent list (#863 by @svkozak)
[0.49.3] - 2026-01-22
Added
markdown.codeBlockIndentsetting to customize code block indentation in rendered output (#855 by @terrorobe)- Added
inline-bash.tsexample extension for expanding!{command}patterns in prompts (#881 by @scutifer) - Added
antigravity-image-gen.tsexample extension for AI image generation via Google Antigravity (#893 by @ben-vargas) - Added
PI_SHARE_VIEWER_URLenvironment variable for custom share viewer URLs (#889 by @andresaraujo) - Added Alt+Delete as hotkey for delete word forwards (#878 by @Perlence)
Changed
- Tree selector: changed label filter shortcut from
ltoShift+Lso users can search for entries containing "l" (#861 by @mitsuhiko) - Fuzzy matching now scores consecutive matches higher for better search relevance (#860 by @mitsuhiko)
Fixed
- Fixed error messages showing hardcoded
~/.pi/agent/paths instead of respectingPI_CODING_AGENT_DIR(#887 by @aliou) - Fixed
writetool not displaying errors in the UI when execution fails (#856) - Fixed HTML export using default theme instead of user's active theme (#870 by @scutifer)
- Show session name in the footer and terminal / tab title (#876 by @scutifer)
- Fixed 256color fallback in Terminal.app to prevent color rendering issues (#869 by @Perlence)
- Fixed viewport tracking and cursor positioning for overlays and content shrink scenarios
- Fixed autocomplete to allow searches with
/characters (e.g.,folder1/folder2) (#882 by @richardgill) - Fixed autolinked emails displaying redundant
(mailto:...)suffix (#888 by @terrorobe) - Fixed
@file autocomplete adding space after directories, breaking continued autocomplete into subdirectories
[0.49.2] - 2026-01-19
Added
- Added widget placement option for extension widgets via
widgetPlacementinpi.addWidget()(#850 by @marckrenn) - Added AWS credential detection for ECS/Kubernetes environments:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI,AWS_CONTAINER_CREDENTIALS_FULL_URI,AWS_WEB_IDENTITY_TOKEN_FILE(#848) - Add "quiet startup" setting to
/settings(#847 by @unexge)
Changed
- HTML export now includes JSONL download button, jump-to-last-message on click, and fixed missing labels (#853 by @mitsuhiko)
- Improved error message for OAuth authentication failures (expired credentials, offline) instead of generic 'No API key found' (#849 by @zedrdave)
Fixed
- Fixed
/modelselector scope toggle so you can switch between all and scoped models when scoped models are saved (#844) - Fixed OpenAI Responses 400 error "reasoning without following item" when replaying aborted turns (#838)
- Fixed pi exiting with code 0 when cancelling resume session selection
Removed
- Removed
strictResponsesPairingcompat option from models.json schema (no longer needed)
[0.49.1] - 2026-01-18
Added
- Added
strictResponsesPairingcompat option for custom OpenAI Responses models on Azure (#768 by @prateekmedia) - Session selector (
/resume) now supports path display toggle (Ctrl+P) and session deletion (Ctrl+D) with inline confirmation (#816 by @w-winter) - Added undo support in interactive mode with Ctrl+- hotkey. (#831 by @Perlence)
Changed
- Share URLs now use hash fragments (
#) instead of query strings (?) to prevent session IDs from being sent to buildwithpi.ai (#829 by @terrorobe) - API keys in
models.jsoncan now be retrieved via shell command using!prefix (e.g.,"apiKey": "!security find-generic-password -ws 'anthropic'"for macOS Keychain) (#762 by @cv)
Fixed
- Fixed IME candidate window appearing in wrong position when filtering menus with Input Method Editor (e.g., Chinese IME). Components with search inputs now properly propagate focus state for cursor positioning. (#827)
- Fixed extension shortcut conflicts to respect user keybindings when built-in actions are remapped. (#826 by @richardgill)
- Fixed photon WASM loading in standalone compiled binaries.
- Fixed tool call ID normalization for cross-provider handoffs (e.g., Codex to Antigravity Claude) (#821)
[0.49.0] - 2026-01-17
Added
pi.setLabel(entryId, label)in ExtensionAPI for setting per-entry labels from extensions (#806)- Export
keyHint,appKeyHint,editorKey,appKey,rawKeyHintfor extensions to format keybinding hints consistently (#802 by @dannote) - Exported
VERSIONfrom the package index and updated the custom-header example. (#798 by @tallshort) - Added
showHardwareCursorsetting to control cursor visibility while still positioning it for IME support. (#800 by @ghoulr) - Added Emacs-style kill ring editing with yank and yank-pop keybindings, plus legacy Alt+letter handling and Alt+D delete word forward support in the interactive editor. (#810 by @Perlence)
- Added
ctx.compact()andctx.getContextUsage()to extension contexts for programmatic compaction and context usage checks. - Added documentation for delete word forward and kill ring keybindings in interactive mode. (#810 by @Perlence)
Changed
- Updated the default system prompt wording to clarify the pi harness and documentation scope.
- Simplified Codex system prompt handling to use the default system prompt directly for Codex instructions.
Fixed
- Fixed photon module failing to load in ESM context with "require is not defined" error (#795 by @dannote)
- Fixed compaction UI not showing when extensions trigger compaction.
- Fixed orphaned tool results after errored assistant messages causing Codex API errors. When an assistant message has
stopReason: "error", its tool calls are now excluded from pending tool tracking, preventing synthetic tool results from being generated for calls that will be dropped by provider-specific converters. (#812) - Fixed Bedrock Claude max_tokens handling to always exceed thinking budget tokens, preventing compaction failures. (#797 by @pjtf93)
- Fixed Claude Code tool name normalization to match the Claude Code tool list case-insensitively and remove invalid mappings.
Removed
- Removed
pi-internal://path resolution from the read tool.
[0.48.0] - 2026-01-16
Added
- Added
quietStartupsetting to silence startup output (version header, loaded context info, model scope line). Changelog notifications are still shown. (#777 by @ribelo) - Added
editorPaddingXsetting for horizontal padding in input editor (0-3, default: 0) - Added
shellCommandPrefixsetting to prepend commands to every bash execution, enabling alias expansion in non-interactive shells (e.g.,"shellCommandPrefix": "shopt -s expand_aliases") (#790 by @richardgill) - Added bash-style argument slicing for prompt templates (#770 by @airtonix)
- Extension commands can provide argument auto-completions via
getArgumentCompletionsinpi.registerCommand()(#775 by @ribelo) - Bash tool now displays the timeout value in the UI when a timeout is set (#780 by @dannote)
- Export
getShellConfigfor extensions to detect user's shell environment (#766 by @dannote) - Added
thinkingTextandselectedBgto theme schema (#763 by @scutifer) navigateTree()now supportsreplaceInstructionsoption to replace the default summarization prompt entirely, andlabeloption to attach a label to the branch summary entry (#787 by @mitsuhiko)
Fixed
- Fixed crash during auto-compaction when summarization fails (e.g., quota exceeded). Now displays error message instead of crashing (#792)
- Fixed
--session <UUID>to search globally across projects if not found locally, with option to fork sessions from other projects (#785 by @ribelo) - Fixed standalone binary WASM loading on Linux (#784)
- Fixed string numbers in tool arguments not being coerced to numbers during validation (#786 by @dannote)
- Fixed
--no-extensionsflag not preventing extension discovery (#776) - Fixed extension messages rendering twice on startup when
pi.sendMessage({ display: true })is called duringsession_start(#765 by @dannote) - Fixed
PI_CODING_AGENT_DIRenv var not expanding tilde (~) to home directory (#778 by @aliou) - Fixed session picker hint text overflow (#764)
- Fixed Kitty keyboard protocol shifted symbol keys (e.g.,
@,?) not working in editor (#779 by @iamd3vil) - Fixed Bedrock tool call IDs causing API errors from invalid characters (#781 by @pjtf93)
Changed
- Hardware cursor is now disabled by default for better terminal compatibility. Set
PI_HARDWARE_CURSOR=1to enable (replacesPI_NO_HARDWARE_CURSOR=1which disabled it).
[0.47.0] - 2026-01-16
Breaking Changes
- Extensions using
Editordirectly must now passTUIas the first constructor argument:new Editor(tui, theme). Thetuiparameter is available in extension factory functions. (#732)
Added
- OpenAI Codex official support: Full compatibility with OpenAI's Codex CLI models (
gpt-5.1,gpt-5.2,gpt-5.1-codex-mini,gpt-5.2-codex). Features include static system prompt for OpenAI allowlisting, prompt caching via session ID, and reasoning signature retention across turns. SetOPENAI_API_KEYand use--provider openai-codexor select a Codex model. (#737) pi-internal://URL scheme in read tool for accessing internal documentation. The model can read files from the coding-agent package (README, docs, examples) to learn about extending pi.- New
inputevent in extension system for intercepting, transforming, or handling user input before the agent processes it. Supports three result types:continue(pass through),transform(modify text/images),handled(respond without LLM). Handlers chain transforms and short-circuit on handled. (#761 by @nicobailon) - Extension example:
input-transform.tsdemonstrating input interception patterns (quick mode, instant commands, source routing) (#761 by @nicobailon) - Custom tool HTML export: extensions with
renderCall/renderResultnow render in/shareand/exportoutput with ANSI-to-HTML color conversion (#702 by @aliou) - Direct filter shortcuts in Tree mode: Ctrl+D (default), Ctrl+T (no-tools), Ctrl+U (user-only), Ctrl+L (labeled-only), Ctrl+A (all) (#747 by @kaofelix)
Changed
- Skill commands (
/skill:name) are now expanded in AgentSession instead of interactive mode. This enables skill commands in RPC and print modes, and allows theinputevent to intercept/skill:namebefore expansion.
Fixed
- Editor no longer corrupts terminal display when loading large prompts via
setEditorText. Content now scrolls vertically with indicators showing lines above/below the viewport. (#732) - Piped stdin now works correctly:
echo foo | piis equivalent topi -p foo. When stdin is piped, print mode is automatically enabled since interactive mode requires a TTY (#708) - Session tree now preserves branch connectors and indentation when filters hide intermediate entries so descendants attach to the nearest visible ancestor and sibling branches align. Fixed in both TUI and HTML export (#739 by @w-winter)
- Added
upstream connect,connection refused, andreset before headerspatterns to auto-retry error detection (#733) - Multi-line YAML frontmatter in skills and prompt templates now parses correctly. Centralized frontmatter parsing using the
yamllibrary. (#728 by @richardgill) ctx.shutdown()now waits for pending UI renders to complete before exiting, ensuring notifications and final output are visible (#756)- OpenAI Codex provider now retries on transient errors (429, 5xx, connection failures) with exponential backoff (#733)
[0.46.0] - 2026-01-15
Fixed
- Scoped models (
--modelsorenabledModels) now remember the last selected model across sessions instead of always starting with the first model in the scope (#736 by @ogulcancelik) - Show
bun installinstead ofnpm installin update notification when running under Bun (#714 by @dannote) /skillprompts now include the skill path (#711 by @jblwilliams)- Use configurable
expandToolskeybinding instead of hardcoded Ctrl+O (#717 by @dannote) - Compaction turn prefix summaries now merge correctly (#738 by @vsabavat)
- Avoid unsigned Gemini 3 tool calls (#741 by @roshanasingh4)
- Fixed signature support for non-Anthropic models in Amazon Bedrock provider (#727 by @unexge)
- Keyboard shortcuts (Ctrl+C, Ctrl+D, etc.) now work on non-Latin keyboard layouts (Russian, Ukrainian, Bulgarian, etc.) in terminals supporting Kitty keyboard protocol with alternate key reporting (#718 by @dannote)
Added
- Edit tool now uses fuzzy matching as fallback when exact match fails, tolerating trailing whitespace, smart quotes, Unicode dashes, and special spaces (#713 by @dannote)
- Support
APPEND_SYSTEM.mdto append instructions to the system prompt (#716 by @tallshort) - Session picker search: Ctrl+R toggles sorting between fuzzy match (default) and most recent; supports quoted phrase matching and
re:regex mode (#731 by @ogulcancelik) - Export
getAgentDirfor extensions (#749 by @dannote) - Show loaded prompt templates on startup (#743 by @tallshort)
- MiniMax China (
minimax-cn) provider support (#725 by @tallshort) gpt-5.2-codexmodels for GitHub Copilot and OpenCode Zen providers (#734 by @aadishv)
Changed
- Replaced
wasm-vipswith@silvia-odwyer/photon-nodefor image processing (#710 by @can1357) - Extension example:
plan-mode/shortcut changed from Shift+P to Ctrl+Alt+P to avoid conflict with typing capital P (#746 by @ferologics) - UI keybinding hints now respect configured keybindings across components (#724 by @dannote)
- CLI process title is now set to
pifor easier process identification (#742 by @richardgill)
[0.45.7] - 2026-01-13
Added
[0.45.6] - 2026-01-13
Added
ctx.ui.custom()now acceptsoverlayOptionsfor overlay positioning and sizing (anchor, margins, offsets, percentages, absolute positioning) (#667 by @nicobailon)ctx.ui.custom()now acceptsonHandlecallback to receive theOverlayHandlefor controlling overlay visibility (#667 by @nicobailon)- Extension example:
overlay-qa-tests.tswith 10 commands for testing overlay positioning, animation, and toggle scenarios (#667 by @nicobailon) - Extension example:
doom-overlay/- DOOM game running as an overlay at 35 FPS (auto-downloads WAD on first run) (#667 by @nicobailon)
[0.45.5] - 2026-01-13
Fixed
- Skip changelog display on fresh install (only show on upgrades)
[0.45.4] - 2026-01-13
Changed
- Light theme colors adjusted for WCAG AA compliance (4.5:1 contrast ratio against white backgrounds)
- Replaced
sharpwithwasm-vipsfor image processing (resize, PNG conversion). Eliminates native build requirements that caused installation failures on some systems. (#696)
Added
- Extension example:
summarize.tsfor summarizing conversations using custom UI and an external model (#684 by @scutifer) - Extension example:
question.tsenhanced with custom UI for asking user questions (#693 by @ferologics) - Extension example:
plan-mode/enhanced with explicit step tracking and progress widget (#694 by @ferologics) - Extension example:
questionnaire.tsfor multi-question input with tab bar navigation (#695 by @ferologics) - Experimental Vercel AI Gateway provider support: set
AI_GATEWAY_API_KEYand use--provider vercel-ai-gateway. Token usage is currently reported incorrectly by Anthropic Messages compatible endpoint. (#689 by @timolins)
Fixed
- Fix API key resolution after model switches by using provider argument (#691 by @joshp123)
- Fixed z.ai thinking/reasoning: thinking toggle now correctly enables/disables thinking for z.ai models (#688)
- Fixed extension loading in compiled Bun binary: extensions with local file imports now work correctly. Updated
@mariozechner/jitito v2.6.5 which bundles babel for Bun binary compatibility. (#681) - Fixed theme loading when installed via mise: use wrapper directory in release tarballs for compatibility with mise's
strip_components=1extraction. (#681)
[0.45.3] - 2026-01-13
[0.45.2] - 2026-01-13
Fixed
- Extensions now load correctly in compiled Bun binary using
@mariozechner/jitifork withvirtualModulessupport. Bundled packages (@sinclair/typebox,@mariozechner/pi-tui,@mariozechner/pi-ai,@mariozechner/pi-coding-agent) are accessible to extensions without filesystem node_modules.
[0.45.1] - 2026-01-13
Changed
/sharenow outputsbuildwithpi.aisession preview URLs instead ofshittycodingagent.ai
[0.45.0] - 2026-01-13
Added
- MiniMax provider support: set
MINIMAX_API_KEYand useminimax/MiniMax-M2.1(#656 by @dannote) /scoped-models: Alt+Up/Down to reorder enabled models. Order is preserved when saving with Ctrl+S and determines Ctrl+P cycling order. (#676 by @thomasmhr)- Amazon Bedrock provider support (experimental, tested with Anthropic Claude models only) (#494 by @unexge)
- Extension example:
sandbox/for OS-level bash sandboxing using@anthropic-ai/sandbox-runtimewith per-project config (#673 by @dannote) - Print mode JSON output now emits the session header as the first line.
[0.44.0] - 2026-01-12
Breaking Changes
pi.getAllTools()now returnsToolInfo[](withnameanddescription) instead ofstring[]. Extensions that only need names can use.map(t => t.name). (#648 by @carsonfarmer)
Added
- Session naming:
/name <name>command sets a display name shown in the session selector instead of the first message. Useful for distinguishing forked sessions. Extensions can usepi.setSessionName()andpi.getSessionName(). (#650 by @scutifer) - Extension example:
notify.tsfor desktop notifications via OSC 777 escape sequence (#658 by @ferologics) - Inline hint for queued messages showing the
Alt+Uprestore shortcut (#657 by @tmustier) - Page-up/down navigation in
/resumesession selector to jump by 5 items (#662 by @aliou) - Fuzzy search in
/settingsmenu: type to filter settings by label (#643 by @ninlds)
Fixed
- Session selector now stays open when current folder has no sessions, allowing Tab to switch to "all" scope (#661 by @aliou)
- Extensions using theme utilities like
getSettingsListTheme()now work in dev mode with tsx
[0.43.0] - 2026-01-11
Breaking Changes
- Extension editor (
ctx.ui.editor()) now uses Enter to submit and Shift+Enter for newlines, matching the main editor. Previously used Ctrl+Enter to submit. Extensions with hardcoded "ctrl+enter" hints need updating. (#642 by @mitsuhiko) - Renamed
/branchcommand to/fork(#641)- RPC:
branch→fork,get_branch_messages→get_fork_messages - SDK:
branch()→fork(),getBranchMessages()→getForkMessages() - AgentSession:
branch()→fork(),getUserMessagesForBranching()→getUserMessagesForForking() - Extension events:
session_before_branch→session_before_fork,session_branch→session_fork - Settings:
doubleEscapeAction: "branch" | "tree"→"fork" | "tree"
- RPC:
SessionManager.list()andSessionManager.listAll()are now async, returningPromise<SessionInfo[]>. Callers must await them. (#620 by @tmustier)
Added
/resumeselector now toggles between current-folder and all sessions with Tab, showing the session cwd in the All view and loading progress. (#620 by @tmustier)SessionManager.list()andSessionManager.listAll()accept optionalonProgresscallback for progress updatesSessionInfo.cwdfield containing the session's working directory (empty string for old sessions)SessionListProgresstype export for progress callbacks/scoped-modelscommand to enable/disable models for Ctrl+P cycling. Changes are session-only by default; press Ctrl+S to persist to settings.json. (#626 by @CarlosGtrz)model_selectextension hook fires when model changes via/model, model cycling, or session restore withsourcefield andpreviousModel(#628 by @marckrenn)ctx.ui.setWorkingMessage()extension API to customize the "Working..." message during streaming (#625 by @nicobailon)- Skill slash commands: loaded skills are registered as
/skill:namecommands for quick access. Toggle via/settingsorskills.enableSkillCommandsin settings.json. (#630 by @Dwsy) - Slash command autocomplete now uses fuzzy matching (type
/skbrato match/skill:brave-search) /treebranch summarization now offers three options: "No summary", "Summarize", and "Summarize with custom prompt". Custom prompts are appended as additional focus to the default summarization instructions. (#642 by @mitsuhiko)
Fixed
- Missing spacer between assistant message and text editor (#655)
- Session picker respects custom keybindings when using
--resume(#633 by @aos) - Custom footer extensions now see model changes:
ctx.modelis now a getter that returns the current model instead of a snapshot from when the context was created (#634 by @ogulcancelik) - Footer git branch not updating after external branch switches. Git uses atomic writes (temp file + rename), which changes the inode and breaks
fs.watchon the file. Now watches the directory instead. - Extension loading errors are now displayed to the user instead of being silently ignored (#639 by @aliou)
[0.42.5] - 2026-01-11
Fixed
- Reduced flicker by only re-rendering changed lines (#617 by @ogulcancelik). No worries tho, there's still a little flicker in the VS Code Terminal. Praise the flicker.
- Cursor position tracking when content shrinks with unchanged remaining lines
- TUI renders with wrong dimensions after suspend/resume if terminal was resized while suspended (#599)
- Pasted content containing Kitty key release patterns (e.g.,
:3Fin MAC addresses) was incorrectly filtered out (#623 by @ogulcancelik)
[0.42.4] - 2026-01-10
Fixed
- Bash output expanded hint now says "(ctrl+o to collapse)" (#610 by @tallshort)
- Fixed UTF-8 text corruption in remote bash execution (SSH, containers) by using streaming TextDecoder (#608)
[0.42.3] - 2026-01-10
Changed
- OpenAI Codex: updated to use bundled system prompt from upstream
[0.42.2] - 2026-01-10
Added
/model <search>now pre-filters the model selector or auto-selects on exact match. Useprovider/modelsyntax to disambiguate (e.g.,/model openai/gpt-4). (#587 by @zedrdave)FooterDataProviderfor custom footers:ctx.ui.setFooter()now receives a thirdfooterDataparameter providinggetGitBranch(),getExtensionStatuses(), andonBranchChange()for reactive updates (#600 by @nicobailon)Alt+Uphotkey to restore queued steering/follow-up messages back into the editor without aborting the current run (#604 by @tmustier)
Fixed
- Fixed LM Studio compatibility for OpenAI Responses tool strict mapping in the ai provider (#598 by @gnattu)
[0.42.1] - 2026-01-09
Fixed
- Symlinked directories in
prompts/folders are now followed when loading prompt templates (#601 by @aliou)
[0.42.0] - 2026-01-09
Added
- Added OpenCode Zen provider support. Set
OPENCODE_API_KEYenv var and useopencode/<model-id>(e.g.,opencode/claude-opus-4-5).
[0.41.0] - 2026-01-09
Added
- Anthropic OAuth support is back! Use
/loginto authenticate with your Claude Pro/Max subscription.
[0.40.1] - 2026-01-09
Removed
- Anthropic OAuth support (
/login). Use API keys instead.
[0.40.0] - 2026-01-08
Added
- Documentation on component invalidation and theme changes in
docs/tui.md
Fixed
- Components now properly rebuild their content on theme change (tool executions, assistant messages, bash executions, custom messages, branch/compaction summaries)
[0.39.1] - 2026-01-08
Fixed
setTheme()now triggers a full rerender so previously rendered components update with the new theme colorsmac-system-theme.tsexample now polls every 2 seconds and usesosascriptfor real-time macOS appearance detection
[0.39.0] - 2026-01-08
Breaking Changes
before_agent_startevent now receivessystemPromptin the event object and returnssystemPrompt(full replacement) instead ofsystemPromptAppend. Extensions that were appending must now useevent.systemPrompt + extrapattern. (#575)discoverSkills()now returns{ skills: Skill[], warnings: SkillWarning[] }instead ofSkill[]. This allows callers to handle skill loading warnings. (#577 by @cv)
Added
ctx.ui.getAllThemes(),ctx.ui.getTheme(name), andctx.ui.setTheme(name | Theme)methods for extensions to list, load, and switch themes at runtime (#576)--no-toolsflag to disable all built-in tools, allowing extension-only tool setups (#557 by @cv)- Pluggable operations for built-in tools enabling remote execution via SSH or other transports (#564). Interfaces:
ReadOperations,WriteOperations,EditOperations,BashOperations,LsOperations,GrepOperations,FindOperations user_bashevent for intercepting user!/!!commands, allowing extensions to redirect to remote systems (#528)setActiveTools()in ExtensionAPI for dynamic tool management- Built-in renderers used automatically for tool overrides without custom
renderCall/renderResult ssh.tsexample: remote tool execution via--ssh user@host:/pathinteractive-shell.tsexample: run interactive commands (vim, git rebase, htop) with full terminal access via!iprefix or auto-detection- Wayland clipboard support for
/copycommand using wl-copy with xclip/xsel fallback (#570 by @OgulcanCelik) - Experimental:
ctx.ui.custom()now accepts{ overlay: true }option for floating modal components that composite over existing content without clearing the screen (#558 by @nicobailon) AgentSession.skillsandAgentSession.skillWarningsproperties to access loaded skills without rediscovery (#577 by @cv)
Fixed
- String
systemPromptincreateAgentSession()now works as a full replacement instead of having context files and skills appended, matching documented behavior (#543) - Update notification for bun binary installs now shows release download URL instead of npm command (#567 by @ferologics)
- ESC key now works during "Working..." state after auto-retry (#568 by @tmustier)
- Abort messages now show correct retry attempt count (e.g., "Aborted after 2 retry attempts") (#568 by @tmustier)
- Fixed Antigravity provider returning 429 errors despite available quota (#571 by @ben-vargas)
- Fixed malformed thinking text in Gemini/Antigravity responses where thinking content appeared as regular text or vice versa. Cross-model conversations now properly convert thinking blocks to plain text. (#561)
--no-skillsflag now correctly prevents skills from loading in interactive mode (#577 by @cv)
[0.38.0] - 2026-01-08
Breaking Changes
ctx.ui.custom()factory signature changed from(tui, theme, done)to(tui, theme, keybindings, done)for keybinding access in custom componentsLoadedExtensiontype renamed toExtensionLoadExtensionsResult.setUIContext()removed, replaced withruntime: ExtensionRuntimeExtensionRunnerconstructor now requiresruntime: ExtensionRuntimeas second parameterExtensionRunner.initialize()signature changed from options object to positional params(actions, contextActions, commandContextActions?, uiContext?)ExtensionRunner.getHasUI()renamed tohasUI()- OpenAI Codex model aliases removed (
gpt-5,gpt-5-mini,gpt-5-nano,codex-mini-latest). Use canonical IDs:gpt-5.1,gpt-5.1-codex-mini,gpt-5.2,gpt-5.2-codex. (#536 by @ghoulr)
Added
--no-extensionsflag to disable extension discovery while still allowing explicit-epaths (#524 by @cv)- SDK:
InteractiveMode,runPrintMode(),runRpcMode()exported for building custom run modes. Seedocs/sdk.md. PI_SKIP_VERSION_CHECKenvironment variable to disable new version notifications at startup (#549 by @aos)thinkingBudgetssetting to customize token budgets per thinking level for token-based providers (#529 by @melihmucuk)- Extension UI dialogs (
ctx.ui.select(),ctx.ui.confirm(),ctx.ui.input()) now support atimeoutoption with live countdown display (#522 by @nicobailon) - Extensions can now provide custom editor components via
ctx.ui.setEditorComponent(). Seeexamples/extensions/modal-editor.tsanddocs/tui.mdPattern 7. - Extension factories can now be async, enabling dynamic imports and lazy-loaded dependencies (#513 by @austinm911)
ctx.shutdown()is now available in extension contexts for requesting a graceful shutdown. In interactive mode, shutdown is deferred until the agent becomes idle (after processing all queued steering and follow-up messages). In RPC mode, shutdown is deferred until after completing the current command response. In print mode, shutdown is a no-op as the process exits automatically when prompts complete. (#542 by @kaofelix)
Fixed
- Default thinking level from settings now applies correctly when
enabledModelsis configured (#540 by @ferologics) - External edits to
settings.jsonwhile pi is running are now preserved when pi saves settings (#527 by @ferologics) - Overflow-based compaction now skips if error came from a different model or was already handled by a previous compaction (#535 by @mitsuhiko)
- OpenAI Codex context window reduced from 400k to 272k tokens to match Codex CLI defaults and prevent 400 errors (#536 by @ghoulr)
- Context overflow detection now recognizes
context_length_exceedederrors. - Key presses no longer dropped when input is batched over SSH (#538)
- Clipboard image support now works on Alpine Linux and other musl-based distros (#533)
[0.37.8] - 2026-01-07
[0.37.7] - 2026-01-07
[0.37.6] - 2026-01-06
Added
- Extension UI dialogs (
ctx.ui.select(),ctx.ui.confirm(),ctx.ui.input()) now accept an optionalAbortSignalto programmatically dismiss dialogs. Useful for implementing timeouts. Seeexamples/extensions/timed-confirm.ts. (#474) - HTML export now shows bridge prompts in model change messages for Codex sessions (#510 by @mitsuhiko)
[0.37.5] - 2026-01-06
Added
- ExtensionAPI:
setModel(),getThinkingLevel(),setThinkingLevel()methods for extensions to change model and thinking level at runtime (#509) - Exported truncation utilities for custom tools:
truncateHead,truncateTail,truncateLine,formatSize,DEFAULT_MAX_BYTES,DEFAULT_MAX_LINES,TruncationOptions,TruncationResult - New example
truncated-tool.tsdemonstrating proper output truncation with custom rendering for extensions - New example
preset.tsdemonstrating preset configurations with model/thinking/tools switching (#347) - Documentation for output truncation best practices in
docs/extensions.md - Exported all UI components for extensions:
ArminComponent,AssistantMessageComponent,BashExecutionComponent,BorderedLoader,BranchSummaryMessageComponent,CompactionSummaryMessageComponent,CustomEditor,CustomMessageComponent,DynamicBorder,ExtensionEditorComponent,ExtensionInputComponent,ExtensionSelectorComponent,FooterComponent,LoginDialogComponent,ModelSelectorComponent,OAuthSelectorComponent,SessionSelectorComponent,SettingsSelectorComponent,ShowImagesSelectorComponent,ThemeSelectorComponent,ThinkingSelectorComponent,ToolExecutionComponent,TreeSelectorComponent,UserMessageComponent,UserMessageSelectorComponent, plus utilitiesrenderDiff,truncateToVisualLines docs/tui.md: Common Patterns section with copy-paste code for SelectList, BorderedLoader, SettingsList, setStatus, setWidget, setFooterdocs/tui.md: Key Rules section documenting critical patterns for extension UI developmentdocs/extensions.md: Exhaustive example links for all ExtensionAPI methods and events- System prompt now references
docs/tui.mdfor TUI component development
[0.37.4] - 2026-01-06
Added
- Session picker (
pi -r) and--sessionflag now support searching/resuming by session ID (UUID prefix) (#495 by @arunsathiya) - Extensions can now replace the startup header with
ctx.ui.setHeader(), seeexamples/extensions/custom-header.ts(#500 by @tudoroancea)
Changed
- Startup help text: fixed misleading "ctrl+k to delete line" to "ctrl+k to delete to end"
- Startup help text and
/hotkeys: added!!shortcut for running bash without adding output to context
Fixed
- Queued steering/follow-up messages no longer wipe unsent editor input (#503 by @tmustier)
- OAuth token refresh failure no longer crashes app at startup, allowing user to
/loginto re-authenticate (#498)
[0.37.3] - 2026-01-06
Added
- Extensions can now replace the footer with
ctx.ui.setFooter(), seeexamples/extensions/custom-footer.ts(#481) - Session ID is now forwarded to LLM providers for session-based caching (used by OpenAI Codex for prompt caching).
- Added
blockImagessetting to prevent images from being sent to LLM providers (#492 by @jsinge97) - Extensions can now send user messages via
pi.sendUserMessage()(#483)
Fixed
- Add
minimatchas a direct dependency for explicit imports. - Status bar now shows correct git branch when running in a git worktree (#490 by @kcosr)
- Interactive mode: Ctrl+V clipboard image paste now works on Wayland sessions by using
wl-pastewithxclipfallback (#488 by @ghoulr)
[0.37.2] - 2026-01-05
Fixed
- Extension directories in
settings.jsonnow respectpackage.jsonmanifests, matching global extension behavior (#480 by @prateekmedia) - Share viewer: deep links now scroll to the target message when opened via
/share - Bash tool now handles spawn errors gracefully instead of crashing the agent (missing cwd, invalid shell path) (#479 by @robinwander)
[0.37.1] - 2026-01-05
Fixed
- Share viewer: copy-link buttons now generate correct URLs when session is viewed via
/share(iframe context)
[0.37.0] - 2026-01-05
Added
- Share viewer: copy-link button on messages to share URLs that navigate directly to a specific message (#477 by @lockmeister)
- Extension example: add
claude-rulesto load.claude/rules/entries into the system prompt (#461 by @vaayne) - Headless OAuth login: all providers now show paste input for manual URL/code entry, works over SSH without DISPLAY (#428 by @ben-vargas, #468 by @crcatala)
Changed
- OAuth login UI now uses dedicated dialog component with consistent borders
- Assume truecolor support for all terminals except
dumb, empty, orlinux(fixes colors over SSH) - OpenAI Codex clean-up: removed per-thinking-level model variants, thinking level is now set separately and the provider clamps to what each model supports internally (initial implementation in #472 by @ben-vargas)
Fixed
- Messages submitted during compaction are queued and delivered after compaction completes, preserving steering and follow-up behavior. Extension commands execute immediately during compaction. (#476 by @tmustier)
- Managed binaries (
fd,rg) now stored in~/.pi/agent/bin/instead oftools/, eliminating false deprecation warnings (#470 by @mcinteerj) - Extensions defined in
settings.jsonwere not loaded (#463 by @melihmucuk) - OAuth refresh no longer logs users out when multiple pi instances are running (#466 by @Cursivez)
- Migration warnings now ignore
fd.exeandrg.exeintools/on Windows (#458 by @carlosgtrz) - CI: add
examples/extensions/with-depsto workspaces to fix typecheck (#467 by @aliou) - SDK: passing
extensions: []now disables extension discovery as documented (#465 by @aliou)
[0.36.0] - 2026-01-05
Added
- Experimental: OpenAI Codex OAuth provider support: access Codex models via ChatGPT Plus/Pro subscription using
/login openai-codex(#451 by @kim0)
[0.35.0] - 2026-01-05
This release unifies hooks and custom tools into a single "extensions" system and renames "slash commands" to "prompt templates". (#454)
Before migrating, read:
- docs/extensions.md - Full API reference
- README.md - Extensions section with examples
- examples/extensions/ - Working examples
Extensions Migration
Hooks and custom tools are now unified as extensions. Both were TypeScript modules exporting a factory function that receives an API object. Now there's one concept, one discovery location, one CLI flag, one settings.json entry.
Automatic migration:
commands/directories are automatically renamed toprompts/on startup (both~/.pi/agent/commands/and.pi/commands/)
Manual migration required:
- Move files from
hooks/andtools/directories toextensions/(deprecation warnings shown on startup) - Update imports and type names in your extension code
- Update
settings.jsonif you have explicit hook and custom tool paths configured
Directory changes:
# Before
~/.pi/agent/hooks/*.ts → ~/.pi/agent/extensions/*.ts
~/.pi/agent/tools/*.ts → ~/.pi/agent/extensions/*.ts
.pi/hooks/*.ts → .pi/extensions/*.ts
.pi/tools/*.ts → .pi/extensions/*.ts
Extension discovery rules (in extensions/ directories):
- Direct files:
extensions/*.tsor*.js→ loaded directly - Subdirectory with index:
extensions/myext/index.ts→ loaded as single extension - Subdirectory with package.json:
extensions/myext/package.jsonwith"pi"field → loads declared paths
// extensions/my-package/package.json
{
"name": "my-extension-package",
"dependencies": { "zod": "^3.0.0" },
"pi": {
"extensions": ["./src/main.ts", "./src/tools.ts"]
}
}
No recursion beyond one level. Complex packages must use the package.json manifest. Dependencies are resolved via jiti, and extensions can be published to and installed from npm.
Type renames:
HookAPI→ExtensionAPIHookContext→ExtensionContextHookCommandContext→ExtensionCommandContextHookUIContext→ExtensionUIContextCustomToolAPI→ExtensionAPI(merged)CustomToolContext→ExtensionContext(merged)CustomToolUIContext→ExtensionUIContextCustomTool→ToolDefinitionCustomToolFactory→ExtensionFactoryHookMessage→CustomMessage
Import changes:
// Before (hook)
import type { HookAPI, HookContext } from "@mariozechner/pi-coding-agent";
export default function (pi: HookAPI) { ... }
// Before (custom tool)
import type { CustomToolFactory } from "@mariozechner/pi-coding-agent";
const factory: CustomToolFactory = (pi) => ({ name: "my_tool", ... });
export default factory;
// After (both are now extensions)
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
export default function (pi: ExtensionAPI) {
pi.on("tool_call", async (event, ctx) => { ... });
pi.registerTool({ name: "my_tool", ... });
}
Custom tools now have full context access. Tools registered via pi.registerTool() now receive the same ctx object that event handlers receive. Previously, custom tools had limited context. Now all extension code shares the same capabilities:
pi.registerTool()- Register tools the LLM can callpi.registerCommand()- Register commands like/mycommandpi.registerShortcut()- Register keyboard shortcuts (shown in/hotkeys)pi.registerFlag()- Register CLI flags (shown in--help)pi.registerMessageRenderer()- Custom TUI rendering for message typespi.on()- Subscribe to lifecycle events (tool_call, session_start, etc.)pi.sendMessage()- Inject messages into the conversationpi.appendEntry()- Persist custom data in session (survives restart/branch)pi.exec()- Run shell commandspi.getActiveTools()/pi.setActiveTools()- Dynamic tool enable/disablepi.getAllTools()- List all available toolspi.events- Event bus for cross-extension communicationctx.ui.confirm()/select()/input()- User promptsctx.ui.notify()- Toast notificationsctx.ui.setStatus()- Persistent status in footer (multiple extensions can set their own)ctx.ui.setWidget()- Widget display above editorctx.ui.setTitle()- Set terminal window titlectx.ui.custom()- Full TUI component with keyboard handlingctx.ui.editor()- Multi-line text editor with external editor supportctx.sessionManager- Read session entries, get branch history
Settings changes:
// Before
{
"hooks": ["./my-hook.ts"],
"customTools": ["./my-tool.ts"]
}
// After
{
"extensions": ["./my-extension.ts"]
}
CLI changes:
# Before
pi --hook ./safety.ts --tool ./todo.ts
# After
pi --extension ./safety.ts -e ./todo.ts
Prompt Templates Migration
"Slash commands" (markdown files defining reusable prompts invoked via /name) are renamed to "prompt templates" to avoid confusion with extension-registered commands.
Automatic migration: The commands/ directory is automatically renamed to prompts/ on startup (if prompts/ doesn't exist). Works for both regular directories and symlinks.
Directory changes:
~/.pi/agent/commands/*.md → ~/.pi/agent/prompts/*.md
.pi/commands/*.md → .pi/prompts/*.md
SDK type renames:
FileSlashCommand→PromptTemplateLoadSlashCommandsOptions→LoadPromptTemplatesOptions
SDK function renames:
discoverSlashCommands()→discoverPromptTemplates()loadSlashCommands()→loadPromptTemplates()expandSlashCommand()→expandPromptTemplate()getCommandsDir()→getPromptsDir()
SDK option renames:
CreateAgentSessionOptions.slashCommands→.promptTemplatesAgentSession.fileCommands→.promptTemplatesPromptOptions.expandSlashCommands→.expandPromptTemplates
SDK Migration
Discovery functions:
discoverAndLoadHooks()→discoverAndLoadExtensions()discoverAndLoadCustomTools()→ merged intodiscoverAndLoadExtensions()loadHooks()→loadExtensions()loadCustomTools()→ merged intoloadExtensions()
Runner and wrapper:
HookRunner→ExtensionRunnerwrapToolsWithHooks()→wrapToolsWithExtensions()wrapToolWithHooks()→wrapToolWithExtensions()
CreateAgentSessionOptions:
.hooks→ removed (use.additionalExtensionPathsfor paths).additionalHookPaths→.additionalExtensionPaths.preloadedHooks→.preloadedExtensions.customToolstype changed:Array<{ path?; tool: CustomTool }>→ToolDefinition[].additionalCustomToolPaths→ merged into.additionalExtensionPaths.slashCommands→.promptTemplates
AgentSession:
.hookRunner→.extensionRunner.fileCommands→.promptTemplates.sendHookMessage()→.sendCustomMessage()
Session Migration
Automatic. Session version bumped from 2 to 3. Existing sessions are migrated on first load:
- Message role
"hookMessage"→"custom"
Breaking Changes
- Settings:
hooksandcustomToolsarrays replaced with singleextensionsarray - CLI:
--hookand--toolflags replaced with--extension/-e - Directories:
hooks/,tools/→extensions/;commands/→prompts/ - Types: See type renames above
- SDK: See SDK migration above
Changed
- Extensions can have their own
package.jsonwith dependencies (resolved via jiti) - Documentation:
docs/hooks.mdanddocs/custom-tools.mdmerged intodocs/extensions.md - Examples:
examples/hooks/andexamples/custom-tools/merged intoexamples/extensions/ - README: Extensions section expanded with custom tools, commands, events, state persistence, shortcuts, flags, and UI examples
- SDK:
customToolsoption now acceptsToolDefinition[]directly (simplified fromArray<{ path?, tool }>) - SDK:
extensionsoption acceptsExtensionFactory[]for inline extensions - SDK:
additionalExtensionPathsreplaces bothadditionalHookPathsandadditionalCustomToolPaths
[0.34.2] - 2026-01-04
[0.34.1] - 2026-01-04
Added
Changed
- Expanded keybinding documentation to list all 32 supported symbol keys with notes on ctrl+symbol behavior (#450 by @kaofelix)
[0.34.0] - 2026-01-04
Added
- Hook API:
pi.getActiveTools()andpi.setActiveTools(toolNames)for dynamically enabling/disabling tools from hooks - Hook API:
pi.getAllTools()to enumerate all configured tools (built-in via --tools or default, plus custom tools) - Hook API:
pi.registerFlag(name, options)andpi.getFlag(name)for hooks to register custom CLI flags (parsed automatically) - Hook API:
pi.registerShortcut(shortcut, options)for hooks to register custom keyboard shortcuts usingKeyId(e.g.,Key.shift("p")). Conflicts with built-in shortcuts are skipped, conflicts between hooks logged as warnings. - Hook API:
ctx.ui.setWidget(key, content)for status displays above the editor. Accepts either a string array or a component factory function. - Hook API:
theme.strikethrough(text)for strikethrough text styling - Hook API:
before_agent_starthandlers can now returnsystemPromptAppendto dynamically append text to the system prompt for that turn. Multiple hooks' appends are concatenated. - Hook API:
before_agent_starthandlers can now return multiple messages (all are injected, not just the first) /hotkeyscommand now shows hook-registered shortcuts in a separate "Hooks" section- New example hook:
plan-mode.ts- Claude Code-style read-only exploration mode:- Toggle via
/plancommand,Shift+Pshortcut, or--planCLI flag - Read-only tools:
read,bash,grep,find,ls(noedit/write) - Bash commands restricted to non-destructive operations (blocks
rm,mv,git commit,npm install, etc.) - Interactive prompt after each response: execute plan, stay in plan mode, or refine
- Todo list widget showing progress with checkboxes and strikethrough for completed items
- Each todo has a unique ID; agent marks items done by outputting
[DONE:id] - Progress updates via
agent_endhook (parses completed items from final message) /todoscommand to view current plan progress- Shows
⏸ planindicator in footer when in plan mode,📋 2/5when executing - State persists across sessions (including todo progress)
- Toggle via
- New example hook:
tools.ts- Interactive/toolscommand to enable/disable tools with session persistence - New example hook:
pirate.ts- DemonstratessystemPromptAppendto make the agent speak like a pirate - Tool registry now contains all built-in tools (read, bash, edit, write, grep, find, ls) even when
--toolslimits the initially active set. Hooks can enable any tool from the registry viapi.setActiveTools(). - System prompt now automatically rebuilds when tools change via
setActiveTools(), updating tool descriptions and guidelines to match the new tool set - Hook errors now display full stack traces for easier debugging
- Event bus (
pi.events) for tool/hook communication: shared pub/sub between custom tools and hooks - Custom tools now have
pi.sendMessage()to send messages directly to the agent session without needing the event bus sendMessage()supportsdeliverAs: "nextTurn"to queue messages for the next user prompt
Changed
- Removed image placeholders after copy & paste, replaced with inserting image file paths directly. (#442 by @mitsuhiko)
Fixed
- Fixed potential text decoding issues in bash executor by using streaming TextDecoder instead of Buffer.toString()
- External editor (Ctrl-G) now shows full pasted content instead of
[paste #N ...]placeholders (#444 by @aliou)
[0.33.0] - 2026-01-04
Breaking Changes
- Key detection functions removed from
@mariozechner/pi-tui: AllisXxx()key detection functions (isEnter(),isEscape(),isCtrlC(), etc.) have been removed. UsematchesKey(data, keyId)instead (e.g.,matchesKey(data, "enter"),matchesKey(data, "ctrl+c")). This affects hooks and custom tools that usectx.ui.custom()with keyboard input handling. (#405)
Added
- Clipboard image paste support via
Ctrl+V. Images are saved to a temp file and attached to the message. Works on macOS, Windows, and Linux (X11). (#419) - Configurable keybindings via
~/.pi/agent/keybindings.json. All keyboard shortcuts (editor navigation, deletion, app actions like model cycling, etc.) can now be customized. Supports multiple bindings per action. (#405 by @hjanuschka) /quitand/exitslash commands to gracefully exit the application. Unlike double Ctrl+C, these properly await hook and custom tool cleanup handlers before exiting. (#426 by @ben-vargas)
Fixed
- Subagent example README referenced incorrect filename
subagent.tsinstead ofindex.ts(#427 by @Whamp)
[0.32.3] - 2026-01-03
Fixed
--list-modelsno longer shows Google Vertex AI models without explicit authentication configured- JPEG/GIF/WebP images not displaying in terminals using Kitty graphics protocol (Kitty, Ghostty, WezTerm). The protocol requires PNG format, so non-PNG images are now converted before display.
- Version check URL typo preventing update notifications from working (#423 by @skuridin)
- Large images exceeding Anthropic's 5MB limit now retry with progressive quality/size reduction (#424 by @mitsuhiko)
[0.32.2] - 2026-01-03
Added
$ARGUMENTSsyntax for custom slash commands as alternative to$@for all arguments joined. Aligns with patterns used by Claude, Codex, and OpenCode. Both syntaxes remain fully supported. (#418 by @skuridin)
Changed
- Slash commands and hook commands now work during streaming: Previously, using a slash command or hook command while the agent was streaming would crash with "Agent is already processing". Now:
- Hook commands execute immediately (they manage their own LLM interaction via
pi.sendMessage()) - File-based slash commands are expanded and queued via steer/followUp
steer()andfollowUp()now expand file-based slash commands and error on hook commands (hook commands cannot be queued)prompt()accepts newstreamingBehavioroption ("steer"or"followUp") to specify queueing behavior during streaming- RPC
promptcommand now accepts optionalstreamingBehaviorfield (#420)
- Hook commands execute immediately (they manage their own LLM interaction via
Fixed
- Slash command argument substitution now processes positional arguments (
$1,$2, etc.) before all-arguments ($@,$ARGUMENTS) to prevent recursive substitution when argument values contain dollar-digit patterns like$100. (#418 by @skuridin)
[0.32.1] - 2026-01-03
Added
- Shell commands without context contribution: use
!!commandto execute a bash command that is shown in the TUI and saved to session history but excluded from LLM context. Useful for running commands you don't want the AI to see. (#414)
Fixed
- Edit tool diff not displaying in TUI due to race condition between async preview computation and tool execution
[0.32.0] - 2026-01-03
Breaking Changes
- Queue API replaced with steer/followUp: The
queueMessage()method has been split into two methods with different delivery semantics (#403):steer(text): Interrupts the agent mid-run (Enter while streaming). Delivered after current tool execution.followUp(text): Waits until the agent finishes (Alt+Enter while streaming). Delivered only when agent stops.
- Settings renamed:
queueModesetting renamed tosteeringMode. Added newfollowUpModesetting. Old settings.json files are migrated automatically. - AgentSession methods renamed:
queueMessage()→steer()andfollowUp()queueModegetter →steeringModeandfollowUpModegetterssetQueueMode()→setSteeringMode()andsetFollowUpMode()queuedMessageCount→pendingMessageCountgetQueuedMessages()→getSteeringMessages()andgetFollowUpMessages()clearQueue()now returns{ steering: string[], followUp: string[] }hasQueuedMessages()→hasPendingMessages()
- Hook API signature changed:
pi.sendMessage()second parameter changed fromtriggerTurn?: booleantooptions?: { triggerTurn?, deliverAs? }. UsedeliverAs: "followUp"for follow-up delivery. Affects both hooks and internalsendHookMessage()method. - RPC API changes:
queue_messagecommand →steerandfollow_upcommandsset_queue_modecommand →set_steering_modeandset_follow_up_modecommandsRpcSessionState.queueMode→steeringModeandfollowUpMode
- Settings UI: "Queue mode" setting split into "Steering mode" and "Follow-up mode"
Added
- Configurable double-escape action: choose whether double-escape with empty editor opens
/tree(default) or/branch. Configure via/settingsordoubleEscapeActionin settings.json (#404) - Vertex AI provider (
google-vertex): access Gemini models via Google Cloud Vertex AI using Application Default Credentials (#300 by @default-anton) - Built-in provider overrides in
models.json: override justbaseUrlto route a built-in provider through a proxy while keeping all its models, or definemodelsto fully replace the provider (#406 by @yevhen) - Automatic image resizing: images larger than 2000x2000 are resized for better model compatibility. Original dimensions are injected into the prompt. Controlled via
/settingsorimages.autoResizein settings.json. (#402 by @mitsuhiko) - Alt+Enter keybind to queue follow-up messages while agent is streaming
ThemeandThemeColortypes now exported for hooks usingctx.ui.custom()- Terminal window title now displays "pi - dirname" to identify which project session you're in (#407 by @kaofelix)
Changed
- Editor component now uses word wrapping instead of character-level wrapping for better readability (#382 by @nickseelert)
Fixed
/modelselector now opens instantly instead of waiting for OAuth token refresh. Token refresh is deferred until a model is actually used.- Shift+Space, Shift+Backspace, and Shift+Delete now work correctly in Kitty-protocol terminals (Kitty, WezTerm, etc.) instead of being silently ignored (#411 by @nathyong)
AgentSession.prompt()now throws if called while the agent is already streaming, preventing race conditions. Usesteer()orfollowUp()to queue messages during streaming.- Ctrl+C now works like Escape in selector components, so mashing Ctrl+C will eventually close the program (#400 by @mitsuhiko)
[0.31.1] - 2026-01-02
Fixed
- Model selector no longer allows negative index when pressing arrow keys before models finish loading (#398 by @mitsuhiko)
- Type guard functions (
isBashToolResult, etc.) now exported at runtime, not just in type declarations (#397)
[0.31.0] - 2026-01-02
This release introduces session trees for in-place branching, major API changes to hooks and custom tools, and structured compaction with file tracking.
Session Tree
Sessions now use a tree structure with id/parentId fields. This enables in-place branching: navigate to any previous point with /tree, continue from there, and switch between branches while preserving all history in a single file.
Existing sessions are automatically migrated (v1 → v2) on first load. No manual action required.
New entry types: BranchSummaryEntry (context from abandoned branches), CustomEntry (hook state), CustomMessageEntry (hook-injected messages), LabelEntry (bookmarks).
See docs/session.md for the file format and SessionManager API.
Hooks Migration
The hooks API has been restructured with more granular events and better session access.
Type renames:
HookEventContext→HookContextHookCommandContextis now a new interface extendingHookContextwith session control methods
Event changes:
- The monolithic
sessionevent is now split into granular events:session_start,session_before_switch,session_switch,session_before_branch,session_branch,session_before_compact,session_compact,session_shutdown session_before_switchandsession_switchevents now includereason: "new" | "resume"to distinguish between/newand/resume- New
session_before_treeandsession_treeevents for/treenavigation (hook can provide custom branch summary) - New
before_agent_startevent: inject messages before the agent loop starts - New
contextevent: modify messages non-destructively before each LLM call - Session entries are no longer passed in events. Use
ctx.sessionManager.getEntries()orctx.sessionManager.getBranch()instead
API changes:
pi.send(text, attachments?)→pi.sendMessage(message, triggerTurn?)(createsCustomMessageEntry)- New
pi.appendEntry(customType, data?)for hook state persistence (not in LLM context) - New
pi.registerCommand(name, options)for custom slash commands (handler receivesHookCommandContext) - New
pi.registerMessageRenderer(customType, renderer)for custom TUI rendering - New
ctx.isIdle(),ctx.abort(),ctx.hasQueuedMessages()for agent state (available in all events) - New
ctx.ui.editor(title, prefill?)for multi-line text editing with Ctrl+G external editor support - New
ctx.ui.custom(component)for full TUI component rendering with keyboard focus - New
ctx.ui.setStatus(key, text)for persistent status text in footer (multiple hooks can set their own) - New
ctx.ui.themegetter for styling text with theme colors ctx.exec()moved topi.exec()ctx.sessionFile→ctx.sessionManager.getSessionFile()- New
ctx.modelRegistryandctx.modelfor API key resolution
HookCommandContext (slash commands only):
ctx.waitForIdle()- wait for agent to finish streamingctx.newSession(options?)- create new sessions with optional setup callback- `ctx.fork(entryId) - fork from a specific entry, creating a new session file
ctx.navigateTree(targetId, options?)- navigate the session tree
These methods are only on HookCommandContext (not HookContext) because they can deadlock if called from event handlers that run inside the agent loop.
Removed:
hookTimeoutsetting (hooks no longer have timeouts; use Ctrl+C to abort)resolveApiKeyparameter (usectx.modelRegistry.getApiKey(model))
See docs/hooks.md and examples/hooks/ for the current API.
Custom Tools Migration
The custom tools API has been restructured to mirror the hooks pattern with a context object.
Type renames:
CustomAgentTool→CustomToolToolAPI→CustomToolAPIToolContext→CustomToolContextToolSessionEvent→CustomToolSessionEvent
Execute signature changed:
// Before (v0.30.2)
execute(toolCallId, params, signal, onUpdate)
// After
execute(toolCallId, params, onUpdate, ctx, signal?)
The new ctx: CustomToolContext provides sessionManager, modelRegistry, model, and agent state methods:
ctx.isIdle()- check if agent is streamingctx.hasQueuedMessages()- check if user has queued messages (skip interactive prompts)ctx.abort()- abort current operation (fire-and-forget)
Session event changes:
CustomToolSessionEventnow only hasreasonandpreviousSessionFile- Session entries are no longer in the event. Use
ctx.sessionManager.getBranch()orctx.sessionManager.getEntries()to reconstruct state - Reasons:
"start" | "switch" | "branch" | "tree" | "shutdown"(no separate"new"reason;/newtriggers"switch") dispose()method removed. UseonSessionwithreason: "shutdown"for cleanup
See docs/custom-tools.md and examples/custom-tools/ for the current API.
SDK Migration
Type changes:
CustomAgentTool→CustomToolAppMessage→AgentMessagesessionFilereturnsstring | undefined(wasstring | null)modelreturnsModel | undefined(wasModel | null)Attachmenttype removed. UseImageContentfrom@mariozechner/pi-aiinstead. Add images directly to message content arrays.
AgentSession API:
branch(entryIndex: number)→branch(entryId: string)getUserMessagesForBranching()returns{ entryId, text }instead of{ entryIndex, text }reset()→newSession(options?)where options has optionalparentSessionfor lineage trackingnewSession()andswitchSession()now returnPromise<boolean>(false if cancelled by hook)- New
navigateTree(targetId, options?)for in-place tree navigation
Hook integration:
- New
sendHookMessage(message, triggerTurn?)for hook message injection
SessionManager API:
- Method renames:
saveXXX()→appendXXX()(e.g.,appendMessage,appendCompaction) branchInPlace()→branch()reset()→newSession(options?)with optionalparentSessionfor lineage trackingcreateBranchedSessionFromEntries(entries, index)→createBranchedSession(leafId)SessionHeader.branchedFrom→SessionHeader.parentSessionsaveCompaction(entry)→appendCompaction(summary, firstKeptEntryId, tokensBefore, details?)getEntries()now excludes the session header (usegetHeader()separately)getSessionFile()returnsstring | undefined(undefined for in-memory sessions)- New tree methods:
getTree(),getBranch(),getLeafId(),getLeafEntry(),getEntry(),getChildren(),getLabel() - New append methods:
appendCustomEntry(),appendCustomMessageEntry(),appendLabelChange() - New branch methods:
branch(entryId),branchWithSummary()
ModelRegistry (new):
ModelRegistry is a new class that manages model discovery and API key resolution. It combines built-in models with custom models from models.json and resolves API keys via AuthStorage.
import {
discoverAuthStorage,
discoverModels,
} from "@mariozechner/pi-coding-agent";
const authStorage = discoverAuthStorage(); // ~/.pi/agent/auth.json
const modelRegistry = discoverModels(authStorage); // + ~/.pi/agent/models.json
// Get all models (built-in + custom)
const allModels = modelRegistry.getAll();
// Get only models with valid API keys
const available = await modelRegistry.getAvailable();
// Find specific model
const model = modelRegistry.find("anthropic", "claude-sonnet-4-20250514");
// Get API key for a model
const apiKey = await modelRegistry.getApiKey(model);
This replaces the old resolveApiKey callback pattern. Hooks and custom tools access it via ctx.modelRegistry.
Renamed exports:
messageTransformer→convertToLlmSessionContextaliasLoadedSessionremoved
See docs/sdk.md and examples/sdk/ for the current API.
RPC Migration
Session commands:
resetcommand →new_sessioncommand with optionalparentSessionfield
Branching commands:
branchcommand:entryIndex→entryIdget_branch_messagesresponse:entryIndex→entryId
Type changes:
- Messages are now
AgentMessage(wasAppMessage) promptcommand:attachmentsfield replaced withimagesfield usingImageContentformat
Compaction events:
auto_compaction_startnow includesreasonfield ("threshold"or"overflow")auto_compaction_endnow includeswillRetryfieldcompactresponse includes fullCompactionResult(summary,firstKeptEntryId,tokensBefore,details)
See docs/rpc.md for the current protocol.
Structured Compaction
Compaction and branch summarization now use a structured output format:
- Clear sections: Goal, Progress, Key Information, File Operations
- File tracking:
readFilesandmodifiedFilesarrays indetails, accumulated across compactions - Conversations are serialized to text before summarization to prevent the model from "continuing" them
The before_compact and before_tree hook events allow custom compaction implementations. See docs/compaction.md.
Interactive Mode
/tree command:
- Navigate the full session tree in-place
- Search by typing, page with ←/→
- Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
- Press
lto label entries as bookmarks - Selecting a branch switches context and optionally injects a summary of the abandoned branch
Entry labels:
- Bookmark any entry via
/tree→ select →l - Labels appear in tree view and persist as
LabelEntry
Theme changes (breaking for custom themes):
Custom themes must add these new color tokens or they will fail to load:
selectedBg: background for selected/highlighted items in tree selector and other componentscustomMessageBg: background for hook-injected messages (CustomMessageEntry)customMessageText: text color for hook messagescustomMessageLabel: label color for hook messages (the[customType]prefix)
Total color count increased from 46 to 50. See docs/themes.md for the full color list and copy values from the built-in dark/light themes.
Settings:
enabledModels: allowlist models insettings.json(same format as--modelsCLI)
Added
ctx.ui.setStatus(key, text)for hooks to display persistent status text in the footer (#385 by @prateekmedia)ctx.ui.themegetter for styling status text and other output with theme colors/sharecommand to upload session as a secret GitHub gist and get a shareable URL via shittycodingagent.ai (#380)- HTML export now includes a tree visualization sidebar for navigating session branches (#375)
- HTML export supports keyboard shortcuts: Ctrl+T to toggle thinking blocks, Ctrl+O to toggle tool outputs
- HTML export supports theme-configurable background colors via optional
exportsection in theme JSON (#387 by @mitsuhiko) - HTML export syntax highlighting now uses theme colors and matches TUI rendering
- Snake game example hook: Demonstrates
ui.custom(),registerCommand(), and session persistence. See examples/hooks/snake.ts. thinkingTexttheme token: Configurable color for thinking block text. (#366 by @paulbettner)
Changed
- Entry IDs: Session entries now use short 8-character hex IDs instead of full UUIDs
- API key priority:
ANTHROPIC_OAUTH_TOKENnow takes precedence overANTHROPIC_API_KEY - HTML export template split into separate files (template.html, template.css, template.js) for easier maintenance
Fixed
- HTML export now properly sanitizes user messages containing HTML tags like
<style>that could break DOM rendering - Crash when displaying bash output containing Unicode format characters like U+0600-U+0604 (#372 by @HACKE-RC)
- Footer shows full session stats: Token usage and cost now include all messages, not just those after compaction. (#322)
- Status messages spam chat log: Rapidly changing settings (e.g., thinking level via Shift+Tab) would add multiple status lines. Sequential status updates now coalesce into a single line. (#365 by @paulbettner)
- Toggling thinking blocks during streaming shows nothing: Pressing Ctrl+T while streaming would hide the current message until streaming completed.
- Resuming session resets thinking level to off: Initial model and thinking level were not saved to session file, causing
--resume/--continueto default tooff. (#342 by @aliou) - Hook
tool_resultevent ignores errors from custom tools: Thetool_resulthook event was never emitted when tools threw errors, and always hadisError: falsefor successful executions. Now emits the event with correctisErrorvalue in both success and error cases. (#374 by @nicobailon) - Edit tool fails on Windows due to CRLF line endings: Files with CRLF line endings now match correctly when LLMs send LF-only text. Line endings are normalized before matching and restored to original style on write. (#355 by @Pratham-Dubey)
- Edit tool fails on files with UTF-8 BOM: Files with UTF-8 BOM marker could cause "text not found" errors since the LLM doesn't include the invisible BOM character. BOM is now stripped before matching and restored on write. (#394 by @prathamdby)
- Use bash instead of sh on Unix: Fixed shell commands using
/bin/shinstead of/bin/bashon Unix systems. (#328 by @dnouri) - OAuth login URL clickable: Made OAuth login URLs clickable in terminal. (#349 by @Cursivez)
- Improved error messages: Better error messages when
apiKeyormodelare missing. (#346 by @ronyrus) - Session file validation:
findMostRecentSession()now validates session headers before returning, preventing non-session JSONL files from being loaded - Compaction error handling:
generateSummary()andgenerateTurnPrefixSummary()now throw on LLM errors instead of returning empty strings - Compaction with branched sessions: Fixed compaction incorrectly including entries from abandoned branches, causing token overflow errors. Compaction now uses
sessionManager.getPath()to work only on the current branch path, eliminating 80+ lines of duplicate entry collection logic betweenprepareCompaction()andcompact() - enabledModels glob patterns:
--modelsandenabledModelsnow support glob patterns likegithub-copilot/*or*sonnet*. Previously, patterns were only matched literally or via substring search. (#337)
[0.30.2] - 2025-12-26
Changed
- Consolidated migrations: Moved auth migration from
AuthStorage.migrateLegacy()to newmigrations.tsmodule.
[0.30.1] - 2025-12-26
Fixed
- Sessions saved to wrong directory: In v0.30.0, sessions were being saved to
~/.pi/agent/instead of~/.pi/agent/sessions/<encoded-cwd>/, breaking--resumeand/resume. Misplaced sessions are automatically migrated on startup. (#320 by @aliou) - Custom system prompts missing context: When using a custom system prompt string, project context files (AGENTS.md), skills, date/time, and working directory were not appended. (#321)
[0.30.0] - 2025-12-25
Breaking Changes
- SessionManager API: The second parameter of
create(),continueRecent(), andlist()changed fromagentDirtosessionDir. When provided, it specifies the session directory directly (no cwd encoding). When omitted, uses default (~/.pi/agent/sessions/<encoded-cwd>/).open()no longer takesagentDir. (#313)
Added
--session-dirflag: Use a custom directory for sessions instead of the default~/.pi/agent/sessions/<encoded-cwd>/. Works with-c(continue) and-r(resume) flags. (#313 by @scutifer)- Reverse model cycling and model selector: Shift+Ctrl+P cycles models backward, Ctrl+L opens model selector (retaining text in editor). (#315 by @mitsuhiko)
[0.29.1] - 2025-12-25
Added
- Automatic custom system prompt loading: Pi now auto-loads
SYSTEM.mdfiles to replace the default system prompt. Project-local.pi/SYSTEM.mdtakes precedence over global~/.pi/agent/SYSTEM.md. CLI--system-promptflag overrides both. (#309) - Unified
/settingscommand: New settings menu consolidating thinking level, theme, queue mode, auto-compact, show images, hide thinking, and collapse changelog. Replaces individual/thinking,/queue,/theme,/autocompact, and/show-imagescommands. (#310)
Fixed
- Custom tools/hooks with typebox subpath imports: Fixed jiti alias for
@sinclair/typeboxto point to package root instead of entry file, allowing imports like@sinclair/typebox/compilerto resolve correctly. (#311 by @kim0)
[0.29.0] - 2025-12-25
Breaking Changes
- Renamed
/clearto/new: The command to start a fresh session is now/new. Hook event reasonsbefore_clear/clearare nowbefore_new/new. Merry Christmas @mitsuhiko! (#305)
Added
- Auto-space before pasted file paths: When pasting a file path (starting with
/,~, or.) after a word character, a space is automatically prepended. (#307 by @mitsuhiko) - Word navigation in input fields: Added Ctrl+Left/Right and Alt+Left/Right for word-by-word cursor movement. (#306 by @kim0)
- Full Unicode input: Input fields now accept Unicode characters beyond ASCII. (#306 by @kim0)
Fixed
- Readline-style Ctrl+W: Now skips trailing whitespace before deleting the preceding word, matching standard readline behavior. (#306 by @kim0)
[0.28.0] - 2025-12-25
Changed
-
Credential storage refactored: API keys and OAuth tokens are now stored in
~/.pi/agent/auth.jsoninstead ofoauth.jsonandsettings.json. Existing credentials are automatically migrated on first run. (#296) -
SDK API changes (#296):
- Added
AuthStorageclass for credential management (API keys and OAuth tokens) - Added
ModelRegistryclass for model discovery and API key resolution - Added
discoverAuthStorage()anddiscoverModels()discovery functions createAgentSession()now acceptsauthStorageandmodelRegistryoptions- Removed
configureOAuthStorage(),defaultGetApiKey(),findModel(),discoverAvailableModels() - Removed
getApiKeycallback option (useAuthStorage.setRuntimeApiKey()for runtime overrides) - Use
getModel()from@mariozechner/pi-aifor built-in models,modelRegistry.find()for custom models + built-in models - See updated SDK documentation and README
- Added
-
Settings changes: Removed
apiKeysfromsettings.json. Useauth.jsoninstead. (#296)
Fixed
- Duplicate skill warnings for symlinks: Skills loaded via symlinks pointing to the same file are now silently deduplicated instead of showing name collision warnings. (#304 by @mitsuhiko)
[0.27.9] - 2025-12-24
Fixed
- Model selector and --list-models with settings.json API keys: Models with API keys configured in settings.json (but not in environment variables) now properly appear in the /model selector and
--list-modelsoutput. (#295)
[0.27.8] - 2025-12-24
Fixed
- API key priority: OAuth tokens now take priority over settings.json API keys. Previously, an API key in settings.json would trump OAuth, causing users logged in with a plan (unlimited tokens) to be billed via PAYG instead.
[0.27.7] - 2025-12-24
Fixed
- Thinking tag leakage: Fixed Claude mimicking literal
</thinking>tags in responses. Unsigned thinking blocks (from aborted streams) are now converted to plain text without<thinking>tags. The TUI still displays them as thinking blocks. (#302 by @nicobailon)
[0.27.6] - 2025-12-24
Added
-
Compaction hook improvements: The
before_compactsession event now includes:previousSummary: Summary from the last compaction (if any), so hooks can preserve accumulated contextmessagesToKeep: Messages that will be kept after the summary (recent turns), in addition tomessagesToSummarizeresolveApiKey: Function to resolve API keys for any model (checks settings, OAuth, env vars)- Removed
apiKeystring in favor ofresolveApiKeyfor more flexibility
-
SessionManager API cleanup:
- Renamed
loadSessionFromEntries()tobuildSessionContext()(builds LLM context from entries, handling compaction) - Renamed
loadEntries()togetEntries()(returns defensive copy of all session entries) - Added
buildSessionContext()method to SessionManager
- Renamed
[0.27.5] - 2025-12-24
Added
- HTML export syntax highlighting: Code blocks in markdown and tool outputs (read, write) now have syntax highlighting using highlight.js with theme-aware colors matching the TUI.
- HTML export improvements: Render markdown server-side using marked (tables, headings, code blocks, etc.), honor user's chosen theme (light/dark), add image rendering for user messages, and style code blocks with TUI-like language markers. (@scutifer)
Fixed
- Ghostty inline images in tmux: Fixed terminal detection for Ghostty when running inside tmux by checking
GHOSTTY_RESOURCES_DIRenv var. (#299 by @nicobailon)
[0.27.4] - 2025-12-24
Fixed
- Symlinked skill directories: Skills in symlinked directories (e.g.,
~/.pi/agent/skills/my-skills -> /path/to/skills) are now correctly discovered and loaded.
[0.27.3] - 2025-12-24
Added
- API keys in settings.json: Store API keys in
~/.pi/agent/settings.jsonunder theapiKeysfield (e.g.,{ "apiKeys": { "anthropic": "sk-..." } }). Settings keys take priority over environment variables. (#295)
Fixed
- Allow startup without API keys: Interactive mode no longer throws when no API keys are configured. Users can now start the agent and use
/loginto authenticate. (#288) --system-promptfile path support: The--system-promptargument now correctly resolves file paths (like--append-system-promptalready did). (#287 by @scutifer)
[0.27.2] - 2025-12-23
Added
- Skip conversation restore on branch: Hooks can return
{ skipConversationRestore: true }frombefore_branchto create the branched session file without restoring conversation messages. Useful for checkpoint hooks that restore files separately. (#286 by @nicobarray)
[0.27.1] - 2025-12-22
Fixed
- Skill discovery performance: Skip
node_modulesdirectories when recursively scanning for skills. Fixes ~60ms startup delay when skill directories contain npm dependencies.
Added
- Startup timing instrumentation: Set
PI_TIMING=1to see startup performance breakdown (interactive mode only).
[0.27.0] - 2025-12-22
Breaking
- Session hooks API redesign: Merged
branchevent intosessionevent.BranchEvent,BranchEventResulttypes andpi.on("branch", ...)removed. Usepi.on("session", ...)withreason: "before_branch" | "branch"instead.AgentSession.branch()returns{ cancelled }instead of{ skipped }.AgentSession.reset()andswitchSession()now returnboolean(false if cancelled by hook). RPC commandsreset,switch_session, andbranchnow includecancelledin response data. (#278)
Added
- Session lifecycle hooks: Added
before_*variants (before_switch,before_clear,before_branch) that fire before actions and can be cancelled with{ cancel: true }. Addedshutdownreason for graceful exit handling. (#278)
Fixed
-
File tab completion display: File paths no longer get cut off early. Folders now show trailing
/and removed redundant "directory"/"file" labels to maximize horizontal space. (#280) -
Bash tool visual line truncation: Fixed bash tool output in collapsed mode to use visual line counting (accounting for line wrapping) instead of logical line counting. Now consistent with bash-execution.ts behavior. Extracted shared
truncateToVisualLinesutility. (#275)
[0.26.1] - 2025-12-22
Fixed
- SDK tools respect cwd: Core tools (bash, read, edit, write, grep, find, ls) now properly use the
cwdoption fromcreateAgentSession(). Added tool factory functions (createBashTool,createReadTool, etc.) for SDK users who specify customcwdwith explicit tools. (#279)
[0.26.0] - 2025-12-22
Added
-
SDK for programmatic usage: New
createAgentSession()factory with full control over model, tools, hooks, skills, session persistence, and settings. Philosophy: "omit to discover, provide to override". Includes 12 examples and comprehensive documentation. (#272) -
Project-specific settings: Settings now load from both
~/.pi/agent/settings.json(global) and<cwd>/.pi/settings.json(project). Project settings override global with deep merge for nested objects. Project settings are read-only (for version control). (#276) -
SettingsManager static factories:
SettingsManager.create(cwd?, agentDir?)for file-based settings,SettingsManager.inMemory(settings?)for testing. AddedapplyOverrides()for programmatic overrides. -
SessionManager static factories:
SessionManager.create(),SessionManager.open(),SessionManager.continueRecent(),SessionManager.inMemory(),SessionManager.list()for flexible session management.
[0.25.4] - 2025-12-22
Fixed
- Syntax highlighting stderr spam: Fixed cli-highlight logging errors to stderr when markdown contains malformed code fences (e.g., missing newlines around closing backticks). Now validates language identifiers before highlighting and falls back silently to plain text. (#274)
[0.25.3] - 2025-12-21
Added
-
Gemini 3 preview models: Added
gemini-3-pro-previewandgemini-3-flash-previewto the google-gemini-cli provider. (#264 by @LukeFost) -
External editor support: Press
Ctrl+Gto edit your message in an external editor. Uses$VISUALor$EDITORenvironment variable. On successful save, the message is replaced; on cancel, the original is kept. (#266 by @aliou) -
Process suspension: Press
Ctrl+Zto suspend pi and return to the shell. Resume withfgas usual. (#267 by @aliou) -
Configurable skills directories: Added granular control over skill sources with
enableCodexUser,enableClaudeUser,enableClaudeProject,enablePiUser,enablePiProjecttoggles, pluscustomDirectoriesandignoredSkillssettings. (#269 by @nicobailon) -
Skills CLI filtering: Added
--skills <patterns>flag for filtering skills with glob patterns. Also addedincludeSkillssetting and glob pattern support forignoredSkills. (#268)