Borrowing it
Nothing to install: this file belongs to tryingET/pi-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/tryingET/pi-server/main/AGENTS.mdgit clone --depth 1 https://github.com/tryingET/pi-serverWrote 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.
[](https://agentmods.dev/instructions/tryinget/pi-server/agents-md)<a href="https://agentmods.dev/instructions/tryinget/pi-server/agents-md"><img src="https://agentmods.dev/badge/instructions/tryinget/pi-server/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/tryinget/pi-server/agents-md"><img src="https://agentmods.dev/badge/instructions/tryinget/pi-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.11952 | $0.11952 |
| Opus 5.5 | $0.04781 | $0.04781 |
| Sonnet 5.5 | $0.02390 | $0.02390 |
| Haiku 4.5 | $0.01195 | $0.01195 |
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 1mo 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,527 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.
- 1mo ago Changed · +8 lines · +51 tokens per session 0c9171b0cb8d
- 2mo 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 (13 stars, last pushed 1mo ago), licensed MIT. It adds 11,952 tokens to every session, about $0.0478 per session on Opus 5.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.
pi-server AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pi-server AGENTS.mdtryingET/pi-server | Instructions file | 13 | 1mo ago | MIT | B | 11,952 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |