autocontext CLAUDE.md

autocontext CLAUDE.md is an instructions file for coding agents from greyhaven-ai/autocontext. It costs 4,171 tokens per session, scanned A, original, Apache-2.0.

Instructions for Autocontext, a system where multiple AI agents develop and evaluate strategies through repeated competitions or judged tasks.

In plain words
What is it for?
Use them when working on agent roles, knowledge processing, prompts, generation loops, configuration, tests, or the AutoContext command-line tool.
Why use it?
They explain the package location, repository layout, and commands needed to run the Python project correctly.

Instructions file

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,291 stars · on GitHub

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/greyhaven-ai/autocontext/claude-md
Clone the repo
git clone --depth 1 https://github.com/greyhaven-ai/autocontext

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 CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/greyhaven-ai/autocontext/claude-md.svg)](https://agentmods.dev/instructions/greyhaven-ai/autocontext/claude-md)
Your own site
<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>
Per session 4,171 This file is loaded in full into every session.
When invoked 4,171 The same file — it is already loaded in full.
Security scan A 1 finding. 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.04171 $0.04171
Opus 5 $0.02086 $0.02086
Sonnet 5 $0.00834 $0.00834
Haiku 4.5 $0.00417 $0.00417

Measured 5d ago against content hash e753edd207f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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
CLAUDE.md · 261 lines

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

Read the full file on GitHub · 261 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. 5d ago First seen · 261 lines · 4,171 tokens per session scan A e753edd207f5

Subscribe to this mod's changes

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.