← Catalog

pi-introspect

Pi extension tools for agent self-reflection: model metadata, context window usage, thinking level, and reasoning budget.

Extension

Install

Install with PiG

pig install npm:pi-introspect

Install with Pi

pi install npm:pi-introspect
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "./skills"
  ],
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.3 (README.md). PiG does not review it.

README

pi-introspect is a package for pi coding agent that exposes self-reflection tools to the agent. The tools allow the agent to find out its own model metadata (ID, available thinking levels, provider URL, etc), its current context window (and how much is used), its response maxTokens limit, and its current thinking/reasoning level. Like most tool packages, a brief skill is included for info on how to use the tools.

Tools

  • introspect_model provides active model metadata: id, name, provider, provider display name, API type, catalog and resolved request base URLs, reasoning support, thinkingLevelMap, context window, max output tokens, input modalities, and cost. Never exposes credentials.
  • introspect_context provides current context window usage: estimated tokens used, percent used, tokens remaining, and the model's context window and max output tokens. Token counts may be unknown immediately after compaction or before the first model response.
  • introspect_thinking provides current thinking level and effective thinking budget: pi's per-level budget defaults merged with thinkingBudgets settings overrides (project settings win), plus the model's provider-specific thinkingLevelMap.

Install

pi install npm:pi-introspect

... or as a git source:

pi install git:github.com/Pxtl/pi-introspect

To try it for one session without installing:

pi -e /path/to/pi-introspect

Development

See CONTRIB.md.

In short:

npm install --include=dev
npm run check   # typecheck + unit tests

Releasing: see Publishing.