advisor-pi

Advisor-style strategic model guidance for Pi Coding Agent workflows

Packages

Package details

extension

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

$ pi install npm:advisor-pi
Package
advisor-pi
Version
1.0.2
Published
Jun 19, 2026
Downloads
not available
Author
luong.nguyen
License
MIT
Types
extension
Size
58.7 KB
Dependencies
0 dependencies · 4 peers
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ],
  "image": "https://raw.githubusercontent.com/luongnv89/pi-extensions/main/assets/advisor-pi.png"
}

Security note

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

README

advisor-pi

Advisor-style strategic guidance for Pi Coding Agent.

advisor-pi screenshot

advisor-pi adds an LLM-callable advisor tool. During complex workflows, the executor model can pause and consult a configured higher-capability advisor model for planning, risk analysis, course correction, or review guidance.

The advisor receives the current conversation transcript plus the executor's question. It has no tools and cannot modify files; it only returns strategic advice to the executor.

Behavior

  • Registers an advisor tool for complex or high-risk tasks.
  • Lets the executor decide when a consultation is useful.
  • Calls a configured advisor model through Pi's model registry and auth.
  • Tracks advisor uses per session branch and stops after the configured limit.
  • Passes a prompt-cache preference (none, short, or long) where the selected provider supports it.
  • Shows a compact advisor:<remaining> status in Pi's footer when UI is available.

Commands

/advisor-pi status
/advisor-pi enable
/advisor-pi disable
/advisor-pi model <provider>/<model>
/advisor-pi max-uses <number>
/advisor-pi cache <none|short|long>
/advisor-pi reset

Examples:

/advisor-pi model anthropic/claude-opus-4-5
/advisor-pi max-uses 5
/advisor-pi cache long

CLI flags

pi --advisor-model anthropic/claude-opus-4-5 \
   --advisor-max-uses 3 \
   --advisor-cache short

Disable on startup:

pi --advisor-enabled=false

Install

Published on npm: advisor-pi. Register the package with Pi (pi install) — plain npm install does not add it to Pi's settings.json.

pi install npm:advisor-pi
pi install npm:advisor-pi@1.0.0   # pin version
pi install -l npm:advisor-pi      # project-local (.pi/settings.json)
pi -e npm:advisor-pi              # one session, no install

Then run /reload in Pi (or restart).

pi list
pi update npm:advisor-pi
pi remove npm:advisor-pi

From pi-extensions (git):

cp -r extensions/advisor-pi ~/.pi/agent/extensions/
# or: curl -fsSL .../install.sh | bash -s -- --auto

Cost and latency

Each advisor consultation is a separate model call. That means:

  • Advisor input and output are billed separately by the selected provider.
  • Streaming from the executor pauses while the advisor call runs.
  • Longer transcripts cost more because the advisor reads the conversation context.
  • The max-uses setting is a safety budget; raise it only when deeper review is worth the extra cost.

Caching

advisor-pi passes the configured cache preference to Pi's AI provider layer:

  • none — do not request prompt caching.
  • short — request normal/short cache retention where supported.
  • long — request long cache retention where supported.

Provider support varies. Some providers ignore cache preferences, some require specific model compatibility, and cache reads/writes may still be billed.

Known limitations

  • This is a portable Pi custom-tool approximation, not Anthropic's native beta advisor_20260301 server tool.
  • Native provider-specific advisor usage fields may not appear in provider usage reports.
  • The advisor has no tools and cannot inspect files beyond what appears in the transcript.
  • Very long conversations can make advisor calls slower and more expensive.
  • max-uses is tracked per Pi session branch from extension state and tool result details; manual session editing can affect reconstruction.