{"slug": "show-hn-pi-tva-toolbox-session-tree-tools-for-the-pi-coding-agent", "title": "Show HN: Pi-tva-toolbox Session-tree tools for the Pi coding agent", "summary": "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.", "body_md": "pi-tva-toolbox — Tree · Versions · Alternatives. Session-tree tools for\n[pi](https://pi.dev), the terminal coding agent.\n\npi keeps every session as a tree of branches (`/tree`). These tools rewind, fan out,\nforget, and move those branches: rewinding a session to its first message, forking one\npoint into several labeled branches, forgetting selected turns on the active branch, and\nforking a branch into a different working directory.\n\nRequires pi 1.x and Node >= 22.19. The extensions collect no telemetry. Parallel questions in\n`/fork-off` use your configured model provider.\n\nVocabulary: a *session tree* is the whole history of a session; a *branch* is one path\nthrough it; the *active branch* is the one the model sees; a *turn* is one user message\nand the reply to it; *rewind* moves the active branch back to an earlier point; *fork*\nstarts a new branch from a point.\n\n| Extension | Trigger | What it does | \n|---|---|---|\n| [pi-time-heist](https://github.com/asakin/pi-tva-toolbox/blob/main/extensions/pi-time-heist) | fork, then `/heist` | Fork a session from any point in its tree into a *different* working directory | \n| [pi-fork-off](https://github.com/asakin/pi-tva-toolbox/blob/main/extensions/pi-fork-off) | `/fork-off` | Ask several questions in parallel and continue each answer as a labeled branch | \n| [pi-pluck](https://github.com/asakin/pi-tva-toolbox/blob/main/extensions/pi-pluck) | `/pluck` | Forget every turn matching a regex on the active branch (one note appended, nothing cloned or deleted); `/unpluck` restores | \n| [pi-fresh](https://github.com/asakin/pi-tva-toolbox/blob/main/extensions/pi-fresh) | `/fresh` ,`/clear` | Start a fresh branch at the root of the session, optionally with a label and branch summary | \n\nThe whole toolbox, one package:\n\n```\npi install npm:pi-tva-toolbox\n```\n\nOr any extension on its own — each is published separately on npm:\n\n```\npi install npm:pi-time-heist\npi install npm:pi-fork-off\npi install npm:pi-pluck\npi install npm:pi-fresh\n```\n\nOr straight from git (the toolbox):\n\n```\npi install git:github.com/asakin/pi-tva-toolbox\n```\n\nTo load only some of the toolbox's extensions, use the object form in your settings:\n\n```\n{\n  \"packages\": [\n    {\n      \"source\": \"npm:pi-tva-toolbox\",\n      \"extensions\": [\"node_modules/pi-time-heist/src/index.ts\"]\n    }\n  ]\n}\n```\n\nThis repo contains four extensions, the umbrella package, and a shared library. Every tool under\n`extensions/` is its own npm workspace and npm package (`pi-*`), and the\nroot `pi-tva-toolbox` is an umbrella that depends on all of them, bundles them\n(`bundleDependencies`), and points `pi.extensions` at\n`node_modules/<tool>/src/index.ts`. Shared internals live in `lib/`\n(`@arielsakin/pi-tva-lib`, TypeScript source, a plain runtime dependency of\npi-time-heist).\n\nWhy an umbrella rather than one package: each tool stays installable and versionable\non its own, while `pi install npm:pi-tva-toolbox` gives the whole set in one step.\nThe pack test (`scripts/pack.test.mjs`) keeps the two in agreement by checking that\nevery `pi.extensions` path and every bundled package is inside the umbrella tarball.\n\nIn the checkout, `npm install` symlinks every workspace into `node_modules/`, so the\nroot's `node_modules/...` paths resolve to the live sources. Run it before the\npath-install below.\n\nDo not symlink into `~/.pi/agent/extensions/`. Path-install the checkout so pi loads it\nas a package (no copy; edits are live):\n\n```\n# from the repo root\npi install \"$(pwd)\"\npi list\n```\n\npi stores the path relative to `~/.pi/agent/settings.json`, so `pi list` shows a\n`../../...` line followed by the resolved absolute path. That is normal.\n\nThen `/reload` in pi (or restart) so the listed extensions load.\n\nTo reset and redo:\n\n```\npi remove \"$(pwd)\"\npi install \"$(pwd)\"\nnpm install\nnpm run check      # typecheck lib/ and every workspace\nnpm test           # node --test in every workspace, plus the pack test\n```\n\nExtensions are plain TypeScript, loaded by pi through jiti. There is no build step.\n\nTo ship a new tool: add the workspace under `extensions/`, add it to the root\n`dependencies` + `bundleDependencies`, and append its entry path to the root\n`pi.extensions` array.\n\nAll packages move in lockstep:\n\n```\nnpm run version:set 0.1.0   # root, lib, every extension, and every internal pin\n```\n\nCommit, push `main`, and push tag `v0.1.0`. `.github/workflows/publish.yml` checks\nthe tag against the version, runs check + test, then publishes the lib, each\nextension, and the umbrella via trusted publishing (skipping any package whose\nversion is already on the registry). No tokens, no approvals. Then create the GitHub\nrelease.\n\nThe first bootstrap publish of every package (`0.0.0`) is manual, because each\npackage's trusted publisher is configured in its own npmjs.com settings, which exist\nonly once the package does:\n\n1. `npm run version:set 0.0.0` , then`npm ci --ignore-scripts && npm run check && npm test` .\n2. `npm publish -w lib` , then`npm publish -w extensions/<tool>` for each extension,\nthen`npm publish` at the root for the umbrella.\n3. On npmjs.com, add the GitHub Actions trusted publisher (this repo, `publish.yml` ,**Allow npm publish** ticked) to each package's settings.\n4. Bump to `0.1.0` (`npm run version:set 0.1.0` ), update`CHANGELOG.md` , commit,\npush`main` and tag`v0.1.0` , and unpublish the`0.0.0` placeholders.", "url": "https://wpnews.pro/news/show-hn-pi-tva-toolbox-session-tree-tools-for-the-pi-coding-agent", "canonical_source": "https://github.com/asakin/pi-tva-toolbox", "published_at": "2026-12-05 00:26:55+00:00", "updated_at": "2026-12-05 00:43:02.917511+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["pi-tva-toolbox", "pi", "Ariel Sakin", "pi-time-heist", "pi-fork-off", "pi-pluck", "pi-fresh", "Node"], "also_reported_by": [], "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.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-pi-tva-toolbox-session-tree-tools-for-the-pi-coding-agent", "markdown": "https://wpnews.pro/news/show-hn-pi-tva-toolbox-session-tree-tools-for-the-pi-coding-agent.md", "text": "https://wpnews.pro/news/show-hn-pi-tva-toolbox-session-tree-tools-for-the-pi-coding-agent.txt", "jsonld": "https://wpnews.pro/news/show-hn-pi-tva-toolbox-session-tree-tools-for-the-pi-coding-agent.jsonld"}}