autocontext: Instructions file for Codex

AGENTS.md

autocontext AGENTS.md is an instructions file for Codex, OpenCode from greyhaven-ai/autocontext. It costs 536 tokens per session, scanned A, original, Apache-2.0.

A guide for coding agents working in the autocontext repository, covering which project area to use, where to run Python and TypeScript commands, setup steps, and checks for keeping implementations consistent.

In plain words
What is it for?
Use it when setting up or modifying the Python toolkit, TypeScript toolkit, terminal interface, or agent integration documentation in that repository.
Why use it?
It prevents commands from being run in the wrong directory and clarifies when changes to public commands, settings, or workflows require matching documentation updates.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md.

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

About the project

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.

greyhaven-ai/autocontext · 1,321 stars · on GitHub

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/greyhaven-ai/autocontext/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/greyhaven-ai/autocontext

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 autocontext AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/greyhaven-ai/autocontext/agents-md/github.svg)](https://agentmods.dev/instructions/greyhaven-ai/autocontext/agents-md)
Your own site
<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.

agentmods 80×15 button for autocontext AGENTS.md

Your own site · 80×15
<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>
Per session 536 This file is loaded in full into every session.
When invoked 536 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.00536 $0.00536
Opus 5.5 $0.00214 $0.00214
Sonnet 5.5 $0.00107 $0.00107
Haiku 4.5 $0.00054 $0.00054

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

Security

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.

AGENTS.md · 89 lines

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.md
  • docs/README.md
  • autocontext/README.md
  • ts/README.md
  • examples/README.md
  • autocontext/docs/agent-integration.md
  • CONTRIBUTING.md
  • CHANGELOG.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.

Read the full file on GitHub · 89 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. 2mo ago First seen · 89 lines · 536 tokens per session scan A 77ecb3672400

Subscribe to this mod's changes

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.

Related

autocontext AGENTS.md compared with instructions from other repositories

autocontext AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
autocontext AGENTS.mdgreyhaven-ai/autocontextInstructions file1.3kyesterdayApache-2.0A536Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode