autocontext is a self-improving harness for AI agents that runs a goal through evaluation, preserves useful lessons, and records artifacts for later runs. Developers use it to help agents and future versions of those agents perform better on recurring tasks. The catalogue add-ons support its agent-improvement workflow.
Borrowing it
Nothing to install: this file belongs to greyhaven-ai/autocontext. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/greyhaven-ai/autocontext/main/AGENTS.mdgit clone --depth 1 https://github.com/greyhaven-ai/autocontextWrote 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.
[](https://agentmods.dev/instructions/greyhaven-ai/autocontext/agents-md)<a href="https://agentmods.dev/instructions/greyhaven-ai/autocontext/agents-md"><img src="https://agentmods.dev/badge/instructions/greyhaven-ai/autocontext/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.
<a href="https://agentmods.dev/instructions/greyhaven-ai/autocontext/agents-md"><img src="https://agentmods.dev/badge/instructions/greyhaven-ai/autocontext/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00536 | $0.00536 |
| Opus 5.5 | $0.00214 | $0.00214 |
| Sonnet 5.5 | $0.00107 | $0.00107 |
| Haiku 4.5 | $0.00054 | $0.00054 |
Grade A, and why
autocontext 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 2mo 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.
How it starts
The opening of the file, as written. The whole thing — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agent Guide
Use this file as the first pointer for coding agents and automation that need to work in or against this repo.
Pick The Right Surface
- Full autocontext control plane:
autocontext/ - Node/TypeScript toolkit and CLI:
ts/ - Interactive terminal UI:
ts/src/tui/ - External agent usage guide:
autocontext/docs/agent-integration.md
Working Directories
- Run Python commands from
autocontext/. - Run Node/TypeScript commands from
ts/. - Run TUI-related commands from
ts/.
Most repo-level commands in the READMEs assume one of those package directories as the current working directory.
Setup
Python:
cd autocontext
uv venv
source .venv/bin/activate
uv sync --group dev
TypeScript:
cd ts
npm install
Parity-Last Changes
Implement one runtime first unless cross-runtime parity is user-visible in the same release. If parity is deferred, say where and why in the PR.
Common Checks
Python:
cd autocontext
uv run ruff check src tests
uv run mypy src
uv run pytest
TypeScript:
cd ts
npm run lint
npm test
Public Docs To Keep In Sync
If you change public commands, environment variables, package names, or agent-facing workflows, update the relevant docs in the same change:
README.mddocs/README.mdautocontext/README.mdts/README.mdexamples/README.mdautocontext/docs/agent-integration.mdCONTRIBUTING.mdCHANGELOG.md
Key References
- Repo overview:
README.md - Docs overview:
docs/README.md - Contributor workflow:
CONTRIBUTING.md - Python package guide:
autocontext/README.md - TypeScript package guide:
ts/README.md - Copy-paste examples:
examples/README.md - External agent guide:
autocontext/docs/agent-integration.md
Intentional Deletions
- Before restoring deleted modules to make CI green, check whether
autocontext/src/still imports them. - If only tests are failing, prefer rewriting or deleting the tests instead of restoring removed modules.
- Treat importable module paths as compatibility surfaces until callers are rewired or the removal is explicitly accepted as breaking.
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.
- 2mo ago First seen · 89 lines · 536 tokens per session scan A 77ecb3672400
autocontext AGENTS.md is an instructions file published in the GitHub repository greyhaven-ai/autocontext (1,321 stars, last pushed yesterday), licensed Apache-2.0. It adds 536 tokens to every session, about $0.0021 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.
autocontext AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| autocontext AGENTS.mdgreyhaven-ai/autocontext | Instructions file | 1.3k | yesterday | Apache-2.0 | A | 536 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |