phi AGENTS.md

phi AGENTS.md is an instructions file for Codex, OpenCode from pulseaiclub/phi. It costs 856 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

Install

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.

agentmods
npx agentmods add instructions/pulseaiclub/phi/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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 856 This file is loaded in full into every session.
When invoked 856 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00856 $0.00856
Opus 5 $0.00428 $0.00428
Sonnet 5 $0.00171 $0.00171
Haiku 4.5 $0.00086 $0.00086

Measured 3d ago against content hash 854300692db5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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 · 54 lines

How it starts

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

Phi

Minimal 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 — only mcp_list / mcp_inspect / mcp_call.
  • Extensions are yaegi-loaded Go under ~/.phi/extensions / .phi/extensions. Public API: ext package. Runtime: internal/extension. See doc/extensions.md.
  • Keep hashline edit. Don't replace it with whole-file rewrite. Stale @file path#TAG / LINE#HASH must fail closed.
  • 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 (read-only).
  • 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. Direct module deps are few on purpose. Don't add a dependency without a clear need.
  • 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 · 54 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 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 (201 stars, last pushed 3d ago), licensed MIT. It adds 856 tokens to every session, about $0.0043 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.