phi: Instructions file for Codex

AGENTS.md

phi AGENTS.md is an instructions file for Codex, OpenCode from pulseaiclub/phi. It costs 1,063 tokens per session, scanned A, original, MIT.

Repository-specific instructions for Phi, a small Go terminal program that acts as a coding agent. They describe its communication style, extension system, permission checks, file editing rules, and command flow.

In plain words
What is it for?
Working on Phi’s Go code, extensions, terminal interface, tool permissions, file edits, and sub-agent job handling.
Why use it?
They keep changes compatible with the project’s safety boundaries and design choices, especially around permissions, extensions, and stale file references.

Instructions file for CodexOpenCode

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

This is pulseaiclub/phi's own configuration. It tells Codex and OpenCode how to work on phi 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 phi configures →

Reuse

Borrowing it

Nothing to install: this file belongs to pulseaiclub/phi. 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/pulseaiclub/phi/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/pulseaiclub/phi

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 phi AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/pulseaiclub/phi/agents-md/github.svg)](https://agentmods.dev/instructions/pulseaiclub/phi/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/pulseaiclub/phi/agents-md"><img src="https://agentmods.dev/badge/instructions/pulseaiclub/phi/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 phi AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/pulseaiclub/phi/agents-md"><img src="https://agentmods.dev/badge/instructions/pulseaiclub/phi/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,063 This file is loaded in full into every session.
When invoked 1,063 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01063 $0.01063
Opus 5.5 $0.00425 $0.00425
Sonnet 5.5 $0.00213 $0.00213
Haiku 4.5 $0.00106 $0.00106

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

Security

Grade A, and why

phi 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 22d 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.

AGENTS.md · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Phi

Lean, high-performance Go terminal coding-agent harness. Layout: doc/project-layout.md. Humans: CONTRIBUTING.md.

Communication Preferences

  • Dry, concise, low-key humor. No flattery, no forced memes. Skip preambles and postambles.
  • Comments explain "why", not "what". English only — this repo was migrated off Chinese comments.
  • Error messages: actionable and specific. No vague "something went wrong".

Constraints

  • Tool loop is ExtensionPre → Gate/Ask → Run → ExtensionPost. Don't bypass the permission gate when changing the executor. Don't put MCP server tool schemas on the model — MCP rides ls / read / write via mcp:// URLs.
  • Extensions are PXB subprocesses (phi.yaml + native binary under ~/.phi/extensions / .phi/extensions). Wire: ext/go/pxb. Author SDK: Go ext/go/phi (module github.com/pulseaiclub/phi/ext/go). Host: internal/extension. See doc/extensions.md.
  • PXB message payloads are generated. Fields are declared once in ext/go/pxb/schema.go (pxb:"<tag>[,opt]"); make generate writes msg_gen.go. Never hand-edit msg_gen.go or add encode/decode switches — make check runs generate-check and fails on drift. The Rust side (ext/rust/src/pxb/msg.rs) mirrors the same tags by hand.
  • Keep edit fail-closed. Edits are anchored sloppy patches (*** SM:EDIT / *** SM:FIND / *** SM:PUT|*** SM:AFTER) applied atomically; a missing or ambiguous anchor must fail with actionable guidance, never fall back to whole-file rewrite.
  • Sub-agent transcripts stay under ~/.phi/jobs/<id>/. Parent context gets the wait/task summary only. Child engines have no agent_* tools (no nesting). Default child role is explore (no write/edit; bash allowed except hard denies).
  • UI split: internal/components render; internal/tui wires the shell. Non-shell pieces live under internal/tui/controller (Engine/Bus/Msg), internal/tui/transcript (Mapper); version in internal/version. Keep widgets dumb.
  • TUI assembly: cmd constructs controller.Bus / controller.Controller / App and passes them into editor.NewEditor(...), which builds the commands registry (commands.NewBuiltinRegistry). Do not hide GetDefaultProject inside tui constructors; do not return half-initialized Controllers (engineErr zombies). Prefer constructor parameters over XxxDeps bags.
  • Stay lean and fast. Direct module deps are few on purpose. Don't add a dependency without a clear need. Prefer changes that keep startup, idle RSS, and rebuild time small.
  • Format with make fmt (gofumpt / goimports / golines, 120 cols, local prefix github.com/pulseaiclub/phi). Don't hand-fight import groups.
  • testing / testify stay in *_test.go. depguard will fail the lint otherwise.
  • Tests use testify (assert / require) for assertions — no raw t.Fatalf checks.
  • After dependency changes: go mod tidy. go.mod is not generated.

Read the full file on GitHub · 56 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. 22d ago Changed · +2 tokens per session 2b291e465de9
  2. 1mo ago Changed · +32 tokens per session e05ad0522dd3
  3. 1mo ago Changed · +2 lines · +114 tokens per session f123b91a2438
  4. 1mo ago Changed · +19 tokens per session 9ada29491b70
  5. 1mo ago Changed · +7 tokens per session 910c4cc526c0
  6. 2mo ago Changed · +33 tokens per session ccd345f1ea7f
  7. 2mo ago First seen · 54 lines · 856 tokens per session scan A 854300692db5

Subscribe to this mod's changes

phi AGENTS.md is an instructions file published in the GitHub repository pulseaiclub/phi (887 stars, last pushed yesterday), licensed MIT. It adds 1,063 tokens to every session, about $0.0043 per session on Opus 5.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.

Related

phi AGENTS.md compared with instructions from other repositories

phi AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
phi AGENTS.mdpulseaiclub/phiInstructions file887yesterdayMITA1,063Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,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