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.
npx agentmods add instructions/tryinget/pi-server/agents-mdgit clone --depth 1 https://github.com/tryingET/pi-serverWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.11901 | $0.11901 |
| Opus 5 | $0.05951 | $0.05951 |
| Sonnet 5 | $0.02380 | $0.02380 |
| Haiku 4.5 | $0.01190 | $0.01190 |
Grade B, and why
pi-server AGENTS.md scanned grade B with 1 finding 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 2d 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.
Asks for rootmediumPrivilege escalation
A mod that escalates privileges can change anything on the machine, not only the project.
chmod 700 "$RUN_ROOT" "$RUN_ROOT"/{home,agent,tmp} How it starts
The opening of the file, as written. The whole thing — 1,519 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — Crystallized Learnings for pi-server
This document captures patterns, anti-patterns, and gotchas discovered during development. Read this before working on pi-server.
Because parent/global AGENTS files are concatenated into every session, keep this file repo-specific and prefer pointing to canonical docs instead of duplicating large policy blocks.
Canonical References
Start here before changing behavior that crosses repo boundaries:
README.md— package shape, architecture overview, release flowPROTOCOL.md— wire contract and client-visible semanticsdocs/release-policy.md— commit, changelog, and breaking-change policynext_session_prompt.md— current handoff / immediate priorities
Architecture Principles
- The protocol IS the architecture —
types.tsis the single source of truth - Server should be thin — AgentSession does the work, we just multiplex
- Pass-through pattern — Session commands are thin wrappers around AgentSession methods
- Handler map > switch —
Record<string, CommandHandler>for O(1) dispatch, easy extension - Extract to stores — State with independent lifecycle gets its own module
- SessionResolver is the NEXUS seam — Interface for session access enables test doubles
ADR-0001: Atomic Outcome Storage
Status: Accepted (2026-02-22)
Full ADR: docs/adr/0001-atomic-outcome-storage.md
The Invariant
Same command ID must ALWAYS return the same response. Not "usually." Not "after the callback completes." ALWAYS.
Three Critical Rules
- Store BEFORE return — Outcomes are stored before the response is returned, not in async callbacks
- Timeout IS a response — Timeout responses are stored as valid outcomes (with
timedOut: true) - Replay is FREE — Replay operations are O(1) lookups, exempt from rate limiting
Code Pattern
// WRONG: Async callback creates race condition
commandExecution.then((response) => {
this.storeOutcome(commandId, response); // After return
});
return withTimeout(commandExecution, ...);
// CORRECT: Atomic storage before return
let response: RpcResponse;
try {
response = await executeWithTimeout(commandExecution, ...);
} catch (error) {
response = { success: false, error: error.message, timedOut: true };
}
this.storeOutcome(commandId, response); // BEFORE return
return response;
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.
- 2d ago First seen · 1,519 lines · 11,901 tokens per session scan B cc49f65281ad
pi-server AGENTS.md is an instructions file published in the GitHub repository tryingET/pi-server (11 stars, last pushed 11d ago), licensed MIT. It adds 11,901 tokens to every session, about $0.0595 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
pi-fabric AGENTS.md
Instructions for monotykamary/pi-fabric, covering agents.md, golden rule: build when done, before committing and commits.
TelePi AGENTS.md
Instructions for benedict2310/TelePi, covering repository guidelines, project structure & module organization, build, test, and development commands, operational commands and coding style & naming conventions.
my-pi AGENTS.md
Instructions for spences10/my-pi, covering agents.md, orientation, repository-specific skills, source of truth order and commit and changeset ownership.
LaPis AGENTS.md
Instructions for GeneGulanesJr/LaPis, covering protocols, 1. code & doc retrieval — use memory-code / memory-doc, 2. persistent memory — automatic, when to use the tools and content format.
pi-ask AGENTS.md
Instructions for eko24ive/pi-ask, covering agents.md, project scope, project goals, tech stack and commands.
compound-engineering-pi CLAUDE.md
Instructions for gvkhosla/compound-engineering-pi, covering every marketplace - claude code plugin marketplace, repository structure, philosophy: compounding engineering, working with this repository and adding a new plugin.