peter-y

AGENTS.md for Pi

Oct 21st, 2026
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.10 KB | Software | 0 0
  1. # Global agent instructions
  2.  
  3. ## Scratchpad (under-the-hood planning)
  4.  
  5. Every **session** has its own scratchpad: `.pi/scratchpad-<session8>.md`
  6. (first 8 chars of the session ID; created automatically if missing). Parallel
  7. sessions in one project each own a separate file — no cross-session overwrites.
  8.  
  9. - For any non-trivial task — even without an explicit planning request — write a short plan
  10. into **your** scratchpad before starting work: the task in `## Task`, concrete steps
  11. as `- [ ]` checkmarks under `## Plan`.
  12. - Tick items off (`- [x]`) as you complete them, and append new steps when the plan changes.
  13. - On session start/restore, **your** scratchpad is injected into your system prompt —
  14. use it to resume exactly where a previous (possibly crashed) session left off.
  15. - **Never edit other sessions' scratchpad files** (`.pi/scratchpad-*.md` with a different
  16. session id). If you need to hand work off, write a separate handoff file and tell the
  17. user — do not touch another session's plan.
  18. - Scratchpad = **the current task only**. Durable project facts (environment, decisions,
  19. glossary) belong in the project AGENTS.md / skills, not in the scratchpad.
  20.  
  21. ## Project orientation
  22.  
  23. - Your working directory (`cwd`) is the project root. Explore it with `ls`/`read`/`grep`
  24. before assuming you know the layout.
  25. - Project-specific `AGENTS.md` files (working directory and parents) are auto-loaded into
  26. your system prompt; treat them as the authoritative description of the project.
  27.  
  28. ## Memory & skills (how to maintain them)
  29.  
  30. Memory files: global `~/.pi/agent/AGENTS.md` (this file), per-project `AGENTS.md`
  31. (working directory and parents), per-project skills in `.pi/skills/`.
  32. They are **loaded into your system prompt at session start** — read them as the source of
  33. truth, not as hints to verify from scratch.
  34.  
  35. - **Follow them first.** If a fact (password location, command, path, workflow) is recorded
  36. in memory, use it directly. Do not re-derive it by probing, searching, or trial-and-error.
  37. - **Record durable findings as you go.** When you discover a reusable fact (a working
  38. command, a credential location, an environment quirk), add it to the appropriate memory
  39. file during the session — do not leave it only in chat.
  40. - **Level of a fact:** repo-specific → project `AGENTS.md`; environment/VM/credentials →
  41. global `~/.pi/agent/AGENTS.md`; a repeatable multi-step workflow (3+ uses) → a skill in
  42. `.pi/skills/`.
  43. - **Generality:** record patterns, not one-offs. A note is worth keeping only if it will
  44. be reused in future tasks.
  45. - **Prune, don't accumulate.** When adding a note, check for stale or duplicate entries and
  46. merge/remove them. Memory files must stay short — every line costs context in every
  47. session.
  48.  
  49. ## Tool safety
  50.  
  51. - Do not run any git command that changes the repo or history (commit, push, reset, rebase,
  52. merge, restore, checkout/switch, stash, tag, clean, etc.) unless explicitly asked.
  53. - Do not install packages, dependencies, or global tools unless explicitly asked.
  54. - Do not run heavy project-wide test suites unless explicitly asked.
Advertisement
Add Comment
Please, Sign In to add comment