The Pi Coding Harness: pi.dev, Extensions & Token Economics

Everything about pi, the terminal coding agent you can extend: sessions and the TUI, models and providers, the TypeScript extension API, skills, prompt templates, pi packages, compaction and token economics, and headless SDK/RPC modes โ€” then the oh-my-pi (omp) fork, and how to decide between vanilla pi and omp.

intermediate 90 min 11 lessons

Lessons

  • Meet Pi โ€” the Terminal Agent That's Yours

    What a coding harness is, where pi comes from (Mario Zechner, pi-mono, Earendil Inc.), installing and authenticating, the four areas of the TUI, and the token dashboard in the footer.

    8 min
  • Sessions, Trees & the TUI

    Session storage as JSONL trees, /tree /fork /clone /resume, editor features (@ refs, ! vs !! commands), the message queue, and the token-saving power of ephemeral and forked sessions.

    8 min
  • Models & Providers โ€” Choose Your Engine

    The providers system, custom providers and models in models.json (API dialects, cost fields, key resolution), thinking levels and budgets, and local inference with llama.cpp โ€” the biggest token lever of all.

    8 min
  • Extensions โ€” Rewire the Harness in TypeScript

    The extension API: locations, registerTool/registerCommand/registerShortcut, lifecycle events, ctx.ui, state persistence, and extension patterns โ€” including extensions as a token-control plane (ctx.compact, ctx.getContextUsage, input rewriting).

    10 min
  • Skills & Prompt Templates

    The Agent Skills standard, SKILL.md structure and locations, on-demand loading, and prompt templates with arguments โ€” plus why on-demand skills are the textbook token-saving pattern.

    8 min
  • Pi Packages & Themes

    Distribution for extensions, skills, templates, and themes via npm/git, package filtering and scoping, the pi.dev gallery, and why every installed resource is a standing token tax.

    6 min
  • Token Economics โ€” Compaction, Caching & Context Budgets

    How auto-compaction works (reserveTokens, keepRecentTokens, iterative summaries, branch summarization), prompt-cache awareness, custom summarizers via extensions, and a ten-item token-saving checklist.

    10 min
  • Headless Pi โ€” SDK, RPC & JSON Modes

    One-shot prompts, JSON event stream and RPC modes, the @earendil-works SDK, sessions as portable JSONL data โ€” and why scripted, deterministic pi runs are a token-efficiency win.

    6 min
  • Oh My Pi (omp) โ€” the Rust-Powered Fork

    What omp is, how to install it, the feature tour (hashline edits, eval kernels, LSP/DAP, subagents, advisor, stream rules, memory, collab), model roles, and the token-efficiency claims behind the headline numbers.

    10 min
  • Vanilla Pi vs Oh My Pi โ€” the Decision Guide

    Head-to-head comparison, decision criteria for each harness, token-efficiency trade-offs (four-tool minimalism vs 31-tool batteries-included), and practical advice to run both.

    8 min
  • Grand Quiz โ€” The Pi Coding Harness

    Twenty questions across all ten lessons with a scored, graded result panel. The final retrieval-practice pass.

    10 min