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/abcwyc/pi-agent-desktop/agents-mdgit clone --depth 1 https://github.com/abcwyc/pi-agent-desktopWrote 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/abcwyc/pi-agent-desktop/agents-md)<a href="https://agentmods.dev/instructions/abcwyc/pi-agent-desktop/agents-md"><img src="https://agentmods.dev/badge/instructions/abcwyc/pi-agent-desktop/agents-md.svg" alt="Measured on agentmods" 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 | $0.05377 | $0.05377 |
| Opus 5 | $0.02688 | $0.02688 |
| Sonnet 5 | $0.01075 | $0.01075 |
| Haiku 4.5 | $0.00538 | $0.00538 |
Grade A, and why
pi-agent-desktop AGENTS.md 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.
Copies of this mod
1 near-identical copy found in the catalogue:
- omp-web AGENTS.md — 88% identical, 54 lines differ
How it starts
The opening of the file, as written. The whole thing — 250 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Pi Web - Development Notes
Quick Start
npm run dev # port 30141
Typecheck: node_modules/.bin/tsc --noEmit
Lint: npm run lint
Never run next build during dev — pollutes .next/ and breaks npm run dev.
Architecture
Browser Next.js Server AgentSession (in-process)
│ │ │
├─ GET /api/sessions ────▶ reads ~/.pi/agent/sessions/ │
├─ GET /api/sessions/[id] reads .jsonl file directly │
├─ GET /api/agent/running ───────▶ running id snapshot │
│ │ │
├─ send message ─────────▶ POST /api/agent/[id] │
│ │ startRpcSession() ─────────▶│ createAgentSession()
│ │ session.send(cmd) ─────────▶│ session.prompt()
│ │ │
├─ SSE connect ──────────▶ GET /api/agent/[id]/events │
│ │ session.onEvent() ◀─────────│ session.subscribe()
│◀── data: {...} ─────────│ │
Session browsing (read-only): reads .jsonl files through SDK SessionManager helpers and lib/session-reader.ts — no AgentSession created.
Sending a message: startRpcSession() in lib/rpc-manager.ts creates an AgentSession in-process.
File Map
app/api/
sessions/route.ts GET list all sessions
sessions/[id]/route.ts GET/PATCH/DELETE session
sessions/[id]/context/route.ts GET ?leafId= — context for a specific leaf
sessions/[id]/export/route.ts GET exported HTML for a session
agent/new/route.ts POST { cwd, message, toolNames?, provider?, modelId? }
agent/[id]/route.ts GET state | POST any command
agent/[id]/events/route.ts GET SSE stream
agent/running/route.ts GET currently-running session ids
agent/running/events/route.ts GET SSE stream of currently-running session ids
auth/all-providers/route.ts GET API-key provider list
auth/api-key/[provider]/route.ts GET/POST/DELETE provider API key status/storage
auth/login/[provider]/route.ts GET OAuth/device-code SSE | POST manual code
auth/logout/[provider]/route.ts POST OAuth logout
auth/providers/route.ts GET OAuth provider list
cwd/validate/route.ts POST validate/select a cwd
default-cwd/route.ts POST create ~/pi-cwd-YYYYMMDD
files/[...path]/route.ts GET file contents for viewer
home/route.ts GET user home directory
models/route.ts GET { models, modelList, defaultModel }
models-config/route.ts GET/PUT — read/write ~/.pi/agent/models.json
models-config/catalog/route.ts GET models.dev pricing presets
models-config/discover/route.ts POST fetch a configured provider's upstream model list
models-config/test/route.ts POST test a configured model/provider
plugins/route.ts GET/POST package plugin management
skills/route.ts GET/PATCH loaded skills and disable-model-invocation
skills/install/route.ts POST install skills through npx skills add
skills/search/route.ts GET/POST skills.sh search
worktrees/route.ts GET list / POST create / PUT switch branch / DELETE git worktrees
worktrees/fetch/route.ts POST git fetch --prune + fresh branch lists
desktop/read-images/route.ts POST read natively-picked images into attachment payloads
desktop/save/route.ts POST copy a file to, or write bytes at, a natively-picked path
lib/
agent-client.ts typed fetch helper for /api/agent commands
app-prefs.ts APP_PREF_KEYS + typed localStorage accessors (SSR/private-mode safe)
desktop-connection.ts useDesktopConnection() — local server health probe for the reconnect banner
desktop-native.ts native dialogs, open/reveal path, external links, save/import, window lifecycle
desktop-notify.ts native completion notifications (skipped while the window is focused)
draft-store.ts local draft persistence helpers
file-access.ts allowed file roots for /api/files and worktrees
file-paths.ts client/server path encoding helpers
markdown.ts shared markdown helpers
npx.ts npx runner used by skill install
pi-types.ts local structural types for pi SDK objects
rpc-manager.ts AgentSessionWrapper + registry + startRpcSession
session-reader.ts SessionManager wrappers + path cache + buildSessionContext adapter
tool-presets.ts PRESET_NONE/DEFAULT/FULL + getPresetFromTools()
types.ts shared TypeScript types
normalize.ts normalizeToolCalls() — field name mismatch between file format and our types
workspace-state.ts persisted session/cwd/file-tab restore for desktop cold starts
worktree.ts project/worktree resolution and git worktree operations
components/
AppShell.tsx layout + URL state + tab management
SessionSidebar.tsx session tree + FileExplorer
ChatWindow.tsx chat composition + completion sound wrapper
ChatInput.tsx input bar + model/thinking/tools/compact controls
MessageView.tsx renders one message (user/assistant/toolCall/toolResult)
BranchNavigator.tsx in-session branch switcher
MarkdownBody.tsx markdown renderer
ModelsConfig.tsx modal for editing models.json (opened from sidebar bottom)
PluginsConfig.tsx modal for installed package plugins
SkillsConfig.tsx modal for loaded/search/installable skills
FileExplorer.tsx file tree inside sidebar
FileIcons.tsx file icon helpers
FileViewer.tsx file content in a tab
TabBar.tsx tab bar (Chat + open file tabs)
hooks/
useAgentSession.ts messages + streaming + SSE + fork/navigate/reconciliation logic
useAudio.ts completion sound + browser AudioContext unlock
useDragDrop.ts shared drag/drop state
useIsMobile.ts responsive breakpoint hook
useTheme.ts theme state
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.
- 4d ago First seen · 250 lines · 5,377 tokens per session scan A 97dc4354a6e3
pi-agent-desktop AGENTS.md is an instructions file published in the GitHub repository abcwyc/pi-agent-desktop (355 stars, last pushed 2d ago), licensed MIT. It adds 5,377 tokens to every session, about $0.0269 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.
Other instructions, from other repositories
Accordion AGENTS.md
Instructions for a-Fig/Accordion, a project described as: 🏆 AI Hackathon 2026 @ UC Berkeley Intelligent context management for developers.
nextclaw AGENTS.md
AGENTS.md instructions for Peiiii/nextclaw, covering nextclaw ai 常驻内核, 产品愿景, 沟通与推进, 深思与目标模式 and 协作与 git 安全.
moonproxy-desktop AGENTS.md
AGENTS.md instructions for MoonProxyHQ/moonproxy-desktop, covering moonproxy, 功能, 技术栈, 目录结构 and 配置与数据存储.
code-by-wire CLAUDE.md
Instructions for luojiahai/code-by-wire, covering claude.md, development, website, architecture and code style.
Token-Dashboard CLAUDE.md
Instructions for Arylmera/Token-Dashboard, covering claude.md, project overview, status, architecture and data source.
ideate AGENTS.md
Instructions for paultyng/ideate, covering agents.md, build features as mcp tools first, ui second, when to add ui and pattern.