ast-mcp: Instructions file for Codex

AGENTS.md

ast-mcp AGENTS.md is an instructions file for Codex, OpenCode from mwillbanks/ast-mcp. It costs 810 tokens per session, scanned A, original, MIT.

Repository instructions for working with ast-mcp, a tool that reads and changes code through its structure rather than ordinary file editors. They define which tools and paths are allowed.

In plain words
What is it for?
They help an agent explore source code, dependencies, callers, and exact file contents, then safely update existing files or create new ones.
Why use it?
They prevent direct file changes and guide the agent toward approved ways to inspect, search, hash, and patch repository files.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: $skill-name invocation.

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

Reuse

Borrowing it

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

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 ast-mcp AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/mwillbanks/ast-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/mwillbanks/ast-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 810 This file is loaded in full into every session.
When invoked 810 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.00810 $0.00810
Opus 5.5 $0.00324 $0.00324
Sonnet 5.5 $0.00162 $0.00162
Haiku 4.5 $0.00081 $0.00081

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

Security

Grade A, and why

ast-mcp 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 10d 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 · 58 lines

How it starts

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

AST MCP local file boundary

Load and follow $ast-mcp before local repository exploration, reads, or changes. Use AST-MCP tools for local files and code intelligence. Never use direct editors, apply_patch, shell writers, interpreter writes, or Git patches for local file changes. Use web or connector tools for remote content without local-file approval. Apply local file policy when you save remote content locally.

Load skill references

The host selects and activates the skill. Resolve these paths from the host-provided active skill directory, whether global, agent-local, or project-local. For MCP delivery, obtain the skill manifest and read each reference through its exact resource URI. Do not treat $ast-mcp/references/... as a filesystem expansion.

  • Load references/tool-catalog.md for every tool, input, limit, workspace, and MCP skill method.
  • Load references/patch-state-machine.md before mutations or recovery from rejected patches.
  • Load references/configuration.md for path rules, approvals, formatting, and telemetry.
  • Load references/installation.md for missing, disconnected, outdated, or incompatible tools and stale instructions.

Guard local changes

  1. Inspect targets through AST-MCP. Use file_capabilities when method support is uncertain.
  2. Select ast for structural changes or aider_block for small, uniquely anchored text changes.
  3. Preview AST matches with bounded run calls. Preview the guarded patch with file_patch and preview: true.
  4. Call file_hash immediately before mutation. Supply each fresh expectedSha256 in one path-keyed files batch.
  5. Send ordered astRules or aiderBlocks with the selected patchStrategy through file_patch.
  6. Use file_write for new files and file_rename for guarded moves to absent destinations. Both create authorized missing parents. Do not create marker files to prepare destination directories.
  7. Use file_chattr for metadata and file_delete for deletion. Verify results and run repository validation.

Read the full file on GitHub · 58 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. 10d ago Changed · +4 lines · +76 tokens per session ed1a5705ac19
  2. 17d ago Changed · +1 lines · +17 tokens per session 957fc1e4900d
  3. 19d ago Changed · -10 lines · -1,017 tokens per session d5e8eaabb94d
  4. 1mo ago Changed · -6 lines · -108 tokens per session e6a3d01e49db
  5. 2mo ago First seen · 69 lines · 1,842 tokens per session scan A 8bb724deb644

Subscribe to this mod's changes

ast-mcp AGENTS.md is an instructions file published in the GitHub repository mwillbanks/ast-mcp (0 stars, last pushed yesterday), licensed MIT. It adds 810 tokens to every session, about $0.0032 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-31.

Related

ast-mcp AGENTS.md compared with instructions from other repositories

ast-mcp AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ast-mcp AGENTS.mdmwillbanks/ast-mcpInstructions file0yesterdayMITA810Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,649GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot