mirror of
https://github.com/shareAI-lab/analysis_claude_code.git
synced 2026-06-21 04:33:36 +08:00
* feat: s01-s14 docs quality overhaul — tool pipeline, single-agent, knowledge & resilience Rewrite code.py and README (zh/en/ja) for s01-s14, each chapter building incrementally on the previous. Key fixes across chapters: - s01-s04: agent loop, tool dispatch, permission pipeline, hooks - s05-s08: todo write, subagent, skill loading, context compact - s09-s11: memory system, system prompt assembly, error recovery - s12-s14: task graph, background tasks, cron scheduler All chapters CC source-verified. Code inherits fixes forward (PROMPT_SECTIONS, json.dumps cache, real-state context, can_start dep protection, etc.). * feat: s15-s19 docs quality overhaul — multi-agent platform: teams, protocols, autonomy, worktree, MCP tools Rewrite code.py and README (zh/en/ja) for s15-s19, the multi-agent platform chapters. Each chapter inherits all previous fixes and adds one mechanism: - s15: agent teams (TeamCreate, teammate threads, shared task list) - s16: team protocols (plan approval, shutdown handshake, consume_inbox) - s17: autonomous agents (idle polling, auto-claim, consume_lead_inbox) - s18: worktree isolation (git worktree, bind_task, cwd switching, safety) - s19: MCP tools (MCPClient, normalize_mcp_name, assemble_tool_pool, no cache) All appendix source code references verified against CC source. Config priority corrected: claude.ai < plugin < user < project < local. * fix: 5 regressions across s05-s19 — glob safety, todo validation, memory extraction, protocol types, dep crash - s05-s09: glob results now filter with is_relative_to(WORKDIR) (inherited from s02) - s06-s08: todo_write validates content/status required fields (inherited from s05) - s09: extract_memories uses pre-compression snapshot instead of compacted messages - s16: submit_plan docstring clarifies protocol-only (not code-level gate) - s17-s19: match_response restores type mismatch validation (from s16) - s17-s19: claim_task deps list handles missing dep files without crashing * fix: s12 Todo V2 logic reversal, s14/s15 cron range validation, s18/s19 worktree name validation - s12 README (zh/en/ja): fix Todo V2 direction — interactive defaults to Task, non-interactive/SDK defaults to TodoWrite. Fix env var name to CLAUDE_CODE_ENABLE_TASKS (not TODO_V2). - s14/s15: add _validate_cron_field with per-field range checks (minute 0-59, hour 0-23, dom 1-31, month 1-12, dow 0-6), step > 0, range lo <= hi. Replace old try/except validation that only caught exceptions. - s18/s19: add validate_worktree_name() to remove_worktree and keep_worktree, not just create_worktree. * fix: align s16-s19 teaching tool consistency * fix pr265 chapter diagrams * Add comprehensive s20 harness chapter * Fix chapter smoke test regressions * Clarify README tutorial track transition --------- Co-authored-by: Haoran <bill-billion@outlook.com>
This commit is contained in:
493
README.md
493
README.md
@@ -1,53 +1,54 @@
|
||||
[English](./README.md) | [中文](./README-zh.md) | [日本語](./README-ja.md)
|
||||
# Learn Claude Code -- Harness Engineering for Real Agents
|
||||
|
||||
<a href="https://trendshift.io/repositories/19746" target="_blank"><img src="https://trendshift.io/api/badge/repositories/19746" alt="shareAI-lab%2Flearn-claude-code | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
|
||||
|
||||
# Learn Claude Code -- Harness Engineering for Real Agents
|
||||
|
||||
## Agency Comes from the Model. An Agent Product = Model + Harness.
|
||||
|
||||
Before we talk about code, let's get one thing straight.
|
||||
Before we write any code, one thing needs to be clear.
|
||||
|
||||
**Agency -- the ability to perceive, reason, and act -- comes from model training, not from external code orchestration.** But a working agent product needs both the model and the harness. The model is the driver, the harness is the vehicle. This repo teaches you how to build the vehicle.
|
||||
**Agency -- the capacity to perceive, reason, and act -- comes from model training, not from external code orchestration.** But a working agent product needs both the model and the harness. The model is the driver. The harness is the vehicle. This repository teaches you how to build the vehicle.
|
||||
|
||||
### Where Agency Comes From
|
||||
|
||||
At the core of every agent is a neural network -- a Transformer, an RNN, a learned function -- that has been trained, through billions of gradient updates on action-sequence data, to perceive an environment, reason about goals, and take actions. Agency is never granted by the surrounding code. It is learned by the model during training.
|
||||
At the core of every agent is a neural network -- a Transformer, an RNN, a trained function -- shaped by billions of gradient updates on sequences of perception, reasoning, and action. Agency was never bestowed by the surrounding code. It was learned during training.
|
||||
|
||||
Humans are the best example. A biological neural network shaped by millions of years of evolutionary training, perceiving the world through senses, reasoning through a brain, acting through a body. When DeepMind, OpenAI, or Anthropic say "agent," the core of what they mean is always the same thing: **a model that has learned to act, plus the infrastructure that lets it operate in a specific environment.**
|
||||
Humans are the original proof. A biological neural network, refined by millions of years of evolutionary pressure, perceives the world through senses, reasons through a brain, and acts through a body. When DeepMind, OpenAI, or Anthropic say "agent," they all mean the same core thing: **a model that learned to act through training, plus the infrastructure that lets it operate in a specific environment.**
|
||||
|
||||
The proof is written in history:
|
||||
The historical record is unambiguous:
|
||||
|
||||
- **2013 -- DeepMind DQN plays Atari.** A single neural network, receiving only raw pixels and game scores, learned to play 7 Atari 2600 games -- surpassing all prior algorithms and beating human experts on 3 of them. By 2015, the same architecture scaled to [49 games and matched professional human testers](https://www.nature.com/articles/nature14236), published in *Nature*. No game-specific rules. No decision trees. One model, learning from experience. That model was the agent.
|
||||
- **2013 -- DeepMind DQN plays Atari.** A single neural network, receiving only raw pixels and game scores, learned 7 Atari 2600 games -- surpassing prior algorithms and beating human experts in 3 of them. By 2015, scaled to [49 games at professional tester level](https://www.nature.com/articles/nature14236), published in *Nature*. No game-specific rules. One model, learning from experience.
|
||||
|
||||
- **2019 -- OpenAI Five conquers Dota 2.** Five neural networks, having played [45,000 years of Dota 2](https://openai.com/index/openai-five-defeats-dota-2-world-champions/) against themselves in 10 months, defeated **OG** -- the reigning TI8 world champions -- 2-0 on a San Francisco livestream. In a subsequent public arena, the AI won 99.4% of 42,729 games against all comers. No scripted strategies. No meta-programmed team coordination. The models learned teamwork, tactics, and real-time adaptation entirely through self-play.
|
||||
- **2019 -- OpenAI Five conquers Dota 2.** Five neural networks played [45,000 years of Dota 2 against themselves](https://openai.com/index/openai-five-defeats-dota-2-world-champions/) over 10 months, then defeated **OG** -- the TI8 world champions -- 2-0 in a live match. In the public arena, the AI won 99.4% of 42,729 games. No scripted strategies. Models learned teamwork through self-play.
|
||||
|
||||
- **2019 -- DeepMind AlphaStar masters StarCraft II.** AlphaStar [beat professional players 10-1](https://deepmind.google/blog/alphastar-mastering-the-real-time-strategy-game-starcraft-ii/) in a closed-door match, and later achieved [Grandmaster status](https://www.nature.com/articles/d41586-019-03298-6) on European servers -- top 0.15% of 90,000 players. A game with imperfect information, real-time decisions, and a combinatorial action space that dwarfs chess and Go. The agent? A model. Trained. Not scripted.
|
||||
- **2019 -- DeepMind AlphaStar masters StarCraft II.** AlphaStar [beat a professional player 10-1](https://deepmind.google/blog/alphastar-mastering-the-real-time-strategy-game-starcraft-ii/) in closed matches, then reached [Grandmaster rank](https://www.nature.com/articles/d41586-019-03298-6) on the European server -- top 0.15% of 90,000 players. An incomplete-information, real-time game with a combinatorial action space far exceeding chess or Go.
|
||||
|
||||
- **2019 -- Tencent Jueyu dominates Honor of Kings.** Tencent AI Lab's "Jueyu" [defeated KPL professional players](https://www.jiemian.com/article/3371171.html) in a full 5v5 match at the World Champion Cup. In 1v1 mode, pros won only [1 out of 15 games and never survived past 8 minutes](https://developer.aliyun.com/article/851058). Training intensity: one day equaled 440 human years. By 2021, Jueyu surpassed KPL pros across the full hero pool. No handcrafted matchup tables. No scripted compositions. A model that learned the entire game from scratch through self-play.
|
||||
- **2019 -- Tencent Jueyu dominates Honor of Kings.** Tencent AI Lab's "Jueyu" system [defeated KPL professional players in full 5v5](https://www.jiemian.com/article/3371171.html) at the World Champion Cup semifinal. In 1v1 mode, pros [won just 1 out of 15 matches, lasting under 8 minutes at best](https://developer.aliyun.com/article/851058). Training intensity: one day equaled 440 human years. A model that learned the entire game from scratch through self-play.
|
||||
|
||||
- **2024-2025 -- LLM agents reshape software engineering.** Claude, GPT, Gemini -- large language models trained on the entirety of human code and reasoning -- are deployed as coding agents. They read codebases, write implementations, debug failures, coordinate in teams. The architecture is identical to every agent before them: a trained model, placed in an environment, given tools to perceive and act. The only difference is the scale of what they've learned and the generality of the tasks they solve.
|
||||
- **2024-2025 -- LLM agents reshape software engineering.** Claude, GPT, Gemini -- large language models trained on the full breadth of human code and reasoning -- are deployed as coding agents. They read codebases, write implementations, debug failures, and coordinate as teams. The architecture is identical to every previous agent: a trained model, placed in an environment, given tools for perception and action.
|
||||
|
||||
Every one of these milestones points to the same fact: **agency -- the ability to perceive, reason, and act -- is trained, not coded.** But every agent also needed an environment to operate in: the Atari emulator, the Dota 2 client, the StarCraft II engine, the IDE and terminal. The model provides intelligence. The environment provides the action space. Together they form a complete agent.
|
||||
Every milestone points to the same fact: **Agency -- the ability to perceive, reason, and act -- is trained, not coded.** But every agent also needs an environment to operate in: an Atari emulator, the Dota 2 client, the StarCraft II engine, an IDE and a terminal. The model supplies the intelligence. The environment supplies the action space. Together they form a complete agent.
|
||||
|
||||
### What an Agent Is NOT
|
||||
|
||||
The word "agent" has been hijacked by an entire cottage industry of prompt plumbing.
|
||||
The word "agent" has been hijacked by an entire prompt-plumbing industry.
|
||||
|
||||
Drag-and-drop workflow builders. No-code "AI agent" platforms. Prompt-chain orchestration libraries. They all share the same delusion: that wiring together LLM API calls with if-else branches, node graphs, and hardcoded routing logic constitutes "building an agent."
|
||||
Drag-and-drop workflow builders. No-code "AI Agent" platforms. Prompt-chain orchestration libraries. They share a single delusion: that stringing LLM API calls together with if-else branches, node graphs, and hardcoded routing logic constitutes "building an agent."
|
||||
|
||||
It doesn't. What they build is a Rube Goldberg machine -- an over-engineered, brittle pipeline of procedural rules, with an LLM wedged in as a glorified text-completion node. That is not an agent. That is a shell script with delusions of grandeur.
|
||||
It does not. What they produce are Rube Goldberg machines -- over-engineered, brittle, procedural rule pipelines with an LLM wedged in as a glorified text-completion node. That is not an agent. That is a shell script with grandiose pretensions.
|
||||
|
||||
**Prompt plumbing "agents" are the fantasy of programmers who don't train models.** They attempt to brute-force intelligence by stacking procedural logic -- massive rule trees, node graphs, chain-of-prompt waterfalls -- and praying that enough glue code will somehow emergently produce autonomous behavior. It won't. You cannot engineer your way to agency. Agency is learned, not programmed.
|
||||
You cannot brute-force intelligence by stacking procedural logic -- sprawling rule trees, node graphs, chained prompt waterfalls -- and praying that enough glue code will spontaneously produce autonomous behavior. It will not. You cannot engineer agency into existence. Agency is learned, not coded.
|
||||
|
||||
Those systems are dead on arrival: fragile, unscalable, fundamentally incapable of generalization. They are the modern resurrection of GOFAI (Good Old-Fashioned AI) -- the symbolic rule systems the field abandoned decades ago, now spray-painted with an LLM veneer. Different packaging, same dead end.
|
||||
### The Mindshift: From "Building Agents" to Building Harnesses
|
||||
|
||||
### The Mind Shift: From "Developing Agents" to Developing Harness
|
||||
When someone says "I am building an agent," they can only mean one of two things:
|
||||
|
||||
When someone says "I'm developing an agent," they can only mean one of two things:
|
||||
**1. Training a model.** Adjusting weights through reinforcement learning, fine-tuning, RLHF, or another gradient-based method. Collecting trajectory data -- real-world sequences of perception, reasoning, and action in a target domain -- and using it to shape the model's behavior. This is what DeepMind, OpenAI, Tencent AI Lab, and Anthropic do.
|
||||
|
||||
**1. Training the model.** Adjusting weights through reinforcement learning, fine-tuning, RLHF, or other gradient-based methods. Collecting task-process data -- the actual sequences of perception, reasoning, and action in real domains -- and using it to shape the model's behavior. This is what DeepMind, OpenAI, Tencent AI Lab, and Anthropic do. This is agent development in the truest sense.
|
||||
**2. Building a harness.** Writing the code that gives a model an operational environment. This is what most of us do, and it is the core of this repository.
|
||||
|
||||
**2. Building the harness.** Writing the code that gives the model an environment to operate in. This is what most of us do, and it is the focus of this repository.
|
||||
|
||||
A harness is everything the agent needs to function in a specific domain:
|
||||
A harness is everything an agent needs to work in a specific domain:
|
||||
|
||||
```
|
||||
Harness = Tools + Knowledge + Observation + Action Interfaces + Permissions
|
||||
@@ -56,83 +57,55 @@ Harness = Tools + Knowledge + Observation + Action Interfaces + Permissions
|
||||
Knowledge: product docs, domain references, API specs, style guides
|
||||
Observation: git diff, error logs, browser state, sensor data
|
||||
Action: CLI commands, API calls, UI interactions
|
||||
Permissions: sandboxing, approval workflows, trust boundaries
|
||||
Permissions: sandbox isolation, approval workflows, trust boundaries
|
||||
```
|
||||
|
||||
The model decides. The harness executes. The model reasons. The harness provides context. The model is the driver. The harness is the vehicle.
|
||||
|
||||
**A coding agent's harness is its IDE, terminal, and filesystem access.** A farm agent's harness is its sensor array, irrigation controls, and weather data feeds. A hotel agent's harness is its booking system, guest communication channels, and facility management APIs. The agent -- the intelligence, the decision-maker -- is always the model. The harness changes per domain. The agent generalizes across them.
|
||||
|
||||
This repo teaches you to build vehicles. Vehicles for coding. But the design patterns generalize to any domain: farm management, hotel operations, manufacturing, logistics, healthcare, education, scientific research. Anywhere a task needs to be perceived, reasoned about, and acted upon -- an agent needs a harness.
|
||||
This repository teaches you to build the vehicle. A vehicle for coding. But the design patterns generalize to any domain.
|
||||
|
||||
### What Harness Engineers Actually Do
|
||||
|
||||
If you are reading this repository, you are likely a harness engineer -- and that is a powerful thing to be. Here is your real job:
|
||||
If you are reading this repository, you are most likely a harness engineer. Here is what the job actually entails:
|
||||
|
||||
- **Implement tools.** Give the agent hands. File read/write, shell execution, API calls, browser control, database queries. Each tool is an action the agent can take in its environment. Design them to be atomic, composable, and well-described.
|
||||
- **Implement tools.** Give the agent hands. File read/write, shell execution, API calls, browser control, database queries. Each tool is one action the agent can take in its environment. Design them atomic, composable, and clearly described.
|
||||
|
||||
- **Curate knowledge.** Give the agent domain expertise. Product documentation, architectural decision records, style guides, regulatory requirements. Load them on-demand (s05), not upfront. The agent should know what's available and pull what it needs.
|
||||
- **Curate knowledge.** Give the agent domain expertise. Product documentation, architecture decision records, style guides, compliance requirements. Load on demand, not upfront.
|
||||
|
||||
- **Manage context.** Give the agent clean memory. Subagent isolation (s04) prevents noise from leaking. Context compression (s06) prevents history from overwhelming. Task systems (s07) persist goals beyond any single conversation.
|
||||
- **Manage context.** Give the agent clean memory. Subagent isolation prevents noise leakage. Context compaction prevents history from drowning the present. Task systems let goals persist beyond a single conversation.
|
||||
|
||||
- **Control permissions.** Give the agent boundaries. Sandbox file access. Require approval for destructive operations. Enforce trust boundaries between the agent and external systems. This is where safety engineering meets harness engineering.
|
||||
- **Control permissions.** Give the agent boundaries. Sandbox file access. Require approval for destructive operations. Enforce trust boundaries between the agent and external systems.
|
||||
|
||||
- **Collect task-process data.** Every action sequence the agent executes in your harness is training signal. The perception-reasoning-action traces from real deployments are the raw material for fine-tuning the next generation of agent models. Your harness doesn't just serve the agent -- it can help improve the agent.
|
||||
- **Collect trajectory data.** Every action sequence the agent executes in your harness is training signal. Real deployment trajectories are the raw material for fine-tuning the next generation of agent models.
|
||||
|
||||
You are not writing the intelligence. You are building the world the intelligence inhabits. The quality of that world -- how clearly the agent can perceive, how precisely it can act, how rich its available knowledge is -- directly determines how effectively the intelligence can express itself.
|
||||
You are not writing intelligence. You are building the world that intelligence inhabits. The quality of that world directly determines how effectively the intelligence can express itself.
|
||||
|
||||
**Build great harnesses. The agent will do the rest.**
|
||||
**Build the harness well. The model will do the rest.**
|
||||
|
||||
### Why Claude Code -- A Masterclass in Harness Engineering
|
||||
### Why Claude Code
|
||||
|
||||
Why does this repository dissect Claude Code specifically?
|
||||
Because Claude Code is the most elegant, most complete agent harness implementation we have seen. Not because of any clever trick, but because of what it *does not* do: it does not try to be the agent. It does not impose rigid workflows. It does not substitute hand-crafted decision trees for the model's own judgment. It gives the model tools, knowledge, context management, and permission boundaries -- then gets out of the way.
|
||||
|
||||
Because Claude Code is the most elegant and fully-realized agent harness we have seen. Not because of any single clever trick, but because of what it *doesn't* do: it doesn't try to be the agent. It doesn't impose rigid workflows. It doesn't second-guess the model with elaborate decision trees. It provides the model with tools, knowledge, context management, and permission boundaries -- then gets out of the way.
|
||||
|
||||
Look at what Claude Code actually is, stripped to its essence:
|
||||
Strip Claude Code down to its essence:
|
||||
|
||||
```
|
||||
Claude Code = one agent loop
|
||||
+ tools (bash, read, write, edit, glob, grep, browser...)
|
||||
+ on-demand skill loading
|
||||
+ context compression
|
||||
+ context compaction
|
||||
+ subagent spawning
|
||||
+ task system with dependency graph
|
||||
+ team coordination with async mailboxes
|
||||
+ worktree isolation for parallel execution
|
||||
+ task system with dependency graphs
|
||||
+ async mailbox team coordination
|
||||
+ worktree-isolated parallel execution
|
||||
+ permission governance
|
||||
+ hooks extension system
|
||||
+ memory persistence
|
||||
+ MCP external capability routing
|
||||
```
|
||||
|
||||
That's it. That's the entire architecture. Every component is a harness mechanism -- a piece of the world built for the agent to inhabit. The agent itself? It's Claude. A model. Trained by Anthropic on the full breadth of human reasoning and code. The harness doesn't make Claude smart. Claude is already smart. The harness gives Claude hands, eyes, and a workspace.
|
||||
That is it. The agent itself? Claude. A model. Trained by Anthropic on the full breadth of human reasoning and code. The harness did not make Claude smart. Claude was already smart. The harness gave Claude hands, eyes, and a workspace.
|
||||
|
||||
This is why Claude Code is the ideal teaching subject: **it demonstrates what happens when you trust the model and focus your engineering on the harness.** Every session in this repository (s01-s12) reverse-engineers one harness mechanism from Claude Code's architecture. By the end, you understand not just how Claude Code works, but the universal principles of harness engineering that apply to any agent in any domain.
|
||||
|
||||
The lesson is not "copy Claude Code." The lesson is: **the best agent products are built by engineers who understand that their job is harness, not intelligence.**
|
||||
|
||||
---
|
||||
|
||||
## The Vision: Fill the Universe with Real Agents
|
||||
|
||||
This is not just about coding agents.
|
||||
|
||||
Every domain where humans perform complex, multi-step, judgment-intensive work is a domain where agents can operate -- given the right harness. The patterns in this repository are universal:
|
||||
|
||||
```
|
||||
Estate management agent = model + property sensors + maintenance tools + tenant comms
|
||||
Agricultural agent = model + soil/weather data + irrigation controls + crop knowledge
|
||||
Hotel operations agent = model + booking system + guest channels + facility APIs
|
||||
Medical research agent = model + literature search + lab instruments + protocol docs
|
||||
Manufacturing agent = model + production line sensors + quality controls + logistics
|
||||
Education agent = model + curriculum knowledge + student progress + assessment tools
|
||||
```
|
||||
|
||||
The loop is always the same. The tools change. The knowledge changes. The permissions change. The agent -- the model -- generalizes.
|
||||
|
||||
Every harness engineer reading this repository is learning patterns that apply far beyond software engineering. You are learning to build the infrastructure for an intelligent, automated future. Every well-designed harness deployed in a real domain is one more place where an agent can perceive, reason, and act.
|
||||
|
||||
First we fill the workshops. Then the farms, the hospitals, the factories. Then the cities. Then the planet.
|
||||
|
||||
**Bash is all you need. Real agents are all the universe needs.**
|
||||
The takeaway is not "copy Claude Code." The takeaway is: **the best agent products come from engineers who understand that their job is the harness, not the intelligence.**
|
||||
|
||||
---
|
||||
|
||||
@@ -151,43 +124,13 @@ First we fill the workshops. Then the farms, the hospitals, the factories. Then
|
||||
loop back -----------------> messages[]
|
||||
|
||||
|
||||
That's the minimal loop. Every AI agent needs this loop.
|
||||
The MODEL decides when to call tools and when to stop.
|
||||
The CODE just executes what the model asks for.
|
||||
This repo teaches you to build what surrounds this loop --
|
||||
The model decides when to call tools and when to stop.
|
||||
The code just executes what the model asks for.
|
||||
This repo teaches you to build everything around this loop --
|
||||
the harness that makes the agent effective in a specific domain.
|
||||
```
|
||||
|
||||
**12 progressive sessions, from a simple loop to isolated autonomous execution.**
|
||||
**Each session adds one harness mechanism. Each mechanism has one motto.**
|
||||
|
||||
> **s01** *"One loop & Bash is all you need"* — one tool + one loop = an agent
|
||||
>
|
||||
> **s02** *"Adding a tool means adding one handler"* — the loop stays the same; new tools register into the dispatch map
|
||||
>
|
||||
> **s03** *"An agent without a plan drifts"* — list the steps first, then execute; completion doubles
|
||||
>
|
||||
> **s04** *"Break big tasks down; each subtask gets a clean context"* — subagents use independent messages[], keeping the main conversation clean
|
||||
>
|
||||
> **s05** *"Load knowledge when you need it, not upfront"* — inject via tool_result, not the system prompt
|
||||
>
|
||||
> **s06** *"Context will fill up; you need a way to make room"* — three-layer compression strategy for infinite sessions
|
||||
>
|
||||
> **s07** *"Break big goals into small tasks, order them, persist to disk"* — a file-based task graph with dependencies, laying the foundation for multi-agent collaboration
|
||||
>
|
||||
> **s08** *"Run slow operations in the background; the agent keeps thinking"* — daemon threads run commands, inject notifications on completion
|
||||
>
|
||||
> **s09** *"When the task is too big for one, delegate to teammates"* — persistent teammates + async mailboxes
|
||||
>
|
||||
> **s10** *"Teammates need shared communication rules"* — one request-response pattern drives all negotiation
|
||||
>
|
||||
> **s11** *"Teammates scan the board and claim tasks themselves"* — no need for the lead to assign each one
|
||||
>
|
||||
> **s12** *"Each works in its own directory, no interference"* — tasks manage goals, worktrees manage directories, bound by ID
|
||||
|
||||
---
|
||||
|
||||
## The Core Pattern
|
||||
## Core Pattern
|
||||
|
||||
```python
|
||||
def agent_loop(messages):
|
||||
@@ -214,140 +157,284 @@ def agent_loop(messages):
|
||||
messages.append({"role": "user", "content": results})
|
||||
```
|
||||
|
||||
Every session layers one harness mechanism on top of this loop -- without changing the loop itself. The loop belongs to the agent. The mechanisms belong to the harness.
|
||||
Every lesson layers one harness mechanism on top of this loop -- the loop itself never changes. The loop belongs to the agent. The mechanisms belong to the harness.
|
||||
|
||||
## Scope (Important)
|
||||
---
|
||||
|
||||
This repository is a 0->1 learning project for harness engineering -- building the environment that surrounds an agent model.
|
||||
It intentionally simplifies or omits several production mechanisms:
|
||||
## Version Status
|
||||
|
||||
- Full event/hook buses (for example PreToolUse, SessionStart/End, ConfigChange).
|
||||
s12 includes only a minimal append-only lifecycle event stream for teaching.
|
||||
- Rule-based permission governance and trust workflows
|
||||
- Session lifecycle controls (resume/fork) and advanced worktree lifecycle controls
|
||||
- Full MCP runtime details (transport/OAuth/resource subscribe/polling)
|
||||
This repository currently contains two tutorial tracks:
|
||||
|
||||
Treat the team JSONL mailbox protocol in this repo as a teaching implementation, not a claim about any specific production internals.
|
||||
- **Current track: root-level `s01-s20`**
|
||||
The root-level `s01_*` ... `s20_*` folders are the new canonical version. Each chapter contains a full narrative README, translations, runnable `code.py`, and diagrams where needed.
|
||||
- **Legacy transition track: `docs/`, `agents/`, and the current `web/` app**
|
||||
These still preserve the older 12-lesson version. They are kept temporarily for existing readers, old links, and the web platform while the new 20-lesson track settles.
|
||||
|
||||
If you are starting now, read the root-level `s01_agent_loop/` through `s20_comprehensive/` chapters. If you are following an older link or using the current web app, you are likely reading the legacy 12-lesson track. The legacy and current chapter numbers do not always match, so avoid mixing chapter numbers across tracks.
|
||||
|
||||
### Legacy-to-Current Mapping
|
||||
|
||||
| Legacy 12-lesson track | Current 20-lesson track | Topic |
|
||||
|---|---|---|
|
||||
| old s01 | new s01 | Agent Loop |
|
||||
| old s02 | new s02 | Tool Use |
|
||||
| old s03 | new s05 | TodoWrite |
|
||||
| old s04 | new s06 | Subagent |
|
||||
| old s05 | new s07 | Skill Loading |
|
||||
| old s06 | new s08 | Context Compact |
|
||||
| old s07 | new s12 | Task System |
|
||||
| old s08 | new s13 | Background Tasks |
|
||||
| old s09 | new s15 | Agent Teams |
|
||||
| old s10 | new s16 | Team Protocols |
|
||||
| old s11 | new s17 | Autonomous Agents |
|
||||
| old s12 | new s18 | Worktree Isolation |
|
||||
| new only | s03, s04, s09, s10, s11, s14, s19, s20 | Permission, Hooks, Memory, System Prompt, Error Recovery, Cron, MCP, Comprehensive Agent |
|
||||
|
||||
---
|
||||
|
||||
## Scope
|
||||
|
||||
This repository is a 0-to-1 harness engineering learning project: it teaches how to build the working environment around an agent model. To keep the learning path clear, some production mechanisms are intentionally simplified or omitted:
|
||||
|
||||
- Full event / hook bus behavior, such as `PreToolUse`, `SessionStart/End`, and `ConfigChange`.
|
||||
The teaching code uses minimal lifecycle events where needed.
|
||||
- Rule-based permission governance and full trust workflows.
|
||||
- Session lifecycle controls such as resume/fork, plus more complete worktree lifecycle handling.
|
||||
- Full MCP runtime details such as transport, OAuth, resource subscription, and polling.
|
||||
|
||||
The JSONL mailbox protocol in this repository is a teaching implementation, not a claim about any specific production internal implementation.
|
||||
|
||||
---
|
||||
|
||||
## 20 Progressive Lessons
|
||||
|
||||
**Each lesson adds one harness mechanism. Each mechanism has a motto.**
|
||||
|
||||
> **s01** *"One loop & Bash is all you need"* — one tool + one loop = one agent
|
||||
>
|
||||
> **s02** *"Adding a tool means adding one handler"* — the loop stays untouched; new tools register into the dispatch map
|
||||
>
|
||||
> **s03** *"Set boundaries first, then grant freedom"* — check what can run, what must stop, and what needs approval
|
||||
>
|
||||
> **s04** *"Hook around the loop, never rewrite the loop"* — add extension points without changing the main loop
|
||||
>
|
||||
> **s05** *"An agent without a plan drifts"* — list the steps before starting; completion rate doubles
|
||||
>
|
||||
> **s06** *"Big tasks split small, each subtask gets clean context"* — subagents do the side work and bring back only the result
|
||||
>
|
||||
> **s07** *"Load knowledge on demand, not upfront"* — list skills first, expand them only when needed
|
||||
>
|
||||
> **s08** *"Context always fills up -- have a way to make room"* — multi-layer compaction strategies buy you infinite sessions
|
||||
>
|
||||
> **s09** *"Remember what matters, forget what doesn't"* — three subsystems: selection, extraction, consolidation
|
||||
>
|
||||
> **s10** *"Prompts are assembled at runtime, not hardcoded"* — section-based concatenation, loaded on demand
|
||||
>
|
||||
> **s11** *"Errors aren't the end, they're the start of a retry"* — retry, make room, or take another path when things fail
|
||||
>
|
||||
> **s12** *"Big goals break into small tasks, ordered, persisted to disk"* — a file-backed task graph that lays the groundwork for multi-agent coordination
|
||||
>
|
||||
> **s13** *"Slow ops go background, agent keeps thinking"* — background threads run commands; notifications inject on completion
|
||||
>
|
||||
> **s14** *"Fire on schedule, no human kick needed"* — trigger tasks automatically by time
|
||||
>
|
||||
> **s15** *"Too big for one agent -- delegate to teammates"* — persistent teammates + async mailboxes
|
||||
>
|
||||
> **s16** *"Teammates need shared communication rules"* — use a fixed request-reply format for coordination
|
||||
>
|
||||
> **s17** *"Teammates check the board, claim work themselves"* — no leader assigning one by one; self-organizing
|
||||
>
|
||||
> **s18** *"Each works in its own directory, no interference"* — tasks own goals, worktrees own directories, bound by ID
|
||||
>
|
||||
> **s19** *"Not enough capability? Plug in more via MCP"* — connect external tools into the same tool pool
|
||||
>
|
||||
> **s20** *"Many mechanisms, one loop"* — all previous mechanisms return to one complete harness
|
||||
|
||||
---
|
||||
|
||||
## Learning Path
|
||||
|
||||
Main line: act → handle complex work → remember and recover → run long tasks → collaborate → extend and assemble.
|
||||
|
||||
```mermaid
|
||||
flowchart TD
|
||||
%% Card styles
|
||||
classDef stage1 fill:#E3F2FD,stroke:#1976D2,stroke-width:2px,color:#0D47A1,rx:12,ry:12,text-align:left
|
||||
classDef stage2 fill:#E8F5E9,stroke:#388E3C,stroke-width:2px,color:#1B5E20,rx:12,ry:12,text-align:left
|
||||
classDef stage3 fill:#FFF3E0,stroke:#F57C00,stroke-width:2px,color:#E65100,rx:12,ry:12,text-align:left
|
||||
classDef stage4 fill:#FCE4EC,stroke:#C2185b,stroke-width:2px,color:#880E4F,rx:12,ry:12,text-align:left
|
||||
classDef stage5 fill:#F3E5F5,stroke:#7B1FA2,stroke-width:2px,color:#4A148C,rx:12,ry:12,text-align:left
|
||||
classDef stage6 fill:#E0F7FA,stroke:#0097A7,stroke-width:2px,color:#006064,rx:12,ry:12,text-align:left
|
||||
|
||||
%% Group style
|
||||
classDef groupBox fill:#F8F9FA,stroke:#CED4DA,stroke-width:2px,stroke-dasharray: 5 5,rx:15,ry:15,color:#495057
|
||||
|
||||
%% Layer 1: stages 1-3
|
||||
subgraph Phase1 ["🌱 Stages 1-3: Core capabilities (simple to complex)"]
|
||||
direction LR
|
||||
S1["<b>1. Let the Agent act</b><br/>━━━━━━━━━━━━━<br/><b>s01 Agent Loop</b><br/>└─ one loop + bash<br/><br/><b>s02 Tool Use</b><br/>└─ one tool to many tools<br/><br/><b>s03 Permission</b><br/>└─ decide what can run<br/><br/><b>s04 Hooks</b><br/>└─ extension points around tools"]:::stage1
|
||||
|
||||
S2["<b>2. Handle complex work</b><br/>━━━━━━━━━━━━━<br/><b>s05 TodoWrite</b><br/>└─ plan first, then execute<br/><br/><b>s06 Subagent</b><br/>└─ side work, result back<br/><br/><b>s08 Context Compact</b><br/>└─ make room in long context"]:::stage2
|
||||
|
||||
S3["<b>3. Remember and recover</b><br/>━━━━━━━━━━━━━<br/><b>s09 Memory</b><br/>└─ remember what matters<br/><br/><b>s10 System Prompt</b><br/>└─ assemble at runtime<br/><br/><b>s11 Error Recovery</b><br/>└─ retry or change path"]:::stage3
|
||||
|
||||
S1 ==> S2 ==> S3
|
||||
end
|
||||
|
||||
%% Layer 2: stages 4-6
|
||||
subgraph Phase2 ["🚀 Stages 4-6: Advanced capabilities (long-running, collaboration, integration)"]
|
||||
direction LR
|
||||
S4["<b>4. Run long tasks</b><br/>━━━━━━━━━━━━━<br/><b>s12 Task System</b><br/>└─ persist tasks and deps<br/><br/><b>s13 Background Tasks</b><br/>└─ send slow work background<br/><br/><b>s14 Cron Scheduler</b><br/>└─ trigger by time"]:::stage4
|
||||
|
||||
S5["<b>5. Coordinate many Agents</b><br/>━━━━━━━━━━━━━<br/><b>s15 Agent Teams</b><br/>└─ teammates + mailboxes<br/><br/><b>s16 Team Protocols</b><br/>└─ fixed request-reply format<br/><br/><b>s17 Autonomous Agents</b><br/>└─ claim work from the board<br/><br/><b>s18 Worktree Isolation</b><br/>└─ separate directories"]:::stage5
|
||||
|
||||
S6["<b>6. Extend and assemble</b><br/>━━━━━━━━━━━━━<br/><b>s07 Skill Loading</b><br/>└─ expand skills on demand<br/><br/><b>s19 MCP Plugin</b><br/>└─ external tools, one pool<br/><br/><b>s20 Comprehensive Agent</b><br/>└─ all mechanisms, one loop"]:::stage6
|
||||
|
||||
S4 ==> S5 ==> S6
|
||||
end
|
||||
|
||||
%% Connect the two layers
|
||||
Phase1 ===> Phase2
|
||||
|
||||
class Phase1,Phase2 groupBox
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## All Chapters
|
||||
|
||||
| Chapter | Topic | Key Concepts |
|
||||
|---|---|---|
|
||||
| [s01](./s01_agent_loop/) | Agent Loop | `messages` / `while True` / `stop_reason` |
|
||||
| [s02](./s02_tool_use/) | Tool Use | `TOOL_HANDLERS` / dispatch map / concurrency |
|
||||
| [s03](./s03_permission/) | Permission System | `PermissionRule` / approval pipeline |
|
||||
| [s04](./s04_hooks/) | Hook System | `PreToolUse` / `PostToolUse` / extension points |
|
||||
| [s05](./s05_todo_write/) | TodoWrite | `TodoItem` / plan-then-execute |
|
||||
| [s06](./s06_subagent/) | Subagent | `fresh messages[]` / context isolation |
|
||||
| [s07](./s07_skill_loading/) | Skill Loading | `SkillManifest` / on-demand injection |
|
||||
| [s08](./s08_context_compact/) | Context Compact | snipCompact / microCompact / toolResultBudget / autoCompact |
|
||||
| [s09](./s09_memory/) | Memory System | selection / extraction / consolidation |
|
||||
| [s10](./s10_system_prompt/) | System Prompt | runtime assembly / section concatenation |
|
||||
| [s11](./s11_error_recovery/) | Error Recovery | token escalation / fallback model / retry strategies |
|
||||
| [s12](./s12_task_system/) | Task System | `TaskRecord` / `blockedBy` / disk persistence |
|
||||
| [s13](./s13_background_tasks/) | Background Tasks | threaded execution / notification queue |
|
||||
| [s14](./s14_cron_scheduler/) | Cron Scheduler | durable scheduling / session-scoped triggers |
|
||||
| [s15](./s15_agent_teams/) | Agent Teams | `MessageBus` / inbox / permission bubbling |
|
||||
| [s16](./s16_team_protocols/) | Team Protocols | shutdown handshake / plan approval |
|
||||
| [s17](./s17_autonomous_agents/) | Autonomous Agents | idle cycle / auto-claim / self-organization |
|
||||
| [s18](./s18_worktree_isolation/) | Worktree Isolation | `WorktreeRecord` / task-directory binding |
|
||||
| [s19](./s19_mcp_plugin/) | MCP Plugin | multi-transport / channel routing / tool pool assembly |
|
||||
| [s20](./s20_comprehensive/) | Comprehensive Agent | all mechanisms around one loop |
|
||||
|
||||
---
|
||||
|
||||
## How to Read
|
||||
|
||||
Each chapter is a folder. Open one and you will find:
|
||||
|
||||
```
|
||||
s08_context_compact/
|
||||
README.md # full narrative with inline code
|
||||
README.en.md # English translation
|
||||
README.ja.md # Japanese translation
|
||||
code.py # standalone runnable implementation
|
||||
images/ # SVG diagrams (where needed)
|
||||
```
|
||||
|
||||
Read the `README.md` for the core idea and work through the code. Complex chapters have `<details>` folds for deep dives -- open them when you want to go deeper. Simple chapters have 0-1 diagrams, complex chapters have more.
|
||||
|
||||
Read from s01 through s20 in order. Each chapter assumes you've read the previous ones and ends with a hook into the next.
|
||||
|
||||
---
|
||||
|
||||
## Quick Start
|
||||
|
||||
### Current 20-Lesson Track
|
||||
|
||||
```sh
|
||||
git clone https://github.com/shareAI-lab/learn-claude-code
|
||||
cd learn-claude-code
|
||||
pip install -r requirements.txt
|
||||
cp .env.example .env # Edit .env with your ANTHROPIC_API_KEY
|
||||
cp .env.example .env # configure ANTHROPIC_API_KEY
|
||||
|
||||
python agents/s01_agent_loop.py # Start here
|
||||
python agents/s12_worktree_task_isolation.py # Full progression endpoint
|
||||
python agents/s_full.py # Capstone: all mechanisms combined
|
||||
python s01_agent_loop/code.py # Start here -- one loop + bash
|
||||
python s08_context_compact/code.py # Context compaction (complex)
|
||||
python s20_comprehensive/code.py # Endpoint: all mechanisms in one loop
|
||||
```
|
||||
|
||||
### Legacy 12-Lesson Track
|
||||
|
||||
```sh
|
||||
python agents/s01_agent_loop.py
|
||||
python agents/s12_worktree_task_isolation.py
|
||||
python agents/s_full.py
|
||||
```
|
||||
|
||||
### Web Platform
|
||||
|
||||
Interactive visualizations, step-through diagrams, source viewer, and documentation.
|
||||
The current web app still renders the legacy `docs/` s01-s12 track. Use the root-level folders for the new s01-s20 track.
|
||||
|
||||
```sh
|
||||
cd web && npm install && npm run dev # http://localhost:3000
|
||||
```
|
||||
|
||||
## Learning Path
|
||||
---
|
||||
|
||||
```
|
||||
Phase 1: THE LOOP Phase 2: PLANNING & KNOWLEDGE
|
||||
================== ==============================
|
||||
s01 The Agent Loop [1] s03 TodoWrite [5]
|
||||
while + stop_reason TodoManager + nag reminder
|
||||
| |
|
||||
+-> s02 Tool Use [4] s04 Subagents [5]
|
||||
dispatch map: name->handler fresh messages[] per child
|
||||
|
|
||||
s05 Skills [5]
|
||||
SKILL.md via tool_result
|
||||
|
|
||||
s06 Context Compact [5]
|
||||
3-layer compression
|
||||
|
||||
Phase 3: PERSISTENCE Phase 4: TEAMS
|
||||
================== =====================
|
||||
s07 Tasks [8] s09 Agent Teams [9]
|
||||
file-based CRUD + deps graph teammates + JSONL mailboxes
|
||||
| |
|
||||
s08 Background Tasks [6] s10 Team Protocols [12]
|
||||
daemon threads + notify queue shutdown + plan approval FSM
|
||||
|
|
||||
s11 Autonomous Agents [14]
|
||||
idle cycle + auto-claim
|
||||
|
|
||||
s12 Worktree Isolation [16]
|
||||
task coordination + optional isolated execution lanes
|
||||
|
||||
[N] = number of tools
|
||||
```
|
||||
|
||||
## Architecture
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
learn-claude-code/
|
||||
|
|
||||
|-- agents/ # Python reference implementations (s01-s12 + s_full capstone)
|
||||
|-- docs/{en,zh,ja}/ # Mental-model-first documentation (3 languages)
|
||||
|-- web/ # Interactive learning platform (Next.js)
|
||||
|-- skills/ # Skill files for s05
|
||||
+-- .github/workflows/ci.yml # CI: typecheck + build
|
||||
s01_agent_loop/ # one folder per chapter
|
||||
README.md # Chinese source (complete narrative)
|
||||
README.en.md # English translation
|
||||
README.ja.md # Japanese translation
|
||||
code.py # standalone runnable code
|
||||
images/ # SVG diagrams
|
||||
s02_tool_use/
|
||||
...
|
||||
s19_mcp_plugin/
|
||||
s20_comprehensive/ # endpoint chapter
|
||||
agents/ # legacy 12 runnable copies + s_full.py
|
||||
skills/ # skill files used by s07
|
||||
docs/ # legacy 12-lesson docs, kept during transition
|
||||
web/ # currently renders the legacy docs/ track
|
||||
tests/
|
||||
```
|
||||
|
||||
## Documentation
|
||||
---
|
||||
|
||||
Mental-model-first: problem, solution, ASCII diagram, minimal code.
|
||||
Available in [English](./docs/en/) | [中文](./docs/zh/) | [日本語](./docs/ja/).
|
||||
## What's Next
|
||||
|
||||
| Session | Topic | Motto |
|
||||
|---------|-------|-------|
|
||||
| [s01](./docs/en/s01-the-agent-loop.md) | The Agent Loop | *One loop & Bash is all you need* |
|
||||
| [s02](./docs/en/s02-tool-use.md) | Tool Use | *Adding a tool means adding one handler* |
|
||||
| [s03](./docs/en/s03-todo-write.md) | TodoWrite | *An agent without a plan drifts* |
|
||||
| [s04](./docs/en/s04-subagent.md) | Subagents | *Break big tasks down; each subtask gets a clean context* |
|
||||
| [s05](./docs/en/s05-skill-loading.md) | Skills | *Load knowledge when you need it, not upfront* |
|
||||
| [s06](./docs/en/s06-context-compact.md) | Context Compact | *Context will fill up; you need a way to make room* |
|
||||
| [s07](./docs/en/s07-task-system.md) | Tasks | *Break big goals into small tasks, order them, persist to disk* |
|
||||
| [s08](./docs/en/s08-background-tasks.md) | Background Tasks | *Run slow operations in the background; the agent keeps thinking* |
|
||||
| [s09](./docs/en/s09-agent-teams.md) | Agent Teams | *When the task is too big for one, delegate to teammates* |
|
||||
| [s10](./docs/en/s10-team-protocols.md) | Team Protocols | *Teammates need shared communication rules* |
|
||||
| [s11](./docs/en/s11-autonomous-agents.md) | Autonomous Agents | *Teammates scan the board and claim tasks themselves* |
|
||||
| [s12](./docs/en/s12-worktree-task-isolation.md) | Worktree + Task Isolation | *Each works in its own directory, no interference* |
|
||||
|
||||
## What's Next -- from understanding to shipping
|
||||
|
||||
After the 12 sessions you understand how harness engineering works inside out. Two ways to put that knowledge to work:
|
||||
After 20 lessons, you understand harness engineering from the inside out. Two paths to turn that knowledge into product:
|
||||
|
||||
### Kode Agent CLI -- Open-Source Coding Agent CLI
|
||||
|
||||
> `npm i -g @shareai-lab/kode`
|
||||
|
||||
Skill & LSP support, Windows-ready, pluggable with GLM / MiniMax / DeepSeek and other open models. Install and go.
|
||||
Skill and LSP support, Windows compatible, works with GLM / MiniMax / DeepSeek and other open models. Install and go.
|
||||
|
||||
GitHub: **[shareAI-lab/Kode-cli](https://github.com/shareAI-lab/Kode-cli)**
|
||||
GitHub: **[shareAI-lab/Kode-Agent](https://github.com/shareAI-lab/Kode-Agent)**
|
||||
|
||||
### Kode Agent SDK -- Embed Agent Capabilities in Your App
|
||||
### Kode Agent SDK -- Embed Agent Capabilities in Your Application
|
||||
|
||||
The official Claude Code Agent SDK communicates with a full CLI process under the hood -- each concurrent user means a separate terminal process. Kode SDK is a standalone library with no per-user process overhead, embeddable in backends, browser extensions, embedded devices, or any runtime.
|
||||
A standalone library with no per-user process overhead. Embed it in backends, browser extensions, embedded devices, or any runtime.
|
||||
|
||||
GitHub: **[shareAI-lab/Kode-agent-sdk](https://github.com/shareAI-lab/Kode-agent-sdk)**
|
||||
GitHub: **[shareAI-lab/kode-agent-sdk](https://github.com/shareAI-lab/kode-agent-sdk)**
|
||||
|
||||
---
|
||||
|
||||
## Sister Repo: from *on-demand sessions* to *always-on assistant*
|
||||
## Sister Tutorial: From Passive Sessions to Always-On Assistants
|
||||
|
||||
The harness this repo teaches is **use-and-discard** -- open a terminal, give the agent a task, close when done, next session starts blank. That is the Claude Code model.
|
||||
The harness taught in this repository is the **use-and-discard** kind -- open a terminal, give the agent a task, close when done, next session starts fresh. Claude Code works this way.
|
||||
|
||||
[OpenClaw](https://github.com/openclaw/openclaw) proved another possibility: on top of the same agent core, two harness mechanisms turn the agent from "poke it to make it move" into "it wakes up every 30 seconds to look for work":
|
||||
But [OpenClaw](https://github.com/openclaw/openclaw) proves another possibility: on the same agent core, two additional harness mechanisms turn an agent from "poke it and it moves" into "wakes itself every 30 seconds to look for work":
|
||||
|
||||
- **Heartbeat** -- every 30s the harness sends the agent a message to check if there is anything to do. Nothing? Go back to sleep. Something? Act immediately.
|
||||
- **Cron** -- the agent can schedule its own future tasks, executed automatically when the time comes.
|
||||
- **Heartbeat** -- every 30 seconds the harness sends the agent a message, letting it check for pending work. Nothing to do? Keep sleeping. Something appeared? Act immediately.
|
||||
- **Cron** -- the agent can schedule its own future tasks, which fire automatically when the time arrives.
|
||||
|
||||
Add multi-channel IM routing (WhatsApp / Telegram / Slack / Discord, 13+ platforms), persistent context memory, and a Soul personality system, and the agent goes from a disposable tool to an always-on personal AI assistant.
|
||||
Add IM multi-channel routing (WhatsApp / Telegram / Slack / Discord and 13+ other platforms), persistent context memory, and a Soul personality system, and the agent transforms from a disposable tool into an always-on personal AI assistant.
|
||||
|
||||
**[claw0](https://github.com/shareAI-lab/claw0)** is our companion teaching repo that deconstructs these harness mechanisms from scratch:
|
||||
**[claw0](https://github.com/shareAI-lab/claw0)** is our sister teaching repository, breaking down these harness mechanisms from scratch:
|
||||
|
||||
```
|
||||
claw agent = agent core + heartbeat + cron + IM chat + memory + soul
|
||||
@@ -355,23 +442,19 @@ claw agent = agent core + heartbeat + cron + IM chat + memory + soul
|
||||
|
||||
```
|
||||
learn-claude-code claw0
|
||||
(agent harness core: (proactive always-on harness:
|
||||
loop, tools, planning, heartbeat, cron, IM channels,
|
||||
teams, worktree isolation) memory, soul personality)
|
||||
(agent harness internals: (always-on harness:
|
||||
loop, tools, planning, heartbeat, cron, IM channels,
|
||||
teams, worktree isolation) memory, Soul personality)
|
||||
```
|
||||
|
||||
## About
|
||||
<img width="260" src="https://github.com/user-attachments/assets/fe8b852b-97da-4061-a467-9694906b5edf" /><br>
|
||||
|
||||
Scan with WeChat to follow us,
|
||||
or follow on X: [shareAI-Lab](https://x.com/baicai003)
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
|
||||
---
|
||||
|
||||
**Agency comes from the model. The harness makes agency real. Build great harnesses. The model will do the rest.**
|
||||
**Agency comes from the model. The harness gives agency a place to land. Build the harness well, and the model will do the rest.**
|
||||
|
||||
**Bash is all you need. Real agents are all the universe needs.**
|
||||
|
||||
**This is not "copy the source code." This is "grasp the key designs and build it yourself."**
|
||||
|
||||
Reference in New Issue
Block a user