← Catalog

pi-autocontext

autocontext extension for Pi coding agent — iterative strategy generation, LLM judging, and evaluation tools

Extension

Install

Install with PiG

pig install npm:pi-autocontext

Install with Pi

pi install npm:pi-autocontext
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"
  ],
  "prompts": [
    "./prompts"
  ],
  "extensions": [
    "./src/index.ts"
  ]
}

README

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

pi-autocontext

autocontext extension for Pi coding agent — iterative strategy generation, LLM judging, and evaluation tools.

Install

pi install npm:pi-autocontext@0.12.0

Current package note: the pi-autocontext@0.12.0 source checkout is on a separate Pi extension line and depends on autoctx@^0.19.1. A follow-up Pi release can move it to a newer autoctx line after the core npm package is live.

Source checkouts require autoctx@^0.19.1 for the Zod collection-validation security fix. The latest published Pi extension is currently 0.10.0 and uses the older autoctx@^0.15.0 line. The 0.12.0 install command above requires a separate Pi release; publishing autoctx 0.19.1 alone does not update that extension. Until then, install this source checkout with pi install /path/to/autocontext/pi.

Or add to your project's .pi/settings.json:

{
  "packages": ["npm:pi-autocontext@0.12.0"]
}

What You Get

Tools

ToolDescription
autocontext_judgeEvaluate agent output against a rubric using LLM-based judging
autocontext_improveRun multi-round improvement loop with judge feedback
autocontext_statusCheck status of autocontext runs and tasks
autocontext_scenariosList available evaluation scenarios and families
autocontext_queueEnqueue a task for background evaluation
autocontext_runtime_snapshotInspect run artifacts, package provenance, compaction ledger entries, session branch lineage, and recent events

Skills

  • /skill:autocontext — Full instructions for using autocontext tools, running evaluations, and interpreting results

Prompt Templates

  • /autoctx-status — Quick project status check

Usage

Once installed, the tools are available to the LLM automatically. You can also invoke them directly:

> Evaluate the quality of this code against our coding standards rubric
> Run an improvement loop on this draft with max 5 rounds
> Show me the status of recent autocontext runs
> Inspect the runtime snapshot for run-123 and session sess-123
> List available evaluation scenarios

Or use the skill for guided workflows:

/skill:autocontext

Requirements

  • Pi coding agent
  • An LLM provider configured in Pi (Anthropic, OpenAI, etc.)
  • Optional: autoctx CLI for standalone usage outside Pi

Configuration

The extension auto-discovers your autocontext configuration:

  • Provider: Uses Pi's configured LLM provider
  • Database: Looks for runs/autocontext.sqlite3 or AUTOCONTEXT_DB_PATH env var
  • Events: Reads runs/events.ndjson or AUTOCONTEXT_EVENT_STREAM_PATH for recent runtime events
  • Scenarios: Discovers registered scenarios from the autoctx package

Runtime compatibility checks

After npm ci --ignore-scripts, prepare better-sqlite3 and isolated-vm as for the TypeScript CI jobs, then run:

npm run test:runtime-contract

For npm 12, package.json permits native build scripts only for the exact reviewed versions of those two modules. CI builds them from source using the headers supplied with its pinned Node setup; dependency installation still uses --ignore-scripts.

This packs the extension and checks all six tools in a temporary fixture with the installed dependency graph, its deterministic provider, and a temporary SQLite database. It does not resolve new dependencies, use the Vitest runtime alias, or mock autoctx; the normal npm test suite covers unit behavior.