anydocs AGENTS.md

A project instruction file for anydocs, a local document-search server for other tools’ documentation. It tells coding agents how and when to use that server.

In plain words
What is it for?
It guides agents working on anydocs and explains where instructions must live to affect people using the server.
Why use it?
It prevents agents from ignoring an available documentation source or hiding failures when the search path does not work.

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/kiyeonjeon21/anydocs/agents-md
Clone the repo
git clone --depth 1 https://github.com/kiyeonjeon21/anydocs

Made for: Codex, OpenCode.

Per session 8,087 This file is loaded in full into every session.
When invoked 8,087 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.08087 $0.08087
Opus 5 $0.04043 $0.04043
Sonnet 5 $0.01617 $0.01617
Haiku 4.5 $0.00809 $0.00809

Measured yesterday against content hash 6f16d1261694, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

anydocs 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 yesterday.

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

How it starts

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

anydocs

When the anydocs MCP server is available, use search_docs with the product's source and then read_doc before answering questions about that product's documentation.

MCP server: BM25 search over other tools' documentation. Ingest in CI → SQLite FTS5 → publish as a GitHub Release asset → the client downloads it and serves five tools locally.

The rest of this file is for agents working on anydocs, and none of it ships. What reaches someone using the server is SERVER_INSTRUCTIONS and the five tool docstrings in server.py — about 1,000 tokens, and the only guidance a caller will ever see. So a lesson that should change how a caller behaves has to be written there. Writing it down here reaches nobody but us.

And those 1,000 tokens are not one channel, they are two. Measured with a behavioural canary on Claude Code 2.1.220 - "begin every reply with <token>" planted in each surface, then a question needing no tool, n=3 each way:

in context before the model decides to search?
SERVER_INSTRUCTIONS (~100 tokens) yes - fired 3/3
the five tool docstrings (~900 tokens) no - 0/3. Schemas are deferred and arrive only after a tool search, which happens only once the model has already decided to use anydocs

So SERVER_INSTRUCTIONS is the only text we ship that is in front of the model when it decides whether to search; a docstring can only change how well it searches once it already has. Note what that costs us: the source names injected into the tool schemas (enum + description) are on the deferred side, so at the moment an agent decides whether to search, nothing has told it this server covers Claude Code at all.

The deferral is not fixed. "anthropic/alwaysLoad": true in a tool's _meta un-defers it, and Claude Code respects it. We do not use it, because it was measured and it does not change what the model decides - see the rejected table.

Neither of the two surfaces we ship carries the weight the AGENTS.md line does, and that is now two experiments, not a guess. Writing the line's content into SERVER_INSTRUCTIONS lands on the bare server (22% against 22%). Putting every docstring in context with alwaysLoad lands on the bare server too. The project-instruction channel has an authority ours does not, so the README's Step 2 is not a documentation convenience, it is the product.

But the project-instruction channel is not closed to us - we can only write to it manually, and a plugin does not have to. A Claude Code plugin can ship a SessionStart hook alongside the MCP server; the hook returns the line's content as hookSpecificOutput.additionalContext, which Claude Code wraps in a system reminder and inserts before the first prompt, the same delivery a project's AGENTS.md gets. Screened at $2, no judge, turn counts only, same Ollama question, no AGENTS.md file present: skipped the search 0 of 6, oss_provider 5 of 6 - where alwaysLoad (a server-side attempt at the same goal) scored 2 of 6. Passed the same pre-registered bar that alwaysLoad failed.

Not shipped yet, and n=6 only establishes that this did not die on the first screen. It needs a properly sized arm before anyone quotes a number, it only helps Claude Code (Codex and Cursor users still need the manual line), and a hook is code a plugin runs on the user's machine, which is a higher trust bar than a stdio MCP server and should be disclosed as such if shipped. Worth a follow-up: package the server + hook as a plugin, then measure it as a fifth arm.

Do not ask a model what is in its own context - it will confidently make it up. Asked directly, it answered ABSENT, NAME_ONLY and UNKNOWN, and all three were wrong. Only the behavioural canary is evidence.

Keep this file to rules — the things a future session must not get wrong. The story of how each rule was found is in git log, where the commit messages run to forty lines and cost nothing to carry.

Read the full file on GitHub · 442 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. yesterday First seen · 442 lines · 8,087 tokens per session scan A 6f16d1261694

Subscribe to this mod's changes

anydocs AGENTS.md is an instructions file published in the GitHub repository kiyeonjeon21/anydocs (0 stars, last pushed 17d ago), licensed MIT. It adds 8,087 tokens to every session, about $0.0404 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.