About this project
This is an educational repository teaching 'harness engineering' for AI agents: the discipline of building the operational environment around a trained model. Its central thesis is that agency (perceiving, reasoning, acting) comes from model training, not from external code orchestration; an agent product is model + harness. The README distinguishes genuine agents from prompt-chaining workflow builders, and argues that intelligence cannot be engineered by stacking procedural glue code.
The course consists of 17 progressive lessons (s01–s17), each isolating one harness mechanism and shipping a standalone runnable Python implementation (code.py), English/Chinese/Japanese READMEs, and SVG diagrams. Lessons cover:
- s01 Agent loop (one loop + bash)
- s02 Tool use dispatch
- s03 Permission system
- s04 Hooks around the loop
- s05 TodoWrite planning
- s06 Subagent context isolation
- s07 Skill loading on demand
- s08 Context compaction
- s09 Memory subsystems (selection, extraction, consolidation)
- s10 File-backed task system
- s11 Background tasks
- s12 Cron scheduling
- s13 Agent teams with atomic task claims and task-bound worktrees
- s14 MCP plugin tool integration
- s15 Integrated harness reconnecting all mechanisms around one loop
- s16 Workflow runtime with resumable journals
- s17 Goal loop with independent stop evaluation
The implementation follows a generic LLM agent loop: messages in, response out, tool_use blocks executed, results appended, loop repeats. Each chapter adds exactly one mechanism around this constant loop. Claude Code is referenced as a model of a well-designed harness because it provides tools, knowledge loading, context management, and permission boundaries without imposing rigid workflows.
The repository also preserves a legacy 12-lesson track under docs/ and agents/ during migration, with a mapping table to the current chapters. Quick start: clone, pip install requirements, configure ANTHROPIC_API_KEY in .env, then run chapter code like python s01_agent_loop/code.py. A web app version is included under web/. Companion projects mentioned include the Kode Agent CLI and Kode Agent SDK, plus a sister tutorial (OpenClaw) on always-on assistant harnesses.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.