packages / pi-smart-compact
extension Context & memory

pi-smart-compact

Verification-oriented smart compaction extension for Pi Coding Agent — deterministic extraction, exploration, synthesis, verification, metrics, and safety checks.

No reviews yet

Install

$ pi install npm:pi-smart-compact

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 7.22.0. This describes access, not safety — you decide whether it's appropriate for what the package claims to do.

  • 🤖
    Behavior — Changes how the agent thinks Modifies the system prompt, injects messages, or rewrites conversation context.
  • Commands — Runs shell commands Spawns processes on your machine.
  • 🔑
    Credentials — Handles your API keys Reads or passes provider credentials. Highest-trust capability there is.
  • 📁
    Files — Reads files outside your project Touches paths beyond the working directory, such as your home folder.
  • Subagents — Spawns agents or sessions Runs additional agents. Ask whether it caps iterations and spend.
  • 🔧
    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

observed

Loaded 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 smart_compact

Events subscribed message_endsession_before_compactsession_compactsession_shutdown

APIs called getContextUsagegetContextUsage.tokens.toJSONgetContextUsage.tokens.toLocaleStringmodel.provider.toJSONmodelRegistry.getApiKeyAndHeadersmodelRegistry.getAvailableregisterCommandregisterToolsessionManager.getBranchsessionManager.getBranch.filtersessionManager.getBranch.filter.slicesessionManager.getBranch.filter.slice.mapsessionManager.getBranch.filter.slice.map.mapsessionManager.getBranch.filter.slice.map.map.filtersessionManager.getBranch.filter.slice.map.map.filter.somesessionManager.getSessionIdui.notifywaitForIdle

10 calls the source scan did not predict

getContextUsage.tokens.toJSON · getContextUsage.tokens.toLocaleString · model.provider.toJSON · sessionManager.getBranch.filter · sessionManager.getBranch.filter.slice · sessionManager.getBranch.filter.slice.map · sessionManager.getBranch.filter.slice.map.map · sessionManager.getBranch.filter.slice.map.map.filter · sessionManager.getBranch.filter.slice.map.map.filter.some · waitForIdle

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 7.22.0 on 2026-08-02. Registration-time behaviour under default settings; other configurations may differ.

Review before you install. pi packages run with your full system permissions. Check the source, pin versions, and prefer authors you trust.

Reviews

0 published

Sign in with GitHub to write a review, reply, or vote.

No reviews yet — be the first.

More in Context & memory

  • context-mode — MCP plugin that saves 98% of your context window. Works with Claude Code, Gemini CLI, VS C…
  • pi-hermes-memory — Persistent memory, session search and secret scanning for pi. Token-aware and policy-drive…
  • @hypabolic/pi-hypa — Keeps noisy tool output out of your context window — automatically rewrites and compacts v…
  • @remnic/plugin-pi — Remnic memory extension for pi — shared memory that follows you across AI coding agents.