pi-agent-desktop: Instructions file for Codex

AGENTS.md

pi-agent-desktop AGENTS.md is an instructions file for Codex, OpenCode from abcwyc/pi-agent-desktop. It costs 8,061 tokens per session, scanned B, original, MIT.

Project instructions for Pi Web, a Next.js web interface that browses saved agent sessions and sends messages to running sessions.

In plain words
What is it for?
Use them when changing session browsing, agent messaging, server-sent event updates, or the development workflow.
Why use it?
They explain the browser-to-server-to-agent flow and warn against a build command that can disrupt local development.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions subagents; mentions AGENTS.md.

This is abcwyc/pi-agent-desktop's own configuration. It tells Codex and OpenCode how to work on pi-agent-desktop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything pi-agent-desktop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to abcwyc/pi-agent-desktop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/abcwyc/pi-agent-desktop/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/abcwyc/pi-agent-desktop

Made for: Codex, OpenCode.

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-agent-desktop AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/abcwyc/pi-agent-desktop/agents-md/github.svg)](https://agentmods.dev/instructions/abcwyc/pi-agent-desktop/agents-md)
Your own site
<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/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.

agentmods 80×15 button for pi-agent-desktop AGENTS.md

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 8,061 This file is loaded in full into every session.
When invoked 8,061 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.08061 $0.08061
Opus 5.5 $0.03224 $0.03224
Sonnet 5.5 $0.01612 $0.01612
Haiku 4.5 $0.00806 $0.00806

Measured 3d ago against content hash 2e03b17cab79, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

pi-agent-desktop 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 3d 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.

Reads MCP configurationmediumAgent snooping

mcp.json carries server URLs and auth tokens; reading it lets a mod discover and abuse other integrations.

- [mcp-settings.md](docs/agents/mcp-settings.md): Settings › MCP reads without running anything, masking, the trust dialog's server list, row states, notices, Code mode choice, trust from Settings, Escape stacking, every
Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 307 lines

How it starts

The opening of the file, as written. The whole thing — 307 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: it pollutes .next/ and breaks npm run dev.


Local environment traps

  • Building (or starting a fresh next dev) from inside the Pi desktop app's shell fails. The app exports NODE_ENV=production, __NEXT_PRIVATE_ORIGIN and __NEXT_PRIVATE_STANDALONE_CONFIG (its own serialized Next config, from which function values are gone). Next's CLI prefers that serialized config over next.config.ts, so next build dies with TypeError: generate is not a function and a fresh next dev with Missing field turbopackMemoryEviction — while a dev server that was already running keeps working, which makes it look like a repo bug. scripts/prepare-desktop.mjs deletes both __NEXT_PRIVATE_* vars for this exact reason; do the same (or run from a normal terminal) before any next build / npm run test:e2e.
  • The node on PATH may not be the one the project runs on: the Pi app bundles its own runtime, while a dev server started from a terminal uses another install. Check with ps -o command= -p $(lsof -nP -iTCP:30141 -sTCP:LISTEN -t).
  • npm run test:e2e refuses to start while a dev server holds .next/dev/lock, and E2E_SERVER_MODE=start (the mode CI uses) needs a production build. Both can be satisfied without touching the dev state by building into the isolated desktop dir and pointing the harness at it: PI_WEB_DESKTOP_BUILD=1 node_modules/next/dist/bin/next build --webpack then E2E_SERVER_MODE=start PI_WEB_DESKTOP_BUILD=1 node e2e/run.mjs (next.config.ts swaps distDir to .next-desktop, which is gitignored).
  • A worktree's node_modules can lag the lockfile (created before an SDK bump), which fails tests that pin newer SDK behaviour. npm test runs npm run check:deps first and stops with the mismatched packages; npm ci fixes it.
  • Windows test fixtures use scripts/test-platform.mjs: directory links are junctions, unavailable file links skip only their own subtests, and POSIX mode checks remain active on POSIX hosts. Shell-command fixtures select native Git Bash inside the test process; trust fixtures must not inherit the user's ancestor skills. Await session shutdown before deleting MCP working directories. Real PTY integration runs in a child process; fake-clock tests use a controlled PTY.
  • next dev rewrites AGENTS.md: it appends a "This is NOT the Next.js you know" block to this file on every start. Preserve the project and user instructions here; review generated additions separately and never reset the entire file to discard development output.

Read the full file on GitHub · 307 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. 3d ago Changed · +6 lines · +256 tokens per session 2e03b17cab79
  2. 4d ago Changed · +5 lines · +116 tokens per session 12cead04fe17
  3. 5d ago Changed · +10 lines · +188 tokens per session 90c6cfb0465e
  4. 6d ago Changed · +5 lines · +134 tokens per session 638bea26d3fb
  5. 8d ago Changed · +6 lines · +99 tokens per session 7e9e7a64c922
  6. 15d ago Changed · +72 tokens per session 466224784129
  7. 17d ago Changed · +60 tokens per session e0ee52583180
  8. 18d ago Changed · +12 lines · +186 tokens per session ce3cb1199166
  9. 19d ago Changed · +2 lines · +136 tokens per session fce69b3665ef
  10. 20d ago First seen · 261 lines · 6,814 tokens per session scan B 7a21ddf450c0

Subscribe to this mod's changes

pi-agent-desktop AGENTS.md is an instructions file published in the GitHub repository abcwyc/pi-agent-desktop (900 stars, last pushed 2d ago), licensed MIT. It adds 8,061 tokens to every session, about $0.0322 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads mcp configuration). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

pi-agent-desktop AGENTS.md compared with instructions from other repositories

pi-agent-desktop AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pi-agent-desktop AGENTS.mdabcwyc/pi-agent-desktopInstructions file9002d agoMITB8,061Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode