What is Agent Apprenticeship?
Agent Apprenticeship is an MIT-licensed command-line tool that wraps an AI agent you already have installed and runs it on a task in repeated loops. The agent doing the work is the "Apprentice Agent": Codex, Cursor, Claude Code, OpenClaw, OpenCode, Hermes Agent, or any other CLI you describe with a command template. It sits in the Coding-Agent Harnesses & Runtimes category of the AI Coding tools and is open-source, written in Python and licensed MIT.
Overview
Agent Apprenticeship is an MIT-licensed command-line tool that wraps an AI agent you already have installed and runs it on a task in repeated loops. The agent doing the work is the "Apprentice Agent": Codex, Cursor, Claude Code, OpenClaw, OpenCode, Hermes Agent, or any other CLI you describe with a command template. Each iteration is evaluated by a "Mentor", either a model you configure with your own OpenAI, Anthropic, Gemini or OpenRouter key, or a human expert, and the loop runs until the work passes or the maximum loop depth is reached.

What sets it apart from other harnesses is what happens after a run. Agent Apprenticeship writes a local run folder and an "Experience Compilation": the task, the execution traces, the mentor's evaluations and lessons drawn from them. You can inspect and validate that bundle, export it in full, and install it as "Runtime Training" so the next run of your agent starts from the lessons of the previous ones. Version 0.3.0 (October 2026) added trace interchange in the Harbor ATIF v1.8 format.
Runs can stay private or feed a shared pool. In Public Ecosystem mode completed experience is contributed back, and `apprentice ecosystem search` and `pull` fetch experience others published; Private Internal Only mode keeps everything on your machine. The project also publishes a seed dataset on Hugging Face (Apache-2.0) with 505 experience compilations plus traces, reward, verifier and preference rows derived from them. The CLI is written in Python (3.11+) and distributed through npm, which needs Node.js 18+.
What it does
- Wraps existing agent CLIs (Codex, Cursor, Claude Code, OpenClaw, OpenCode, Hermes Agent) and auto-detects which are installed, plus a custom command template for anything else
- Mentor evaluation by a model on your own OpenAI, Anthropic, Gemini or OpenRouter key, or by a human, in Autonomous, Expert-Led or Organization Custom modes
- Configurable loop depth (`AA_MAX_ITERATIONS` or `apprentice settings`) and live progress with `apprentice watch <run_id>`
- Experience Compilations: per-run bundles of traces, evaluations and lessons that can be inspected, checked, exported and installed as Runtime Training for later runs
- Optional public ecosystem to search, inspect and pull experience other users contributed, or a private internal-only mode
- Trace interchange in the Harbor ATIF v1.8 format and an open Apache-2.0 seed dataset on Hugging Face
Getting started
From the README. You need at least one supported agent CLI installed and an API key for the mentor model; the npm package requires Node.js 18+ and runs on Python 3.11+.
Initialise
Runs the setup wizard; add `--defaults` to accept the default answers. To install globally instead, run `npm install -g agent-apprenticeship` and then `apprentice init`.
npx agent-apprenticeship initAdd a mentor model key
Keys live in `~/.agent-apprenticeship/.env.local` (shell environment variables also work). Fill in the providers you use.
OPENAI_API_KEY=""
ANTHROPIC_API_KEY=""
GEMINI_API_KEY=""
OPENROUTER_API_KEY=""Pick the agent, model and mode, then check the setup
apprentice configure
apprentice configure model
apprentice doctorRun a task and watch it
When the run completes, the CLI prints the local run folder and the Experience Compilation path.
apprentice run "Create a short market map for AI procurement tools."
apprentice watch <run_id>Inspect the experience and reuse it
Check the compiled bundle, then install it as Runtime Training so later runs build on it.
apprentice ecosystem inspect <experience_compilation_path>
apprentice bundle check <experience_compilation_path>
apprentice learn install <experience_compilation_path>Commands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Put a second, independent judge (a mentor model or a domain expert) over an agent's work instead of trusting its own "done"
- Make an agent improve across runs by installing the lessons of earlier runs as Runtime Training
- Collect structured execution traces, evaluations and lessons from real tasks as training or evaluation data
- Share or pull agent work experience through a public pool, or keep it strictly internal
How Agent Apprenticeship compares
Agent Apprenticeship alongside other open-source coding-agent harnesses & runtimes tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| CC Switch | ★ 158k | A cross-platform desktop app that manages provider configuration for eight coding-agent CLIs from one place, with a local failover proxy, MCP and skill management, and spend tracking. |
| Oh My OpenAgent | ★ 71.2k | Opinionated agent bundle for OpenCode and Codex CLI that ships preconfigured sub-agents, lifecycle hooks and built-in MCP servers behind a single ultrawork command. |
| herdr | ★ 53.7k | A single-binary terminal multiplexer built for coding agents: persistent sessions across local and SSH machines, per-pane working/blocked/idle status, and a socket API agents drive themselves. |
| oh-my-claudecode | ★ 41.1k | A plugin and CLI that adds multi-agent orchestration to Claude Code: staged autopilot workflows, parallel tmux workers, and advisors that route a second opinion to Codex, Gemini, Grok or Cursor. |
| DSH Go | ★ 35.2k | A native Android client for DeepSeek Harness that runs the agent on the phone in a built-in Linux environment or drives DSH on your computer or server over SSH, with plugins and phone control. |
| AionUi | ★ 34.6k | An open-source desktop workspace that pairs a built-in agent engine with dozens of external CLI agents, adding scheduled runs, MCP tools and remote access from a WebUI or chat apps. |
| cc-connect | ★ 16.5k | A Go daemon that bridges local coding agents — Claude Code, Codex, Cursor Agent, Gemini CLI, OpenCode, Kimi CLI and more — to Feishu, DingTalk, Slack, Telegram, Discord, LINE and WeCom, so you drive them from chat. |
| Agent Apprenticeship | ★ 1.6k | Run your agent in mentor-judged loops and keep what it learned as reusable experience |
