agents-md

A guide for creating or restructuring an AGENTS.md file, which stores instructions for coding agents working in a project. It keeps general rules short and points to detailed instructions only when needed.

In plain words
What is it for?
It helps document a project's technology, entry points, constraints, automated checks, and related skill files. It can also split detailed rules out of an oversized AGENTS.md.
Why use it?
It prevents the agent's instruction file from becoming long, repetitive, or hard to follow. It also makes important project rules easier to find.

Skill for Claude CodeCodex

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 skills/sliday/harn/agents-md
Any agent
npx skills add sliday/harn --skill agents-md
Clone the repo
git clone --depth 1 https://github.com/sliday/harn

Made for: Claude Code, Codex.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 476 The whole file, excluding the scripts and references it only reads on demand.
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.00039 $0.00476
Opus 5 $0.00019 $0.00238
Sonnet 5 $0.00008 $0.00095
Haiku 4.5 $0.00004 $0.00048

Measured 2d ago against content hash 52d5d320b14f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

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 2d 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.

skills/agents-md/SKILL.md · 51 lines

What it actually says

Reference: https://harn.app/kb/specs.html — "12 Factor Agents"

Reference: https://harn.app/kb/context.html — "Writing a good CLAUDE.md"

AGENTS.md Builder

Generate a lean, effective AGENTS.md using progressive disclosure principles.

Rules

  1. Under 60 lines — ideally under 100, never over 300
  2. No directory trees — agents discover structure on their own
  3. No bloated context — point to skill files for domain-specific rules
  4. Progressive disclosure — load detailed instructions only when relevant

Process

  1. Read the current project root (package.json, README, existing AGENTS.md)
  2. Identify: stack, entry points, architectural constraints
  3. Generate AGENTS.md with sections:
    • North Star (1-2 sentences)
    • System of Record (stack, entry points)
    • Constraints (hard rules)
    • Active Harness Hooks (what's automated)
    • Skills (progressive disclosure pointers)
    • Escape Hatch (what to do when stuck)
  4. If existing AGENTS.md is over 100 lines, refactor it:
    • Extract domain rules into separate skill files
    • Keep only pointers in AGENTS.md

Workflow

  1. Understand → Read code, check LEARNED.md for gotchas
  2. Plan → Break task into steps, update CHECKPOINT.json
  3. Implement → Write code within architectural constraints
  4. Verify → Run quality gate before finishing
  5. Document → Update LEARNED.md if something was tricky

Context Budget

  • Keep this file under 60 lines — load skills/ on demand
  • Delegate research to sub-agents — only summaries return
  • After 30+ tool calls, compact and update CHECKPOINT.json

Escape Hatches

  • Quality gate stuck? Stop hook checks stop_hook_active — retry lets you through
  • Security guard wrong? Report false positive, use alternative command
  • Same error 3 times? Stop and ask the human
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. 2d ago First seen · 51 lines · 39 tokens per session scan A 52d5d320b14f

Subscribe to this mod's changes

agents-md is a skill published in the GitHub repository sliday/harn (5 stars, last pushed 4mo ago), licensed MIT. It adds 39 tokens to every session and 476 once invoked, about $0.0002 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-31.