autocontext

by greyhaven-aiVerified

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

1,283
Stars
109
Forks
Python
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/greyhaven-ai/autocontext

Getting Started

Guides for using skills like autocontext.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

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.16.1
Python library/devuv pip install autocontext==0.16.1
TypeScript/Node CLIbun add -g autoctx@0.16.1
Pi extensionpi install npm:pi-autocontext@0.10.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. The npm CLI and TUI require Node.js 22.19.0 or newer; contributors should use the version pinned in ts/.nvmrc.

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 serve mcp or bunx autoctx serve mcp 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/
└── context_bundles/{bundles,candidates,promotions,active.json}

Everything is filesystem-first: inspect it, diff it, replay it, export it, or feed it into training. Coach and architect context changes are stored as immutable candidates and are not served until matched candidate/incumbent trials confirm them. The live serving boundary can additionally require a cancellable independent audit and a durable campaign-wide false-promotion budget; exact causal credit is accepted only from verified single-component manifest additions. See context bundles and outcome-gated promotion. Controlled component trials feed ablation-backed attribution, so prompt selection can demote low-value context without presenting edit-size correlation as causal.

Core Surfaces

SurfaceCommandUse it for
solveautoctx solve "..." --iterations 3Start from a plain-language goal
runautoctx run <scenario> --iterations 3Improve a saved scenario
statusautoctx status <run-id> --jsonRead one run snapshot
watchautoctx watch <run-id> --ndjsonStream run snapshots
showautoctx show <run-id> --best --jsonInspect a selected generation
simulateautoctx simulate -d "..."Model/replay/compare system behavior
investigateautoctx investigate -d "..."Evidence-driven diagnosis
scenarioautoctx scenario create --helpCreate from a description, template, or harness spec
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)
serve mcpautoctx serve mcpGive an agent the autocontext tool surface
tuiautoctx tui [--connect <server>]Operate or attach to a run from the pi-tui terminal UI

Running bare autoctx shows the concise paved-road workflow. Use autoctx --help --all in the npm CLI or autoctx commands --all in the Python CLI for the full catalog. --iterations is the primary iteration flag; --gens is a compatibility alias. autoctx --version --json reports the package version and runtime (python or typescript).

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.16.1

  • A clearer paved-road CLI: run now requires an explicit scenario, --iterations is the primary spelling, concise help leads with the core workflow, and autoctx commands --all exposes the full catalog. Existing --gens and legacy command aliases remain available for compatibility.
  • Stable machine-readable inspection: status, show, and watch --ndjson emit versioned, schema-backed envelopes with consistent stdout, stderr, and exit-code behavior. Status and show accept --run-id, while --version --json identifies the Python runtime and package version.
  • More reliable run inspection: watch no longer exits before a completed generation becomes visible, and show defaults to the latest generation while rejecting conflicting selectors instead of guessing.
  • Portable exports by default: export now writes JSON to stdout when no output path is supplied, supports Pi packages, and retains strategy as a compatibility alias for the default JSON format.
  • Contracts ship with the package: CLI contract v2 schemas and shared fixtures are included in wheels and source distributions so downstream tools can validate the same status, show, queue, and export shapes as the CLI.
  • Ratcheted package boundaries: domain, analytics, configuration, and storage implementations now follow enforced dependency directions while legacy module paths remain available as compatibility shims.

npm runtime highlights included in 0.16.1

The aligned autoctx@0.16.1 package also carries the TypeScript-first runtime work introduced in 0.16.0 and hardened in 0.16.1:

  • Host-owned live composition: typed runtime capabilities, scoped cleanup and effect policies, reactive component graphs, and durable transactional activation/rollback for trusted hosts.
  • A production-oriented operator TUI: the pi-tui client supports local and remote attachment, durable replay, run control and inspection, and bounded, redacted terminal state on Node.js 22.19+.
  • Image-aware interactive sessions: compatible TypeScript providers can advertise image_attachments_v1; attachment validation is bounded and fail-closed before provider inference.
  • Protocol and terminal hardening: exact capability negotiation, protected priority controls, bounded WebSocket resources, credential redaction, and terminal-control sanitization are enforced across the interactive path.

Python parity for the pi-tui client and image attachments remains deferred. See the TypeScript guide, runtime composition contracts, and the full changelog for details.

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/internal/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

Acknowledgments

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

Frequently Asked Questions

What is autocontext?

autocontext is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by greyhaven-ai. a recursive self-improving harness designed to help your agents (and future iterations of those agents) succeed on any task. It has 1,283 GitHub stars.

Is autocontext safe to use?

Yes. autocontext passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install autocontext?

Clone the repository with "git clone https://github.com/greyhaven-ai/autocontext" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is autocontext written in?

autocontext is primarily written in Python. It is open-source under greyhaven-ai on GitHub, so you can review or fork the full source.

Are there alternatives to autocontext?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh autocontext against similar tools.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details