pi

pi is an agent for coding agents from sheawinkler/ContextLattice. It costs 0 tokens per session (425 once invoked), scanned A, original, Apache-2.0.

A runtime integration for Pi, a conversational terminal coding agent. It uses ContextLattice as a memory and handoff layer while Pi remains responsible for running local commands when available.

In plain words
What is it for?
Use it for project briefings, scouting, summarizing, reviewing, lightweight refactoring, checkpointing decisions, and preparing handoffs.
Why use it?
It gives Pi concise project context and durable decisions without pasting entire old logs into every session. It can also report task state when the adapter is available.

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/sheawinkler/contextlattice/pi
Clone the repo
git clone --depth 1 https://github.com/sheawinkler/ContextLattice

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pi

README.md
[![agentmods](https://agentmods.dev/badge/agents/sheawinkler/contextlattice/pi.svg)](https://agentmods.dev/agents/sheawinkler/contextlattice/pi)
Your own site
<a href="https://agentmods.dev/agents/sheawinkler/contextlattice/pi"><img src="https://agentmods.dev/badge/agents/sheawinkler/contextlattice/pi.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 425 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.00000 $0.00425
Opus 5 $0.00000 $0.00212
Sonnet 5 $0.00000 $0.00085
Haiku 4.5 $0.00000 $0.00042

Measured 4d ago against content hash 41eef2f76910, 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 4d ago.

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/public_overview/templates/agents/pi.md · 39 lines

What it actually says

Pi Integration Template

Runtime:

  • Orchestrator: http://127.0.0.1:8075
  • Agent profile: pi
  • Stable agent id: pi_agent
  • Optional install: brew install pi-coding-agent

For Pi-style conversational agents, keep the instruction lightweight and use ContextLattice as a memory briefing layer, not as a wall of pasted logs. Pi is best treated as an optional scout, summarizer, reviewer, or lightweight refactor runner when the local CLI exists.

ContextLattice does not install Pi automatically. Runner execution is optional and adapter-first: ContextLattice packages context and records lifecycle; the Pi adapter owns local CLI invocation.

Paste into Pi/custom instructions when available:

Use ContextLattice at http://127.0.0.1:8075 for durable memory, scoped recall, and handoff continuity.
Use stable agent_id pi_agent.
Before non-trivial work, run contextlattice context "<task>" --project <project> --pretty. If the CLI is unavailable, continue from local evidence and say degraded-memory mode.
Use contextlattice_agent_adapter state to report idle, working, awaiting_user, blocked, or done when possible.
Checkpoint durable decisions and write a concise handoff before compaction or account/thread transfer.
Do not auto-merge, git push, or treat ContextLattice context as prompt filler.
Post-compaction readback is optional and bounded; use it only to recover prior objective state, not as prompt filler.

Operator workflow:

CONTEXTLATTICE_AGENT_ID=pi_agent contextlattice context "current task" --project contextlattice --pretty
contextlattice resume --project contextlattice --pretty
contextlattice remember "checkpoint summary" --project contextlattice --pretty
contextlattice finish "verified result" --success --project contextlattice --pretty

Optional runner execution:

TASK_AGENT=pi python3 scripts/task_agent_worker.py --task-agent pi --worker-name local-pi-01
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. 4d ago First seen · 39 lines · 0 tokens per session scan A 41eef2f76910

Subscribe to this mod's changes

pi is an agent published in the GitHub repository sheawinkler/ContextLattice (153 stars, last pushed 8d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 425 tokens. 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.