autocontext is a harness that improves agents across repeated runs. You give it a goal or a saved scenario, and it runs the task against an evaluation over several iterations, keeps the lessons that helped, discards dead ends, and writes out traces, reports, playbooks, datasets, and optional training artifacts for local models, so the next run starts from what earlier runs learned.
Everything a run produces is stored on the filesystem: a trace, per-generation strategies, analyses and scores, a report, and per-scenario knowledge (playbooks, hints, tools, and context bundles). You can inspect, diff, replay, or export it, or feed it into training. Changes to the context that later runs receive are stored as immutable candidates and served only after matched trials against the current version confirm them, and controlled component trials attribute which pieces of context actually help.
The CLI solves plain-language goals, improves saved scenarios, watches and inspects runs, simulates and investigates system behavior, runs verifier-driven multi-step missions, and distills stable behavior into a cheaper runtime. Shipped scenario families cover games, agent tasks, simulations, artifact editing, investigations, workflows, negotiation, schema evolution, tool fragility, operator loops, and coordination. Python holds the full control plane, and a TypeScript package adds a terminal UI and Node runtime adapters.
Agents run through a choice of providers: Pi, Anthropic, Claude CLI, Codex, OpenRouter, any OpenAI-compatible endpoint, or self-hosted models on vLLM or Ollama. autocontext also works the other way round, as a tool for agents: Pi gets it as an extension, MCP clients such as Claude Code and Cursor get its tools through an MCP server, and Hermes gets an exported skill. HTTP and WebSocket control planes bind to loopback unless a server token is set.
Features
- Iterative improvement: runs a task against evaluation over several iterations and keeps what worked
- Filesystem artifacts: traces, per-generation scores, reports, playbooks, and hints stored for inspection and replay
- Outcome-gated context: context changes are served only after matched trials confirm them
- Context attribution: controlled component trials show which context pieces add value
- Scenario families: games, agent tasks, simulations, investigations, workflows, negotiation, and more
- Missions: verifier-driven multi-step goals
- Training: distills stable behavior into a cheaper runtime, including local models
- Provider choice: Pi, Anthropic, Claude CLI, Codex, OpenRouter, OpenAI-compatible endpoints, vLLM, and Ollama
- MCP server: exposes autocontext tools to Claude Code, Cursor, and other MCP clients
- Pi extension and Hermes skill: packaged entry points for those agents
- Terminal UI: operates or attaches to runs locally or remotely

