pi
AGENTS.md122k starsChanged 4 months agoMITView on GitHub
Binding for Chord v2 (packages/chord/src/) and its tests, when writing and when reviewing. The model is pi-durable's source.
- Deletes or force-pushes
- Installs packages
Trending
Steady talk.about the whole repository
Who's talking about earendil-works/pi
- A Hacker News story“Pi coding agent: config folder is out of place on Linux”Hacker News · Aug 17, 2026 · 56 points
- JetBrains/thinkrail“Add a custom AI endpoint (models.json provider) form to Providers settings”GitHub · Sep 7, 2026 · 14 reactions
- A Hacker News story“Pi v1.0.0”Hacker News · Oct 1, 2026 · 12 points
- slopus/happy“Feature: Pi Agent support (happy pi)”GitHub · Jun 21, 2026 · 12 reactions
- can1357/oh-my-pi“support the new official “Sign in with ChatGPT” flow”GitHub · Oct 1, 2026 · 7 reactions
The biggest 5 of 80 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 80
Talked about on GitHub, Bluesky and Hacker News (80 times).
On GitHub · 50
- Sep 7, 2026Add a custom AI endpoint (models.json provider) form to Providers settings — JetBrains/thinkrail14 reactions · 1 comment
- Jun 21, 2026Feature: Pi Agent support (happy pi) — slopus/happy12 reactions · 2 comments
- Oct 1, 2026support the new official “Sign in with ChatGPT” flow — can1357/oh-my-pi7 reactions
- Jun 4, 2026pi-coding-agent: remove koffi removal (it has been removed upstream) — NixOS/nixpkgs5 reactions · 2 comments
- May 29, 2026Update OLLAMA_API_KEY — fgrehm/pi-ollama-cloud5 reactions
45 more on GitHub
- Nov 1, 2026ask_user_question: Support OSC 7501 states — juicesharp/rpiv-mono4 reactions · 4 comments
- May 20, 2026fix(pi-fff): compose pi-fff editor with other extensions (#475) — dmtrKovalenko/fff4 reactions · 4 comments
- Nov 6, 2026[Bug]: Pi inline screenshots cause visible flashing and apparent history replay on macOS — herdrdev/herdr-app3 reactions
- Jul 4, 2026pi.dev: feature installation with concrete version fails to fetch release tags from the (old) pi-mono repository — devcontainer-community/devcontainer-features3 reactions · 1 comment
- Jun 2, 2026server: add SSE ping interval — ggml-org/llama.cpp3 reactions
- May 16, 2026Make editor integration compose with other pi editor extensions — nicobailon/pi-powerline-footer3 reactions · 1 comment
- Nov 11, 2026fix(pi): 兼容官方 Pi 1.5.0 并更新 runtime pin — makecindy/cindy2 reactions · 2 comments
- Nov 9, 2026build(deps): bump @earendil-works/pi-tui from 1.4.0 to 1.5.0 — steipete/poltergeist2 reactions · 2 comments
- Oct 26, 2026build(deps): bump @earendil-works/pi-tui from 1.3.0 to 1.4.0 — steipete/poltergeist2 reactions · 5 comments
- Oct 19, 2026build(deps): bump @earendil-works/pi-tui from 1.2.0 to 1.3.0 — steipete/poltergeist2 reactions · 3 comments
- Oct 17, 2026fix: import clampThinkingLevel from @earendil-works/pi-ai/compat — twoGiants/pi-anthropic-vertex2 reactions · 1 comment
- Oct 7, 2026build(deps): refresh eligible dependencies and source-map security fix — steipete/poltergeist2 reactions · 3 comments
- Oct 5, 2026chore: bump @earendil-works/pi-tui from 0.99.1 to 1.0.0 — steipete/poltergeist2 reactions · 4 comments
- Sep 28, 2026chore: bump @earendil-works/pi-tui from 0.86.1 to 0.87.1 — steipete/poltergeist2 reactions · 4 comments
- Sep 23, 2026agent_browser_code strict schema breaks every request on Anthropic strict-tool models (minimum/maximum not supported) — fitchmultz/pi-agent-browser-native2 reactions · 2 comments
- Sep 22, 2026FYI: upstream pi is building @earendil-works/chord — a plugin composition runtime (facets, replicated state, remote services) — jmfederico/pi-web2 reactions · 3 comments
- Sep 22, 2026build(deps): refresh compatible runtime and development tools — steipete/poltergeist2 reactions · 2 comments
- Sep 19, 2026fix(discovery): report offline startup skips — balcsida/pi-provider-litellm2 reactions · 1 comment
- Sep 7, 2026fix(om): resolve worker streamSimple through modelRegistry for custom providers — k0valik/pi-blackhole2 reactions · 1 comment
- Aug 31, 2026rfc: agent sandbox protocol — harbor-framework/harbor2 reactions · 15 comments
- Aug 31, 2026chore: refresh CLI dependencies and daemon integration proof — steipete/poltergeist2 reactions · 2 comments
- Aug 24, 2026Claude OAuth login / clarify ToS risk vs. Anthropic's stated policy — 1jehuang/jcode2 reactions · 1 comment
- Aug 17, 2026chore(deps): bump @earendil-works/pi-tui from 0.84.1 to 0.84.2 — steipete/poltergeist2 reactions · 4 comments
- Aug 2, 2026Update GitHub Copilot GPT-5.6 Terra and Luna pricing — anomalyco/models.dev2 reactions
- Jul 31, 2026支持 Pi Agent (earendil-works/pi) 会话索引 — zszz3/AgentRecall2 reactions
- Jul 27, 2026chore(deps): bump @earendil-works/pi-tui from 0.80.10 to 0.82.1 — steipete/poltergeist2 reactions · 3 comments
- Jul 26, 2026Signed thinking blocks are dropped from replayed requests and `usage.reasoning` is omitted — leohenon/pi-anthropic-oauth2 reactions
- Jul 16, 2026chore(deps): refresh compatible dependencies — steipete/poltergeist2 reactions · 1 comment
- Jul 1, 2026Add Claude Sonnet 5 for GitHub Copilot — anomalyco/models.dev2 reactions · 4 comments
- Jul 1, 2026build(deps-dev): bump @earendil-works/pi-coding-agent from 0.74.2 to 0.79.0 — buihongduc132/pi-goal-xx2 reactions · 3 comments
- Jun 30, 2026Bump the npm_and_yarn group across 1 directory with 9 updates — moshehbenavraham/crocbot2 reactions · 4 comments
- Jun 29, 2026chore(deps): bump @earendil-works/pi-tui from 0.79.4 to 0.80.2 — steipete/poltergeist2 reactions · 1 comment
- Jun 22, 2026chore(deps): bump @earendil-works/pi-tui from 0.79.4 to 0.79.10 — steipete/poltergeist2 reactions · 2 comments
- Jun 22, 2026build(deps): bump the npm_and_yarn group across 3 directories with 13 updates — vzwjustin/openclaw2 reactions · 1 comment
- Jun 20, 2026build(deps): bump the npm_and_yarn group across 4 directories with 11 updates — JxnLexn/openclaw2 reactions · 2 comments
- Jun 20, 2026chore(deps): bump the npm_and_yarn group across 4 directories with 9 updates — EvezArt/openclaw-fork2 reactions · 2 comments
- Jun 20, 2026build(deps): bump the npm_and_yarn group across 4 directories with 9 updates — dutch2005/openclaw2 reactions · 1 comment
- Jun 15, 2026chore(deps): bump @earendil-works/pi-tui from 0.79.1 to 0.79.4 — steipete/poltergeist2 reactions · 1 comment
- May 27, 2026fix(cli): reduce grep context amplification — Kilo-Org/kilocode2 reactions · 1 comment
- May 7, 2026How are subagents spawned? — itayinbarr/little-coder2 reactions · 2 comments
- Nov 5, 2026[Bug]: Pi fullscreen Kitty images disappear or become incomplete after CSI 2K row clearing — stablyai/orca1 reaction · 1 comment
- Oct 16, 2026[Pi issue #11021] openai: ChatGPT sign-in still uses 272K for GPT-6.1 Sol despite 500K account catalog — oigorbrito/FineCode1 reaction
- Oct 12, 2026Pasting a Finder-copied file/folder into a CLI agent (Claude Code, Codex) attaches the icon as [Image 1] instead of the path — warpdotdev/warp1 reaction · 3 comments
- Oct 4, 2026panic: index out of bounds (JSC) when a host compiles a large TS extension file — deterministic, sourcemap offset suspected — oven-sh/bun1 reaction · 1 comment
- Sep 30, 2026feat(usage): support the new OpenAI ChatGPT plan login — Gentleman-Programming/gentle-shell1 reaction · 5 comments
On Bluesky · 25
- Aug 26, 2026recommend installing pi if you're just exploring and testing new stuff — @ruoshuiresearch.bsky.socialsays it tested it6 likes and reposts
- Sep 15, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 105,424 (+437) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending.bsky.social4 likes and reposts · 1 reply
- Sep 5, 2026最近claude codeの開発遅くなってない? 複雑なやつだと遅すぎて無理になって最近Pi agentに戻ってきた ハーネスがシンプルでモデルの持ってる本来の能力が出やすくいし爆速 claude codeのサブスク使う方法もある… — @kojira.io4 likes and reposts · 1 reply
- Aug 15, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 90,760 (+924) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social4 likes and reposts · 1 reply
- May 24, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 53,615 (+444) 🗒 TypeScript AI agent toolkit: coding agent CLI, unified LLM… — @github-trending.bsky.social4 likes and reposts · 1 reply
20 more on Bluesky
- Oct 21, 20265 amazing tools for coders github.com/thesysdev/o... - Open-source AI interfaces github.com/earendil-wo... - Open-source AI coding agent… — @csaba.bsky.social3 likes and reposts
- Aug 8, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 85,116 (+527) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- May 25, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 53,615 (+444) 🗒 TypeScript AI agent toolkit: coding agent CLI, unified LLM… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- May 29, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 56,786 (+835) 🗒 TypeScript AI agent toolkit: coding agent CLI, unified LLM… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- May 19, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 51,039 (+446) 🗒 TypeScript AI agent toolkit: coding agent CLI, unified LLM… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- Oct 1, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 110,922 (+294) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social1 likes and repost
- Oct 1, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 110,922 (+294) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending.bsky.social1 likes and repost
- Sep 2, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 100,843 (+559) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Aug 16, 2026AI agent toolkit: unified LLM API, agent loop, TUI, coding agent CLI github.com/earendil-wor... — @tsumineko.at.mitsuse.jp1 likes and repost
- Aug 15, 2026unfortunately all of the people making them are optimizing for their m5 max macbooks and are also all vibecoded. maybe pi is good but i… — @madoka.systems1 likes and repost · 1 reply
- Jul 26, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 77,390 (+781) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Jul 22, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 earendil-works / pi ⭐ 74,325 (+1,222) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Jul 15, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 70,871 (+603) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Jun 16, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 63,139 (+327) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- May 8, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 46,392 (+639) 🗒 TypeScript AI agent toolkit: coding agent CLI, unified LLM… — @github-trending-js.bsky.social1 likes and repost · 2 replies
- Oct 18, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 116,045 (+206) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Sep 21, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 108,014 (+438) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Sep 16, 2026Why is github.com/earendil-wor... with >100k stars on place #478 on the "by stars" page? -> alltheagents.org/stars/ — @fry69.dev0 likes and reposts · 1 reply
- Sep 15, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 earendil-works / pi ⭐ 105,424 (+437) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
- Aug 12, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 earendil-works / pi ⭐ 87,424 (+919) 🗒 TypeScript AI agent toolkit: unified LLM API, agent loop,… — @github-trending-js.bsky.social0 likes and reposts · 1 reply
On Hacker News · 5
- Aug 17, 2026Pi coding agent: config folder is out of place on Linux56 points · 21 comments
- Oct 1, 2026Pi v1.0.012 points · 2 comments
- Nov 10, 2026Pi: Virtual Models2 points
- Oct 26, 2026Chord, distributed objects and hot reload for pi-durable1 point
- Aug 11, 2026Pi's AgentHarness: From an In-Process Loop to a Durable Runtime1 point
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,439 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
43 rules. About 0 are common, 26 are distinctive, and 17 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
Distinctive · estimate
This author's own choices. Worth a look.
17
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 5
Keep answers short and concise
- Distinctive: line 6
No emojis in commits, issues, PR comments, or code
- Distinctive: line 7
No fluff or cheerful filler text (e.g., "Thanks @user" not "Thanks so much @user!")
- Distinctive: line 9
Use concise, clear, simple language.
- Distinctive: line 11
Prefer concrete behavior and small illustrations over abstract summaries, dense terminology, or unexplained lists of changes.
- Distinctive: line 12
When the user asks a question, answer it first before making edits or running implementation commands.
- Distinctive: line 13
When responding to user feedback or an analysis, explicitly say whether you agree or disagree before saying what you changed.
- Distinctive: line 17
Read files in full before wide-ranging changes, before editing files you have not fully inspected, and when asked to investigate or audit.
- Very specific: line 19
No runtime checks of values whose types TypeScript already guarantees (no typeof/instanceof/Array.isArray/shape guards on typed parameters, …
- Distinctive: line 21
Check node_modules for external API types.
- Distinctive: line 24
Never remove or downgrade code to fix type errors from outdated deps.
- Very specific: line 25
Use only erasable TypeScript syntax (Node strip-only mode) in code checked by the root config (packages/*/src, packages/*/test, …
- Distinctive: line 26
Always ask before removing functionality or code that appears intentional.
- Distinctive: line 27
Do not preserve backward compatibility unless the user asks for it.
- Very specific: line 28
Never hardcode key checks (e.g.
- Very specific: line 43
Before reporting: re-read every changed file top to bottom as a stranger would.
- Very specific: line 47
After code changes (not docs): npm run check (full output, no tail).
- Very specific: line 50
Never run npm test unless requested by the user.
- Very specific: line 51
Never run the full vitest suite directly: it includes e2e tests that activate when endpoint/auth env vars are present.
- Distinctive: line 54
If you create or modify a test file, run it and iterate on test or implementation until it passes.
- Distinctive: line 56
When regressions tests for fixing a github issue, add a comment with the github issue number next to the test.
- Distinctive: line 58
Never commit unless the user asks.
- Distinctive: line 62
Treat npm dep and lockfile changes as reviewed code.
- Very specific: line 63
When updating undici, you MUST read its changelog/release notes for the target version and evaluate whether any changes may affect …
- Very specific: line 65
If dep metadata changes, refresh package-lock.json with npm install --package-lock-only --ignore-scripts.
- Very specific: line 66
If packages/coding-agent/install-lock/ needs regen, run node scripts/generate-coding-agent-install-lock.mjs (verify with --check or npm run …
- Distinctive: line 75
Only commit files YOU changed in THIS session.
- Distinctive: line 77
Before committing, run git status and verify you are only staging your files.
- Distinctive: line 81
Never run (destroys other agents' work or bypasses checks):
- Distinctive: line 85
If rebase conflicts occur:
- Distinctive: line 88
If a conflict is in a file you did not modify, abort and ask the user.
- Very specific: line 97
Do not run gh pr checkout, git switch, or otherwise move the worktree to the PR branch unless the user explicitly asks.
- Very specific: line 98
Use gh pr view, gh pr diff, gh api, and local git show/git diff against fetched refs to inspect PR metadata, commits, and patches without …
- Very specific: line 99
If you need PR file contents, fetch/read them into temporary files or use git show <ref>:<path> without switching branches.
- Very specific: line 103
Add pkg:* labels for affected packages (pkg:agent, pkg:ai, pkg:coding-agent, pkg:tui).
- Distinctive: line 105
When posting issue/PR comments:
- Very specific: line 107
Write the comment to a temp file and post with gh issue/pr comment --body-file (never multi-line markdown via --body).
- Distinctive: line 108
Keep comments concise, technical, in the user's tone.
- Distinctive: line 111
When closing issues via commit:
- Very specific: line 117
Before writing or reviewing plugin code in apps/p2 (server and worker facets, contracts, stores), read apps/p2/docs/plugin-practices.md in …
- Very specific: line 135
All new entries go under ## [Unreleased].
- Distinctive: line 137
Do not create changelog entries when the work targets a branch other than main
- Distinctive: line 150
If the user's instructions conflict with any rule in this document, ask for explicit confirmation before overriding.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Development Rules
Conversational Style
- Keep answers short and concise
- No emojis in commits, issues, PR comments, or code
- No fluff or cheerful filler text (e.g., "Thanks @user" not "Thanks so much @user!")
- Technical prose only, be direct
- Use concise, clear, simple language. Define unavoidable jargon before using it.
- Explain non-trivial designs and problems as: problem, concrete example or short trace, then solution. State why the solution is necessary and distinguish it from optional complexity.
- Prefer concrete behavior and small illustrations over abstract summaries, dense terminology, or unexplained lists of changes.
- When the user asks a question, answer it first before making edits or running implementation commands.
- When responding to user feedback or an analysis, explicitly say whether you agree or disagree before saying what you changed.
Code Quality
- Read files in full before wide-ranging changes, before editing files you have not fully inspected, and when asked to investigate or audit. Do not rely on search snippets for broad changes.
- No
anyunless absolutely necessary. - No runtime checks of values whose types TypeScript already guarantees (no
typeof/instanceof/Array.isArray/shape guards on typed parameters, typed callback results or typed declarations). Validate only at decided trust boundaries (wire input, schema-checked arguments and params). - Inline single-line helpers that have only one call site.
- Check node_modules for external API types; don't guess.
- No inline imports (
await import(),import("pkg").Type, dynamic type imports). Top-level imports only. - In
packages/coding-agent, resolve package assets through helpers insrc/config.ts. Do not use__dirnamedirectly; the helpers account for source checkouts, npm installations, and standalone binaries. - Never remove or downgrade code to fix type errors from outdated deps; upgrade the dep instead.
- Use only erasable TypeScript syntax (Node strip-only mode) in code checked by the root config (
packages/*/src,packages/*/test,packages/coding-agent/examples): no parameter properties,enum,namespace/module,import =,export =, or other constructs needing JS emit. Use explicit fields with constructor assignments. - Always ask before removing functionality or code that appears intentional.
- Do not preserve backward compatibility unless the user asks for it.
- Never hardcode key checks (e.g.
matchesKey(keyData, "ctrl+x")). Add defaults toDEFAULT_EDITOR_KEYBINDINGSorDEFAULT_APP_KEYBINDINGSso they stay configurable. - Never modify
packages/ai/src/models.generated.tsdirectly; update the catalog definitions inpackages/ai/catalog/instead (see its README), then regenerate. Including the resultingmodels.generated.tsdiff is always OK, even if regeneration includes unrelated upstream model metadata changes. The generated model data inpackages/ai/src/providers/data/is gitignored: never stage it, and don't look for it in git history.
Chord v2 Code Style
Binding for Chord v2 (packages/chord/src/) and its tests, when writing and when reviewing. The model is pi-durable's source.
- Files: one concept per file, named after it; no one-helper files, no grab-bag files. First line: a comment saying what the file is for. Order: imports, exported types, then the public entry point first and its helpers below it in the order they are used; constants right above their first user. A blank line between top-level declarations. Split files by concept, never by size: one concept may take a long file (up to about 1,000 lines is fine); a second concept in a file is the reason to split.
- Functions: every export has a one-line doc comment saying what it does or guarantees. Inline comments explain a non-obvious why (cost, race, decided rule), never what the next line does. Short functions with one job (about 40 lines needs a reason; one
switchover a tagged union is fine). No boolean flag parameters that switch behaviour: two functions or a tagged value. Never write the same lines twice. Context last: required args, thencontext/ctx(always required, as in Durable; optional only on error-reporting paths), then optional args. - Types and checks: tagged unions for every state and result. Casts only where TypeScript cannot express a decided invariant, each with a short why. Every remaining runtime check names the trust boundary it serves (wire input, schema-checked params and arguments, declaration policy the types cannot express). Same-host values are plain data, immutable by convention: never copied, frozen or walked to enforce it; freeze only Chord-owned metadata when a decision says so. No defensive code against broken adapters, callers or our own modules.
- Cost and memory: no hot-path work a decision did not ask for (walks, copies, compilations, per-call allocations). The function doing counted work counts it through its context; call sites never count for others. Caches are
WeakMaps keyed by their owner, each with a GC test; no module-level strong caches. - Names and API: the design's vocabulary (
params,binding,principal key), no invented synonyms; decidedChordErrorcodes and reasons. Export only what a later layer or app needs. No dev or test modes, no unrequested options. - Tests: one test file per source file, one
describeper mechanism, the layer spec's test list case by case; cost guards through the in-memory telemetry adapter; GC tests for every cache and binding. Every slice also adds one or more runnable examples inpackages/chord/test/examples/NN-topic.ts, one topic each, numbered across slices, written as references for Chord's users (Durable'stest/examples/format: header with what it shows and how to run it, commented steps, printed results). - Slices: Chord v2 is built in vertical slices (
packages/chord/docs/slices.md). Implementers and reviewers read the slice spec, the feature map inslices.mdand the whole ofpackages/chord/docs/design.mdin full, and check the work against all three; slice specs cite design sections for orientation, not as a reading limit. - Deferred work: anything left to a later slice goes into the section "Carry-over" of
packages/chord/docs/slices.mdunder that slice, in the same change; a slice's spec and build include every entry of its section. - Before reporting: re-read every changed file top to bottom as a stranger would; each file must be understandable without jumping around. Then
npm run checkand the layer's tests.
Commands
- After code changes (not docs):
npm run check(full output, no tail). Fix all errors, warnings, and infos before committing. Does not run tests. apps/p2is outside the root check and the root tests. After p2 changes also runcd apps/p2 && npm run check; p2's suite iscd apps/p2 && npm test(TUI tests need Node 26, browser tests needCHROMIUM_BIN).- Run
npm run buildwhenever something needs built output (dist/): tests or benchmarks that import built packages, Durable's workerd suite. The full suites of Chord and Durable need it: Chord's tests that start Node processes or bundle with esbuild load workspace packages fromdist/(the rest run from source by its vitest config), and Durable imports pi-ai'sutils/*, which have no source export. Never use it to type check or lint: that isnpm run check, the preferred check. - Never run
npm testunless requested by the user. - Never run the full vitest suite directly: it includes e2e tests that activate when endpoint/auth env vars are present. For all non-e2e tests, run
./test.shfrom the repo root. It runspackages/*only. Otherwise run specific tests from the package root:- Vitest:
node "$(git rev-parse --show-toplevel)/node_modules/vitest/dist/cli.js" --run test/specific.test.ts packages/tui(node:test):node --test test/specific.test.ts
- Vitest:
- If you create or modify a test file, run it and iterate on test or implementation until it passes.
- For
packages/coding-agent/test/suite/, usetest/suite/harness.ts+ the faux provider. No real provider APIs, keys, or paid tokens. - When regressions tests for fixing a github issue, add a comment with the github issue number next to the test.
- For ad-hoc scripts,
writethem to a temp file (e.g./tmp), run, edit if needed, remove when done. Don't embed multi-line scripts inbashcommands. - Never commit unless the user asks.
Dependency and Install Security
- Treat npm dep and lockfile changes as reviewed code. Direct registry deps, including internal workspace deps, stay pinned to exact versions.
- When updating
undici, you MUST read its changelog/release notes for the target version and evaluate whether any changes may affect functionality before applying the update. - Hydrate/update locally with
npm install --ignore-scripts; clean/CI-style withnpm ci --ignore-scripts. Don't run lifecycle scripts unless the user asks. - If dep metadata changes, refresh
package-lock.jsonwithnpm install --package-lock-only --ignore-scripts. - If
packages/coding-agent/install-lock/needs regen, runnode scripts/generate-coding-agent-install-lock.mjs(verify with--checkornpm run check). New deps with lifecycle scripts require review and an explicit allowlist entry in that script; never add one silently. - Pre-commit blocks lockfile commits unless
PI_ALLOW_LOCKFILE_CHANGE=1. Don't bypass unless the user wants the lockfile change committed.
Git
Multiple pi sessions may be running in this cwd at the same time, each modifying different files. Git operations that touch unstaged, staged, or untracked files outside your own changes will stomp on other sessions' work. Follow these rules:
Committing:
- Only commit files YOU changed in THIS session.
- Stage explicit paths (
git add <path1> <path2>); nevergit add -A/git add .. - Before committing, run
git statusand verify you are only staging your files. packages/ai/src/models.generated.tsmay always be included alongside your files.- Message format:
{feat,fix,docs}[(ai,tui,agent,coding-agent)]: <commit message> (optionally multiple lines). Message is informative and concise.
Never run (destroys other agents' work or bypasses checks):
git reset --hard,git checkout .,git clean -fd,git stash,git add -A,git add .,git commit --no-verify.
If rebase conflicts occur:
- Resolve conflicts only in files you modified.
- If a conflict is in a file you did not modify, abort and ask the user.
- Never force push.
Issues and PRs
See CONTRIBUTING.md for the contributor gate (auto-close workflows, lgtm/lgtmi, quality bar).
When reviewing PRs:
- Do not run
gh pr checkout,git switch, or otherwise move the worktree to the PR branch unless the user explicitly asks. - Use
gh pr view,gh pr diff,gh api, and localgit show/git diffagainst fetched refs to inspect PR metadata, commits, and patches without changing branches. - If you need PR file contents, fetch/read them into temporary files or use
git show <ref>:<path>without switching branches.
When creating issues:
- Add
pkg:*labels for affected packages (pkg:agent,pkg:ai,pkg:coding-agent,pkg:tui); use all that apply.
When posting issue/PR comments:
- Write the comment to a temp file and post with
gh issue/pr comment --body-file(never multi-line markdown via--body). - Keep comments concise, technical, in the user's tone.
- End every AI-posted comment with the AI-generated disclaimer line specified by the originating prompt (e.g.
This comment is AI-generated by/wr``).
When closing issues via commit:
- Include
fixes #<number>orcloses #<number>in the message so merging auto-closes the issue. For multiple issues, repeat the keyword per issue (closes #1, closes #2); a shared keyword (closes #1, #2) only closes the first.
Writing p2 plugin code
Before writing or reviewing plugin code in apps/p2 (server and worker facets, contracts, stores), read apps/p2/docs/plugin-practices.md in full and follow it.
Building p2's web UI
For building or changing p2's web UI (apps/p2), load and follow .pi/skills/p2-ui.md.
Testing pi Interactive Mode with tmux
For testing pi's interactive mode, load and follow .pi/skills/interactive-testing.md.
Changelog
Location: packages/*/CHANGELOG.md (one per package).
Sections under ## [Unreleased]: ### Breaking Changes (API changes requiring migration), ### Added, ### Changed, ### Fixed, ### Removed.
Rules:
- All new entries go under
## [Unreleased]. Read the full section first and append to existing subsections; never duplicate them. - Released version sections (e.g.
## [0.12.2]) are immutable; never modify them. - Do not create changelog entries when the work targets a branch other than
main
Attribution:
- Internal (from issues):
Fixed foo bar ([#123](https://github.com/earendil-works/pi/issues/123)) - External contributions:
Added feature X ([#456](https://github.com/earendil-works/pi/pull/456) by [@username](https://github.com/username))
Releasing
For release preparation, publishing, verification, or recovery, load and follow .pi/skills/release.md.
User Override
If the user's instructions conflict with any rule in this document, ask for explicit confirmation before overriding. Only then execute their instructions.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

