pi-lean-ctx
Pi Coding Agent extension — routes bash/read/grep/find/ls through lean-ctx for strong token savings. The embedded MCP bridge (on by default) adds a persistent session cache so unchanged re-reads cost ~13 tokens.
Install
pi install npm:pi-lean-ctx
Installs from npm into ~/.pi/agent/.
Add -l for project-local (.pi/). Manage with pi list / pi update / pi remove.
What this package can reach
Detected automatically from the source at
version 3.9.13.
This describes access, not safety — you decide whether it's appropriate for what
the package claims to do.
- Commands — Runs shell commands Spawns processes on your machine.
- Files — Reads files outside your project Touches paths beyond the working directory, such as your home folder.
- Intercepts tools — Can block or rewrite tool calls Subscribes to tool_call/tool_result/input. Can change a command after you approved the one displayed.
- Tool control — Can switch pi's tools on and off Calls setActiveTools, so it can disable built-ins — including safety-relevant ones.
- New tools — Adds model-callable tools Gives the agent new abilities. Additive and visible, unlike an override.
- UI — Draws its own interface Renders widgets, footers, dialogs or full-screen views.
What it actually did when run
observedLoaded in a sandbox with no network, a read-only filesystem and a recording stand-in for pi's API. This is what it called — not what the source suggests it might.
Tools registered ctx_shellctx_readctx_lsctx_findctx_greplean_ctxctx_edit
Events subscribed session_shutdowntool_result
APIs called getActiveToolsgetActiveTools.filterregisterCommandregisterToolui.notify
1 call the source scan did not predict
getActiveTools.filter
Reached through a value the scan could not follow — passed as an argument, stored on another object, or returned by a helper.
Run against version 3.9.13 on 2026-08-01.
Registration-time behaviour under default settings; other configurations may differ.
Reviews
0 publishedSign in with GitHub to write a review, reply, or vote.
No reviews yet — be the first.
More in Bridges
- pi-roam — Post-hoc handoff of a live Pi session into tmux for remote continuation, with optional Tai…
- pi-tldraw — Pi extension that opens and persists a local tldraw MCP canvas.
- @qianhuan-lxs/pi-mcp-bridge — Pi Agent extension that bridges MCP servers to the LLM via two dynamic-context tools (Call…
- pi-codegraph-extension — CodeGraph MCP tools for the Pi Coding Agent — semantic code search, impact analysis, call …