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.
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.
npx agentmods add instructions/greyhaven-ai/autocontext/claude-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/claude-md)<a href="https://agentmods.dev/instructions/greyhaven-ai/autocontext/claude-md"><img src="https://agentmods.dev/badge/instructions/greyhaven-ai/autocontext/claude-md.svg" alt="Measured on agentmods" 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 | $0.04171 | $0.04171 |
| Opus 5 | $0.02086 | $0.02086 |
| Sonnet 5 | $0.00834 | $0.00834 |
| Haiku 4.5 | $0.00417 | $0.00417 |
Grade A, and why
autocontext CLAUDE.md scanned grade A with 1 finding 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 5d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
GitHub Actions (`.github/workflows/ci.yml`) runs: ruff check, mypy, pytest, a `package-boundaries` job (Python/TypeScript topology checks plus the three Python/TS schema sync checks, run under `uv run --frozen`), determi How it starts
The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
autocontext is an iterative strategy generation and evaluation system. It runs a multi-agent loop where LLM agents collaboratively evolve strategies for pluggable scenarios, scoring them through tournament matches (game scenarios) or LLM judge evaluation (agent task scenarios) with Elo-based progression gating.
Repository Layout
The Python package lives under autocontext/ (not the repo root). All uv, pytest, and autoctx CLI commands must be run from the autocontext/ directory.
autocontext/ # Python package root (pyproject.toml lives here)
src/autocontext/ # Source code
agents/ # LLM agent roles (competitor, analyst, coach, architect, curator)
knowledge/ # Knowledge processing (trajectory builder, skill export, search, solve-on-demand)
loop/ # Generation runner, event emitter, stage decomposition helpers (stage_helpers/)
prompts/ # Prompt template assembly
config/ # Pydantic settings from AUTOCONTEXT_* env vars
storage/ # SQLiteStore, ArtifactStore, split across sqlite_store_*/artifact_* mixin modules
scenarios/ # Pluggable scenarios (grid_ctf, othello, custom/, agent tasks)
custom/ # Natural-language → generated scenario pipeline (spec, codegen, validation, loading)
# Also: agent task pipeline (agent_task_designer, agent_task_codegen, agent_task_validator, agent_task_creator)
execution/ # Execution supervisor, local/remote executors, LLM judge, task runner daemon
providers/ # Multi-model LLM provider abstraction (Anthropic, OpenAI-compat, callable wrapper)
notifications/ # Notification webhooks (Slack, HTTP, stdout, callback, composite)
runtimes/ # Agent runtime abstraction (Claude CLI, direct API)
rlm/ # REPL-loop mode (optional analyst/architect)
mcp/ # MCP server, tool implementations, sandbox manager
server/ # FastAPI dashboard + WebSocket events
tests/ # Pytest tests (~7700 tests)
migrations/ # SQLite migration SQL files (001-007, applied in filename order)
dashboard/ # Single-page HTML dashboard
knowledge/ # Runtime-generated: per-scenario playbooks, analysis, tools, hints, snapshots
skills/ # Runtime-generated: operational skill notes per scenario
runs/ # Runtime-generated: SQLite DB, event stream, generation artifacts
ts/ # TypeScript package (autoctx on npm)
src/ # Source code
scenarios/ # Scenario families, codegen, templates, materialization
codegen/ # V8 isolate code generation for all 11 families (AC-436)
templates/ # Pre-built scenario templates (AC-443)
simulation/ # SimulationEngine: run, replay, compare, export, sweep DSL (AC-446)
investigation/ # InvestigationEngine: evidence-driven diagnosis (AC-447)
analysis/ # AnalysisEngine: interpret and compare artifacts (AC-448)
mission/ # MissionManager, planner, adaptive executor, campaigns (AC-410, AC-435, AC-428)
traces/ # Public trace schema, redaction, export, publishers, data plane (AC-462–466)
training/ # Model strategy, backends (MLX/CUDA), prompt alignment, promotion (AC-456–460)
domain/ # Branded id types (RunId, ScenarioName, DbPath; AC-855), root-exported
server/ # InteractiveServer: WebSocket protocol + HTTP routing
routes/ # Extracted HTTP route handlers (12 modules; AC-852)
mcp/ # MCP server with tool implementations
cli/ # CLI entry point; command-handlers.ts barrel over commands/ (15 family modules; AC-853)
tests/ # Vitest tests (5000+ tests)
migrations/ # Shared SQLite migration SQL (cross-compatible with Python)
pi/ # Pi coding agent extension (@autocontext/pi)
src/ # Extension with 5 tools (judge, improve, status, scenarios, queue)
skills/ # Autocontext skill for Pi
prompts/ # Prompt templates for Pi
infra/ # Docker, Fly.io config, bootstrap script
scripts/ # Top-level convenience scripts (demo.sh)
.claude/ # Claude context, implementation plans, synced skill symlinks
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.
- 5d ago First seen · 261 lines · 4,171 tokens per session scan A e753edd207f5
autocontext CLAUDE.md is an instructions file published in the GitHub repository greyhaven-ai/autocontext (1,291 stars, last pushed 3d ago), licensed Apache-2.0. It adds 4,171 tokens to every session, about $0.0209 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
crewAI AGENTS.md
AGENTS.md instructions for crewAIInc/crewAI, covering agent instructions for crewai oss, key guidelines, message content and changing docs.
fastmcp CLAUDE.md
Claude Code instructions for PrefectHQ/fastmcp, covering fastmcp development guidelines, required development workflow, repository structure, core mcp objects and development rules.
zeroclaw AGENTS.md
AGENTS.md instructions for zeroclaw-labs/zeroclaw, covering agents.md - zeroclaw, single source of truth, safety and privacy, working rules and user-facing text.
zeroclaw CLAUDE.md
Claude Code instructions for zeroclaw-labs/zeroclaw, covering claude.md — zeroclaw (claude code), claude code settings, hooks and slash commands.
omnigent copilot-instructions.md
Copilot instructions for omnigent-ai/omnigent, covering copilot code review instructions, e2e test requirement, backend test coverage and frontend test coverage.
graphiti AGENTS.md
AGENTS.md instructions for getzep/graphiti, covering repository guidelines, project structure & module organization, build, test, and development commands, coding style & naming conventions and testing guidelines.