cd /news/ai-agents/show-hn-pi-tva-toolbox-session-tree-… · home › topics › ai-agents › article
[ARTICLE · art-182190] src=github.com ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Show HN: Pi-tva-toolbox Session-tree tools for the Pi coding agent

Developer Ariel Sakin published pi-tva-toolbox, an open-source package of four extensions for pi, the terminal coding agent, that manipulate a session's tree of branches. The extensions are pi-time-heist (forks a session from any point into a different working directory), pi-fork-off (asks several questions in parallel and continues each answer as a labeled branch), pi-pluck (forgets every turn matching a regex on the active branch, with /unpluck to restore), and pi-fresh (/fresh and /clear start a fresh branch at the session root). The toolbox requires pi 1.x and Node >= 22.19, collects no telemetry, and installs via `pi install npm:pi-tva-toolbox` or as four separately published npm packages.

key takeaway

pi-tva-toolbox adds four pi extensions — /heist, /fork-off, /pluck and /fresh — that rewind, fork, forget and reset branches of a pi session tree, installable as one npm package or four separate ones on pi 1.x and Node >= 22.19.

read4 min views10 publishedDec 5, 2026
Show HN: Pi-tva-toolbox Session-tree tools for the Pi coding agent
Image: Michielbdejong (auto-discovered)

pi-tva-toolbox — Tree · Versions · Alternatives. Session-tree tools for pi, the terminal coding agent.

pi keeps every session as a tree of branches (/tree). These tools rewind, fan out, forget, and move those branches: rewinding a session to its first message, forking one point into several labeled branches, forgetting selected turns on the active branch, and forking a branch into a different working directory.

Requires pi 1.x and Node >= 22.19. The extensions collect no telemetry. Parallel questions in /fork-off use your configured model provider.

Vocabulary: a session tree is the whole history of a session; a branch is one path through it; the active branch is the one the model sees; a turn is one user message and the reply to it; rewind moves the active branch back to an earlier point; fork starts a new branch from a point.

Extension Trigger What it does
pi-time-heist fork, then /heist Fork a session from any point in its tree into a different working directory
pi-fork-off /fork-off Ask several questions in parallel and continue each answer as a labeled branch
pi-pluck /pluck Forget every turn matching a regex on the active branch (one note appended, nothing cloned or deleted); /unpluck restores
pi-fresh /fresh ,/clear Start a fresh branch at the root of the session, optionally with a label and branch summary

The whole toolbox, one package:

pi install npm:pi-tva-toolbox

Or any extension on its own — each is published separately on npm:

pi install npm:pi-time-heist
pi install npm:pi-fork-off
pi install npm:pi-pluck
pi install npm:pi-fresh

Or straight from git (the toolbox):

pi install git:github.com/asakin/pi-tva-toolbox

To load only some of the toolbox's extensions, use the object form in your settings:

{
  "packages": [
    {
      "source": "npm:pi-tva-toolbox",
      "extensions": ["node_modules/pi-time-heist/src/index.ts"]
    }
  ]
}

This repo contains four extensions, the umbrella package, and a shared library. Every tool under extensions/ is its own npm workspace and npm package (pi-*), and the root pi-tva-toolbox is an umbrella that depends on all of them, bundles them (bundleDependencies), and points pi.extensions at node_modules/<tool>/src/index.ts. Shared internals live in lib/ (@arielsakin/pi-tva-lib, TypeScript source, a plain runtime dependency of pi-time-heist).

Why an umbrella rather than one package: each tool stays installable and versionable on its own, while pi install npm:pi-tva-toolbox gives the whole set in one step. The pack test (scripts/pack.test.mjs) keeps the two in agreement by checking that every pi.extensions path and every bundled package is inside the umbrella tarball.

In the checkout, npm install symlinks every workspace into node_modules/, so the root's node_modules/... paths resolve to the live sources. Run it before the path-install below.

Do not symlink into ~/.pi/agent/extensions/. Path-install the checkout so pi loads it as a package (no copy; edits are live):

pi install "$(pwd)"
pi list

pi stores the path relative to ~/.pi/agent/settings.json, so pi list shows a ../../... line followed by the resolved absolute path. That is normal.

Then /reload in pi (or restart) so the listed extensions load.

To reset and redo:

pi remove "$(pwd)"
pi install "$(pwd)"
npm install
npm run check      # typecheck lib/ and every workspace
npm test           # node --test in every workspace, plus the pack test

Extensions are plain TypeScript, loaded by pi through jiti. There is no build step.

To ship a new tool: add the workspace under extensions/, add it to the root dependencies + bundleDependencies, and append its entry path to the root pi.extensions array.

All packages move in lockstep:

npm run version:set 0.1.0   # root, lib, every extension, and every internal pin

Commit, push main, and push tag v0.1.0. .github/workflows/publish.yml checks the tag against the version, runs check + test, then publishes the lib, each extension, and the umbrella via trusted publishing (skipping any package whose version is already on the registry). No tokens, no approvals. Then create the GitHub release.

The first bootstrap publish of every package (0.0.0) is manual, because each package's trusted publisher is configured in its own npmjs.com settings, which exist only once the package does:

  1. npm run version:set 0.0.0 , thennpm ci --ignore-scripts && npm run check && npm test .
  2. npm publish -w lib , thennpm publish -w extensions/<tool> for each extension, thennpm publish at the root for the umbrella.
  3. On npmjs.com, add the GitHub Actions trusted publisher (this repo, publish.yml ,Allow npm publish ticked) to each package's settings.
  4. Bump to 0.1.0 (npm run version:set 0.1.0 ), updateCHANGELOG.md , commit, pushmain and tagv0.1.0 , and unpublish the0.0.0 placeholders.
── more in #ai-agents 4 stories · sorted by recency
── more on @pi-tva-toolbox 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/show-hn-pi-tva-toolb…] indexed:0 read:4min 2026-12-05 · —