pi

A setup guide for connecting the CCE code-context service to Pi, a coding agent. It creates the configuration and instruction files Pi needs; an extra adapter is required for Pi to call CCE as a tool.

In plain words
What is it for?
Use it to initialize CCE for Pi, register the CCE server, add project instructions, and check whether Pi is using code-context searches.
Why use it?
It removes the need to configure the connection and usage instructions by hand, while making clear what Pi can and cannot do without the adapter.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/elara-labs/code-context-engine/pi
Clone the repo
git clone --depth 1 https://github.com/elara-labs/code-context-engine
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00010 $0.00527
Opus 5 $0.00005 $0.00264
Sonnet 5 $0.00002 $0.00105
Haiku 4.5 $0.00001 $0.00053

Measured yesterday against content hash 26b99bdac645, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pi scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs-src/src/content/docs/agents/pi.md · 67 lines

How it starts

The opening of the file, as written. The whole thing — 67 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pi does not support MCP natively. CCE provides the standard .mcp.json config (consumed by a companion adapter) and writes AGENTS.md (loaded automatically by Pi at startup).

Quick setup

cce init              # Auto-detects Pi if .pi/ exists in the project
cce init --agent pi   # Explicitly configure Pi
cce init --agent all  # Includes Pi alongside all other editors

Adapter required

Because Pi has no built-in MCP client, you need a companion adapter extension that reads .mcp.json and bridges Pi to the CCE MCP server. One option is pi-mcp-adapter.

Without the adapter, Pi can still read AGENTS.md and follow the CCE usage instructions, but it cannot call context_search as an MCP tool.

Files created

.mcp.json

Registers the CCE MCP server. Shared with Claude Code if both are configured.

{
  "mcpServers": {
    "context-engine": {
      "command": "cce",
      "args": ["serve", "--project-dir", "/path/to/your/project"]
    }
  }
}

AGENTS.md

Contains instructions for Pi to prefer context_search for code retrieval. The CCE block is wrapped in markers so your own content is preserved during upgrades.

Auto-detection

cce init (without --agent) detects Pi when a .pi/ directory exists in the project root.

Verify it's working

  1. Install and activate the MCP adapter for Pi
  2. Restart Pi after running cce init
  3. Ask Pi a question about your code
  4. Run cce savings to confirm queries are being tracked

Troubleshooting

Pi doesn't call context_search

Pi needs a MCP adapter to forward tool calls. Confirm the adapter is installed and points at the .mcp.json in your project root.

"cce: command not found"

Ensure cce is on your PATH. Add ~/.local/bin to your shell profile if installed with uv tool install.

Auto-detection doesn't find Pi

CCE looks for a .pi/ directory in the project root. If it doesn't exist, use cce init --agent pi to force configuration.

Read the full file on GitHub · 67 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 67 lines · 10 tokens per session scan A 26b99bdac645

Subscribe to this mod's changes

pi is an agent published in the GitHub repository elara-labs/code-context-engine (407 stars, last pushed 8d ago), licensed MIT. It adds 10 tokens to every session and 527 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.