Pi

A minimal coding harness built to be extended

Pi starts with a compact terminal interface and a small set of tools. Amox Pi Extensions Lean adds seven separately installable packages, including lean tool wrappers, terminal summaries, and routing for delegated work.

Pi terminal session with a detailed answer about CUDA and a High Level summary card below it.

Pi’s design

Pi keeps its default terminal sparse, with a short base prompt and four tools for reading, editing, writing, and running commands. Its extension API exposes hooks for tools, slash commands, and terminal UI so users can assemble workflows from independently installed packages.

Codex ships more built-in workflows, including code review and subagent delegation, along with model-specific instructions. Those different defaults show up in base prompt length.

Pi 1.7.0
2,300
Codex 0.164.0 · GPT-6 Astra
21,400
Approximate character counts for Pi’s system prompt with four default tools and Codex’s bundled instruction template, before tool schemas and conversation messages. Codex model catalog

Why Lean?

Lean wrappers reduce the amount of tool text Pi carries into a session and keep the everyday options easy to find.

  • Across four wrappers, registered tool declarations shrink by about 84% under a character-based measure.
  • Common parameters stay visible, while rare options remain available through help or JSON input where supported.
  • The wrappers keep upstream behavior by using pinned upstream runtimes and validating inputs.

Models with stronger instruction following can often work from shorter tool definitions when the purpose, inputs, and constraints are clear.

OpenAI’s GPT-5.6 Sol prompting guide recommends starting with a working prompt and removing repeated instructions or tool descriptions one group at a time, then running the same evaluations. kunkun9527’s Pi guide applies a similar idea to extensions. It keeps constraints in schemas and code and moves rarely needed options into on-demand help. OpenAI prompting guide · 省掉 91% 的工具提示词

Upstream tool definitions
12,914
Lean tool definitions
2,079
Registered tool declarations for four wrappers, measured in estimated tokens using a fixed character-based formula.

High Level

High Level makes long Pi sessions easier to revisit. A compact terminal card shows the main points first, and the full reply remains available for detail. The card stays outside later model context.

The /hl-history command lists cards from all branches of the current session, with options to open the original reply or regenerate the card.

Users can request a card with +hl or /hl. When a threshold mode is enabled, High Level also generates cards automatically for replies past a character or line limit. Each summary uses a separate provider request with its own model and thinking settings. In the terminal, High Level integrates with a clickable HL pill in pi-starline and falls back to native Pi menus when Starline is absent.

A reply and its High Level card

Pi generated this 218-word reply for a sample documentation project, and the +hl marker produced the accompanying card.

Original reply

The sample documentation project now indexes documentation at build time and stores each section’s title, heading, and URL. Search results present the page title and the matching heading, and each result links to the corresponding section anchor. The build completed successfully, and the keyboard navigation checks passed. At present, the reported results cover the build and keyboard navigation checks only.

Including the section heading in each result helps distinguish multiple matches from the same page. A reader can identify which passage is relevant without opening the page first. The link to the section anchor allows the reader to move directly to that passage rather than scanning the full document.

Because the index is generated data, source changes are not reflected until a fresh build runs. Editing a heading, anchor, or title in the source does not update stored entries automatically. A rebuild regenerates the section data and keeps results consistent with the current documentation.

Future checks could cover duplicated headings, renamed anchors, and an empty query. Duplicated headings would test whether results remain distinguishable when section labels repeat. Renamed anchors would test whether links continue to reach the intended passage after source changes. An empty query would test the interface’s behavior when no search term is supplied. These checks are suggested and have not been reported as completed.

High Level card

  • The project now builds a docs index at build time storing each section’s title, heading, and URL; results show the page title and heading and link to the section anchor.
  • Build and keyboard navigation checks passed; only those checks are currently reported.
  • Headings distinguish multiple matches from the same page, while anchor links take readers directly to the relevant passage.
  • Since the index is generated data, source changes require a fresh build to stay consistent.
  • Future checks are suggested for duplicated headings, renamed anchors, and an empty query; these are not yet reported as tested.

Task Router

Task Router lets the main agent choose a subagent configuration for each task. Simple and complex tasks can go to different model and thinking-level combinations even when they share the same role, such as coding.

Users describe the work and any division of labor in plain language. The main agent breaks the request into subtasks, assigns roles such as search, coding, and verify, and brings the results together. Each role defines the job, its instructions, and the Pi tools available to the worker.

Within a role, the main agent reads the task description alongside each candidate’s when guidance, so the fit depends on how well it judges the task’s scope, complexity, and risk.

Candidate selection in the coding role

This coding role defines three candidate configurations, each pairing a model with a thinking level and guidance on when to use it. The main agent can pick DeepSeek Flash at high for a low-risk rename, or step up to max on the same model for a standard implementation with clear boundaries. A complex parser change affecting several modules can go to GPT-6.2 Sol at xhigh.

[roles.coding]
# Role description, instructions, and tool template omitted.
model = "deepseek-flash"
provider = "sub2api-mixed"
effort = "max"
when = "Default implementation with clear boundaries; use a stronger candidate for complex judgment or cross-module coordination"
options = [
  { model = "deepseek-flash", provider = "sub2api-mixed", effort = "high", when = "Low-risk mechanical changes with clear boundaries" },
  { model = "gpt-6.2-sol", provider = "sub2api-gpt-only", effort = "xhigh", when = "Extremely complex implementation, or tasks explicitly identified as exceeding the capabilities of default candidates." }
]

Extension packages

  • pi-web-access-leanWeb search, claim verification, page fetching, stored-result pagination, and local PDF extraction.
  • rpiv-todo-leanSession task lists, dependencies, batch creation, and a collapsible progress panel.
  • pi-subagents-leanInline and background subagents, mid-flight steering, result inspection, and scripted workflows.
  • pi-task-router-leanRole-based routing by model, thinking level, and Pi tool allowlist from routing.toml.
  • pi-goal-x-leanPersistent goals, milestone tracking, and completion auditing kept under parent-session ownership.
  • amox-pi-syncByte-preserving sync of raw Pi sessions and missions over a private SSH Git repository, with backup and cleanup commands.
  • amox-high-levelDisplay-only terminal summary cards with branch-aware history, kept outside later model context.

Upstream credit and maintenance

Each package has its own version and can be installed separately. The web, todo, and subagent wrappers adapt work by kunkun9527 over the upstream engines by nicobailon, juicesharp, and tintinweb. The Goal wrapper sits over tmonk’s runtime, and Sync and High Level build on work by MuratAitov and z472421519.

Upstream projects and contributors · Maintenance policy

All projects