Flexible Windows shell configuration: The bash tool now supports multiple shell sources beyond Git Bash. Resolution order: (1) custom shellPath in settings.json, (2) Git Bash in standard locations, (3) any bash.exe on PATH. This enables Cygwin, MSYS2, and other bash environments. Configure with ~/.pi/agent/settings.json: {"shellPath": "C:\\cygwin64\\bin\\bash.exe"}.
Editor crash with emojis/CJK characters: Fixed crash when pasting or typing text containing wide characters (emojis like ✅, CJK characters) that caused line width to exceed terminal width. The editor now uses grapheme-aware text wrapping with proper visible width calculation.
Faster startup: Version check now runs in parallel with TUI initialization instead of blocking startup for up to 1 second. Update notifications appear in chat when the check completes.
Footer display: Token counts now use M suffix for millions (e.g., 10.2M instead of 10184k). Context display shortened from 61.3% of 200k to 61.3%/200k.
Added
Fuzzy search models and sessions: Implemented a simple fuzzy search for models and sessions (e.g., codexmax now finds gpt-5.1-codex-max). (#122 by @markusylisiurunen)
Prompt History Navigation: Browse previously submitted prompts using Up/Down arrow keys when the editor is empty. Press Up to cycle through older prompts, Down to return to newer ones or clear the editor. Similar to shell history and Claude Code's prompt history feature. History is session-scoped and stores up to 100 entries. (#121 by @nicobailon)
/resume Command: Switch to a different session mid-conversation. Opens an interactive selector showing all available sessions. Equivalent to the --resume CLI flag but can be used without restarting the agent. (#117 by @hewliyang)
Compaction UI: Simplified collapsed compaction indicator to show warning-colored text with token count instead of styled banner. Removed redundant success message after compaction. (#108)
Added
authHeader option in models.json: Custom providers can set "authHeader": true to automatically add Authorization: Bearer <apiKey> header. Useful for providers that require explicit auth headers. (#81)
--append-system-prompt Flag: Append additional text or file contents to the system prompt. Supports both inline text and file paths. Complements --system-prompt for layering custom instructions without replacing the base system prompt. (#114 by @markusylisiurunen)
Thinking Block Toggle: Added Ctrl+T shortcut to toggle visibility of LLM thinking blocks. When toggled off, shows a static "Thinking..." label instead of full content. Useful for reducing visual clutter during long conversations. (#113 by @markusylisiurunen)
/copy Command: Copy the last agent message to clipboard. Works cross-platform (macOS, Windows, Linux). Useful for extracting text from rendered Markdown output. (#105 by @markusylisiurunen)
Compacted sessions show a collapsible summary in the TUI (toggle with o key)
HTML exports include compaction summaries as collapsible sections
RPC mode supports {"type":"compact"} command and auto-compaction (emits compaction events)
Branch Source Tracking: Branched sessions now store branchedFrom in the session header, containing the path to the original session file. Useful for tracing session lineage.
Forking/Rebranding Support: All branding (app name, config directory, environment variable names) is now configurable via piConfig in package.json. Forks can change piConfig.name and piConfig.configDir to rebrand the CLI without code changes. Affects CLI banner, help text, config paths, and error messages. (#95)
RPC Termination Safeguard: When running as an RPC worker (stdin pipe detected), the CLI now exits immediately if the parent process terminates unexpectedly. Prevents orphaned RPC workers from persisting indefinitely and consuming system resources.
Rate limit handling: Anthropic rate limit errors now trigger automatic retry with exponential backoff (base 10s, max 5 retries). Previously these errors would abort the request immediately.
Usage tracking during retries: Retried requests now correctly accumulate token usage from all attempts, not just the final successful one. Fixes artificially low token counts when requests were retried.
-p, --print Flag: Run in non-interactive batch mode. Processes input message or piped stdin without TUI, prints agent response directly to stdout. Ideal for scripting, piping, and CI/CD integration. Exits after first response.
-P, --print-streaming Flag: Like -p, but streams response tokens as they arrive. Use --print-streaming --no-markdown for raw unformatted output.
--print-turn Flag: Continue processing tool calls and agent turns until the agent naturally finishes or requires user input. Combine with -p for complete multi-turn conversations.
--no-markdown Flag: Output raw text without Markdown formatting. Useful when piping output to tools that expect plain text.
Streaming Print Mode: Added internal printStreaming option for streaming output in non-TUI mode.
RPC Mode print Command: Send {"type":"print","content":"text"} to get formatted print output via print_output events.
Auto-Save in Print Mode: Print mode conversations are automatically saved to the session directory, allowing later resumption with --continue.
Thinking level options: Added --thinking-off, --thinking-minimal, --thinking-low, --thinking-medium, --thinking-high flags for directly specifying thinking level without the selector UI.
Changed
Simplified RPC Protocol: Replaced the prompt wrapper command with direct message objects. Send {"role":"user","content":"text"} instead of {"type":"prompt","message":"text"}. Better aligns with message format throughout the codebase.
RPC Message Handling: Agent now processes raw message objects directly, with timestamp auto-populated if missing.
Absolute glob patterns (e.g., /Users/foo/**/*.ts) are now handled correctly. Previously the leading / was being stripped, causing the pattern to be interpreted relative to the current directory.
Fix read path traversal vulnerability. Paths are now validated to prevent reading outside the working directory or its parents. The read tool can read from cwd, its ancestors (for config files), and all descendants. Symlinks are resolved before validation.