decorated-pi

decorated-pi is a practical enhancement pack for pi coding agent — token-efficient workflow, cache-friendly design, and smarter tools.

Packages

Package details

extension

Install decorated-pi from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:decorated-pi
Package
decorated-pi
Version
0.10.0
Published
Sep 24, 2026
Downloads
584/mo · 241/wk
Author
weckerrr
License
MIT
Types
extension
Size
536.8 KB
Dependencies
6 dependencies · 5 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

decorated-pi

decorated-pi is a practical enhancement pack for Pi — token-efficient workflow, cache-friendly design, and smarter tools.

Install

pi install npm:decorated-pi
# or
pi install git:github.com/lcwecker/decorated-pi
# or
pi install /path/to/decorated-pi

Features

1. Token Efficiency

Multiple layers of token savings that compound across every session.

Talk Normal Prompt — injects a response-style prompt adapted from talk-normal (prompt.md v0.6.2), trimming filler, summary stamps, conditional follow-up menus, negation-frame phrasing, and verbose framing. This reduces assistant output tokens and keeps visible reasoning / explanation blocks tighter.

Codegraph — integrates codegraph to offer a code map of your project, so the LLM can navigate symbols and call graphs without chaining lsgrepread. Create and maintain the project index yourself; see the codegraph documentation.

Auxiliary Models — offloads heavy-but-dumb tasks to cheaper models so your primary model only pays for the hard work:

  • Image Read Fallback — detects image type via magic bytes, calls a configured vision-capable model, and injects the analysis text, so your main model never touches image tokens
  • Compact Model — handles context compaction with a smaller model instead of burning main-model capacity

Configured via /dp-model.

Cache‑friendly Design — stable system prompt prefix:

  • tool definitions, guidelines, and skills are sorted alphabetically so the system prompt stays deterministic for the same project and configuration
  • MCP tool schemas are persisted after a successful connection, keeping the tool list stable across restarts and temporary server outages

Pi Native Prompt Slimming — moves the default Pi documentation block out of the system prompt and into a builtin pi-docs skill, so the docs reference loads on demand instead of sitting in every turn's prompt.

Large Result Externalization — a tool_result hook saves a tool's first text result when it exceeds 30,000 characters to /tmp/decorated-pi-results/<tool>-<callId>.txt, replacing it with a one-line pointer ([Output too long, saved to /tmp/…]) that the LLM can read on demand.

2. Smarter Tools

LLM-callable tools and workflow upgrades with better UX and fewer wasted turns.

Patch Tool

Capability Pi native edit patch
Anchor‑based search ❌ extending oldText for uniqueness anchor bounds scope for precise matching
Fuzzy whitespace match ❌ only reports "not found" ✅ auto‑corrects tab↔space / trailing whitespace mismatches
Edit fault diagnostics ❌ only reports "not found" ✅ pinpoint faults for LLM comprehension
Stale‑read protection ❌ Blind to external changes read captures mtime, patch rejects stale targets

LSP support

A language server answers from the compiler's binding graph: imports, re-exports and overloads resolve exactly, every reference to a symbol is enumerated, and a rename's complete edit set comes back across every file that references it. A model reading the files works from the subset it opened.

  • lsp_definition — where a symbol is defined
  • lsp_references — every reference to a symbol
  • lsp_document_symbols — a file's symbol outline, to find a position
  • lsp_rename — the exact workspace edits for a rename, applied to disk (or previewed)

Supported languages: c/cpp, go, java, lua, python, ruby, rust, svelte, typescript. TypeScript support is bundled; the other languages require their corresponding language-server binaries.

Ask tool

Collect text, single-choice and multi-choice answers when the agent needs clarification. The agent passes a context with the facts needed to answer, and the answering path decides who responds:

  • Who answersme (default) opens the wizard in the terminal. jev has a TypeSafe System One model judge each question against the supplied context, answering closed questions without a round trip; only single- and multi-choice questions have an answer space to judge, and free text always goes to the user.
  • Escalation — anything Jev is not sure of comes back marked as needing the user: low confidence, a "the context does not determine it" verdict, a missing key, or a transport failure. The agent then puts those questions in its reply, so this path needs no terminal and works in rpc/json/print sessions.
  • Configuration/dp-settings → Tools → Ask (Enabled / Who answers / key), or askWho and typesafeApiKey in decorated-pi.json. TYPESAFE_API_KEY takes precedence so the key can stay out of the file; the UI masks it.

3. Web Access

Two native tools, both keyless. Search runs through three hosted backends and falls over automatically; fetching reads the URL directly and only leaves the machine when a plain HTTP client cannot render the page.

websearch — AnySearch → Exa → Parallel, first backend that returns results wins. A filter only one backend understands pins that backend, so includeDomains never lands somewhere it would be ignored.

Backend Strength Endpoint
AnySearch widest coverage: 17 vertical domains, batched queries, URL extraction https://api.anysearch.com/mcp
Exa semantic search plus category, domain, date and summary filters https://mcp.exa.ai/mcp
Parallel objective-shaped retrieval ranked against a stated goal https://search.parallel.ai/mcp

webfetch — local HTTP GET first (localhost and intranet hosts work, the URL stays local), with markdown / text / html output and image URLs returned as attachments. When a bot challenge, an HTTP error or a client-rendered page defeats the local fetch, it retries through AnySearch extract and then Jina reader. Private and local hosts skip those backends, and allowRemote: false keeps every URL on the machine; non-HTTP URLs are refused before any request is made.

Behind an HTTP proxy, Node's fetch connects directly and times out even though curl works — set NODE_USE_ENV_PROXY=1 on Node 24+ to make it honour HTTPS_PROXY. Failure messages say so when a proxy variable is set.

4. MCP Ecosystem

Zero-config MCP client with built-in servers:

Server Tool Prefix Source
Context7 context7_* https://mcp.context7.com/mcp
codegraph codegraph_* local codegraph CLI

Custom servers in .pi/agent/mcp.json (project) or ~/.pi/agent/mcp.json (global). Project entries override global entries with the same name. Tool prompts and schemas are cached after a successful connection for fast startup on subsequent sessions.

{
  "mcpServers": {
    "my-server": {
      "url": "https://my-mcp.example.com/mcp",
      "enabled": true
    },
    "my-sse": {
      "url": "https://my-mcp.example.com/sse",
      "enabled": false
    },
    "my-stdio": {
      "command": "npx",
      "args": ["-y", "my-mcp-server"],
      "env": { "DEBUG": "1" }
    }
  }
}

Use /mcp to view connection status and toggle servers.

5. Other

  • /code-review [prompt] — offload review of current SCM changes, or of a scope described in the prompt (e.g. a file/directory path, also without a git/svn repository), to a separately configured model, avoiding a /model switch in the main session and preserving its prompt cache. Without a scope the reviewer inspects the working tree itself via read-only SCM commands, but requires at least one tracked change (A/M/D/R/…); a tree with only untracked files (or none at all) needs an explicit scope.
  • /usage — token stats with cache‑hit rate, per‑model breakdown (Session / Today / This Week / This Month / All Time)
  • /retry — continue after interruption
  • Progressive context — supports subdirectory AGENTS.md / CLAUDE.md discovery and injection
  • WakaTime — coding activity tracking via WakaTime

Configuration

Runtime settings live in ~/.pi/agent/decorated-pi.json. Run /dp-settings to configure modules and dependency paths, and /dp-model to configure auxiliary models.

{
  "modules": {
    "tools": {
      "patchOverrideEdit": true,
      "ask": true,
      "lsp": true,
      "mcp": true,
      "websearch": true,
      "webFetch": true
    },
    "hooks": {
      "wakatime": true,
      "tps": true
    },
    "commands": {
      "retry": true,
      "usage": true
    }
  },
  "askWho": "me",
  "dependencies": {
    "wakatime-cli": {
      "dontBother": true
    }
  }
}
  • modules can be toggled on/off to enable/disable features. All are enabled by default.
  • askWho picks who answers the ask tool: "me" opens the terminal wizard, "jev" has a TypeSafe System One model answer closed questions from the context the agent supplied. "jev" needs typesafeApiKey here or the TYPESAFE_API_KEY environment variable, which takes precedence.
  • dependencies[binaryName].path overrides the lookup location for a binary (file or directory). dependencies[binaryName].dontBother silences missing-dependency notifications for that binary. Both are optional.

License

MIT