greyhaven-ai/autocontext

a recursive self-improving harness designed to help your agents (and future iterations of those agents) succeed on any task

1,292

stars

2,031

commits

Python

primary language

Sep 9, 2026

updated

agents
ai
autoresearch
claude
claude-code
codex
hermes
hermes-agent
llms
ml
openclaw
pi
pi-coding-agent
Browse cluster: Claude AI Agents & Code Automation

README

autocontext logo

a recursive self-improving harness designed to help your agents (and future iterations of those agents) succeed on any task

License GitHub stars Last commit PyPI version npm version

autocontext is a harness for agent improvement. Give it a goal, it runs the task against evaluation, keeps the useful lessons, discards dead ends, and leaves traces, reports, playbooks, datasets, and optional local-model training artifacts for the next run.

Docs: autocontext.ai/docs · quickstart · CLI reference · changelog

Install

SurfaceCommand
Python CLIuv tool install autocontext==0.14.0
Python library/devuv pip install autocontext==0.14.0
TypeScript/Node CLIbun add -g autoctx@0.14.0
Pi extensionpi install npm:pi-autocontext@0.9.0

The PyPI package is autocontext; the CLI is autoctx. The npm package is autoctx (not the unrelated autocontext npm package). Provider variables live in .env.example.

30-Second Run

Pi is the lowest-friction provider because it uses your local agent auth:

AUTOCONTEXT_AGENT_PROVIDER=pi \
AUTOCONTEXT_PI_COMMAND=pi \
autoctx solve "improve customer-support replies for billing disputes" --iterations 3

Use AUTOCONTEXT_AGENT_PROVIDER=anthropic, openai-compatible, openrouter, claude-cli, codex, pi-rpc, or another provider when you need that runtime. See agent integration for the full matrix.

Running it on your own GPU instead? Self-hosted models covers the whole loop on vLLM, Ollama, or any OpenAI-compatible endpoint — including what each role actually resolves to, and why constrained output matters more on open weights. Self-hosted endpoints can additionally declare AUTOCONTEXT_PROVIDER_HOSTING=local and a fast, mid_tier, or frontier AUTOCONTEXT_PROVIDER_CAPABILITY; role-specific endpoints use matching <ROLE>_PROVIDER_* declarations.

Agent Entry Points

  • Pi: install pi-autocontext, then ask Pi to solve, judge, improve, list, or inspect runs through the packaged skill.
  • MCP clients: run autoctx mcp-serve or bunx autoctx mcp-serve and expose the tools to Claude Code, Cursor, or another MCP client.
  • Hermes: export the CLI-first skill with uv run autoctx hermes export-skill --with-references --json.

Full setup: autocontext/docs/agent-integration.md.

What A Run Leaves Behind

runs/<run_id>/
├── trace.jsonl
├── generations/<n>/{strategy.json,analysis.md,score.json}
├── report.md
└── artifacts/

knowledge/<scenario>/
├── playbook.md
├── hints.md
└── tools/

Everything is filesystem-first: inspect it, diff it, replay it, export it, or feed it into training.

Core Surfaces

SurfaceCommandUse it for
solveautoctx solve "..." --iterations 3Start from a plain-language goal
runautoctx run <scenario> --iterations 3Improve a saved scenario
simulateautoctx simulate -d "..."Model/replay/compare system behavior
investigateautoctx investigate -d "..."Evidence-driven diagnosis
missionautoctx mission create --name "..." --goal "..."Verifier-driven multi-step goals
trainuv run autoctx train --scenario <name> --data <jsonl>Distill stable behavior into a cheaper runtime (Python)
mcp-serveautoctx mcp-serveGive an agent the autocontext tool surface

Python owns the full control-plane package; TypeScript owns several operator-facing surfaces, the TUI, and Node runtime adapters. Start with autocontext/README.md or ts/README.md.

What's New in 0.14.0

  • Live TypeScript task plans: interactive runs now advertise agent_task_plan_v1 and emit semantic task_plan_updated snapshots for initial planning, meaningful progress, replanning, completion, failure, and safe stop.
  • Durable, privacy-safe replay: task-plan snapshots use stable identity and monotonic revisions, redact credential-shaped values, reject malformed or oversized frames atomically, and restore exactly across reconnects and server restarts. Python producer parity remains explicitly deferred.

Scenario Families

The shipped families cover games, agent tasks, simulations, artifact editing, investigations, workflows, negotiation, schema evolution, tool fragility, operator loops, and coordination. Python and TypeScript share the family vocabulary; see docs/scenario-parity-matrix.md for parity details.

Package Guides

NeedGo here
Python CLI/library, MCP, HTTP, trainingautocontext/README.md
Node CLI, TUI, missions, Fetch/agent adaptersts/README.md
Pi packagepi/README.md
Copy-paste examplesexamples/README.md
Concepts and docs indexdocs/README.md
Contributor setupCONTRIBUTING.md
Repo guide for agentsAGENTS.md

Project Signals

npm downloads PyPI downloads

Star History Chart

Acknowledgments

Thanks to George for generously donating the autocontext name on PyPI.

Contributors

jayscambler

2,002 commits

Gingiris

1 commits

greyhaven-ai/autocontext

a recursive self-improving harness designed to help your agents (and future iterations of those agents) succeed on any task

1,292

stars

2,031

commits

Python

primary language

Sep 9, 2026

updated

agents
ai
autoresearch
claude
claude-code
codex
hermes
hermes-agent
llms
ml
openclaw
pi
pi-coding-agent
Browse cluster: Claude AI Agents & Code Automation

README

autocontext logo

a recursive self-improving harness designed to help your agents (and future iterations of those agents) succeed on any task

License GitHub stars Last commit PyPI version npm version

autocontext is a harness for agent improvement. Give it a goal, it runs the task against evaluation, keeps the useful lessons, discards dead ends, and leaves traces, reports, playbooks, datasets, and optional local-model training artifacts for the next run.

Docs: autocontext.ai/docs · quickstart · CLI reference · changelog

Install

SurfaceCommand
Python CLIuv tool install autocontext==0.14.0
Python library/devuv pip install autocontext==0.14.0
TypeScript/Node CLIbun add -g autoctx@0.14.0
Pi extensionpi install npm:pi-autocontext@0.9.0

The PyPI package is autocontext; the CLI is autoctx. The npm package is autoctx (not the unrelated autocontext npm package). Provider variables live in .env.example.

30-Second Run

Pi is the lowest-friction provider because it uses your local agent auth:

AUTOCONTEXT_AGENT_PROVIDER=pi \
AUTOCONTEXT_PI_COMMAND=pi \
autoctx solve "improve customer-support replies for billing disputes" --iterations 3

Use AUTOCONTEXT_AGENT_PROVIDER=anthropic, openai-compatible, openrouter, claude-cli, codex, pi-rpc, or another provider when you need that runtime. See agent integration for the full matrix.

Running it on your own GPU instead? Self-hosted models covers the whole loop on vLLM, Ollama, or any OpenAI-compatible endpoint — including what each role actually resolves to, and why constrained output matters more on open weights. Self-hosted endpoints can additionally declare AUTOCONTEXT_PROVIDER_HOSTING=local and a fast, mid_tier, or frontier AUTOCONTEXT_PROVIDER_CAPABILITY; role-specific endpoints use matching <ROLE>_PROVIDER_* declarations.

Agent Entry Points

  • Pi: install pi-autocontext, then ask Pi to solve, judge, improve, list, or inspect runs through the packaged skill.
  • MCP clients: run autoctx mcp-serve or bunx autoctx mcp-serve and expose the tools to Claude Code, Cursor, or another MCP client.
  • Hermes: export the CLI-first skill with uv run autoctx hermes export-skill --with-references --json.

Full setup: autocontext/docs/agent-integration.md.

What A Run Leaves Behind

runs/<run_id>/
├── trace.jsonl
├── generations/<n>/{strategy.json,analysis.md,score.json}
├── report.md
└── artifacts/

knowledge/<scenario>/
├── playbook.md
├── hints.md
└── tools/

Everything is filesystem-first: inspect it, diff it, replay it, export it, or feed it into training.

Core Surfaces

SurfaceCommandUse it for
solveautoctx solve "..." --iterations 3Start from a plain-language goal
runautoctx run <scenario> --iterations 3Improve a saved scenario
simulateautoctx simulate -d "..."Model/replay/compare system behavior
investigateautoctx investigate -d "..."Evidence-driven diagnosis
missionautoctx mission create --name "..." --goal "..."Verifier-driven multi-step goals
trainuv run autoctx train --scenario <name> --data <jsonl>Distill stable behavior into a cheaper runtime (Python)
mcp-serveautoctx mcp-serveGive an agent the autocontext tool surface

Python owns the full control-plane package; TypeScript owns several operator-facing surfaces, the TUI, and Node runtime adapters. Start with autocontext/README.md or ts/README.md.

What's New in 0.14.0

  • Live TypeScript task plans: interactive runs now advertise agent_task_plan_v1 and emit semantic task_plan_updated snapshots for initial planning, meaningful progress, replanning, completion, failure, and safe stop.
  • Durable, privacy-safe replay: task-plan snapshots use stable identity and monotonic revisions, redact credential-shaped values, reject malformed or oversized frames atomically, and restore exactly across reconnects and server restarts. Python producer parity remains explicitly deferred.

Scenario Families

The shipped families cover games, agent tasks, simulations, artifact editing, investigations, workflows, negotiation, schema evolution, tool fragility, operator loops, and coordination. Python and TypeScript share the family vocabulary; see docs/scenario-parity-matrix.md for parity details.

Package Guides

NeedGo here
Python CLI/library, MCP, HTTP, trainingautocontext/README.md
Node CLI, TUI, missions, Fetch/agent adaptersts/README.md
Pi packagepi/README.md
Copy-paste examplesexamples/README.md
Concepts and docs indexdocs/README.md
Contributor setupCONTRIBUTING.md
Repo guide for agentsAGENTS.md

Project Signals

npm downloads PyPI downloads

Star History Chart

Acknowledgments

Thanks to George for generously donating the autocontext name on PyPI.

Contributors

jayscambler

2,002 commits

Gingiris

1 commits

Languages

Python

54.6%

TypeScript

44.8%