Skip to main content
The @raindrop-ai/pi-agent package automatically instruments Pi (the agent harness and coding agent from pi.dev, source at earendil-works/pi) to capture events, traces, and tool calls. Works with both the programmatic pi-agent-core API and the Pi Coding Agent CLI.

Installation

Quick Start — Programmatic

Quick Start — Pi Coding Agent CLI

Set RAINDROP_WRITE_KEY in your environment. Traces appear automatically. Or configure via ~/.pi/agent/raindrop.json:

Configuration

Per-Subscribe Overrides

Override context per subscription when tracking multiple agents:

Extension Configuration

The CLI extension reads config from environment variables and JSON files. Precedence: defaults -> ~/.pi/agent/raindrop.json -> .pi/raindrop.json -> env vars.

Projects

Route events to a specific project by passing its slug as projectId (programmatic) or via RAINDROP_PROJECT_ID / the project_id config-file key (CLI extension):
This sets the X-Raindrop-Project-Id header on every event. Omit it (or pass "default") to use your org’s default Production project, which is the existing behavior. Single-project orgs need nothing new.

Supported Versions

  • @earendil-works/pi-agent-core >= 0.74.0
  • @earendil-works/pi-coding-agent >= 0.74.0 (optional, for CLI extension)

Tool catalog capture (ai.prompt.tools)

Each model span records the agent’s context.tools as ai.prompt.tools: one JSON document per tool with name, description and the full TypeBox parameters schema as inputSchema. Unlike the tools preview inside ai.prompt, this list is not subject to the text budget, so schemas survive intact. Absent when the agent has no tool list. tools is accepted on createRaindropPiAgent(...) and per subscription via subscribe(agent, { tools }) (the subscription value wins); it replaces the inferred list and tools: [] records an empty catalog. See Tool catalog capture for the attribute format, the absent / [] semantics and the override shapes accepted.

Application Git identity

Set appGit on createRaindropPiAgent to provide commitSha, commitDirty, and optional branch, or pass false to opt out. Pi can observe coding workspaces remotely, so local discovery requires a sourceDirectory that explicitly identifies the AUT and never defaults to the edited workspace. See the TypeScript Git reference.