Skip to content

Latest commit

 

History

49 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent State Management

A source-level deep dive into how Claude Code and OpenClaw manage agent state.

Read Online Claude Code OpenClaw License: MIT

English | 中文


Overview

How does an AI agent acquire, maintain, update, and discard state throughout its lifecycle to ensure coherent decision-making?

This report dissects two major agent frameworks — Claude Code and OpenClaw — at the source-code level, analyzing their state management across 6 dimensions.

Framework Version / Source Scale
Claude Code v2.1.88 (npm source map) 1,884 .ts/.tsx files, ~512K lines
OpenClaw GitHub open source 11,295 .ts/.js files, ~2.15M lines

Structure

Part Content
Analysis Framework MDP/POMDP formalization, "time-scale × managed-object" taxonomy
Claude Code Deep Dive 6 dimensions: context (6-layer compression), memory (Sonnet prefetch), tools (YOLO classifier), skills (path-trigger), sub-agents (3-path + Coordinator), app state (34-line store)
OpenClaw Deep Dive 6 dimensions: context (5-layer retry), memory (Memory Flush), tools (7-layer policy pipeline), skills (ClawHub), sub-agents (session tree + steer), session state (atomic JSON)
Comparison Side-by-side analysis across all 6 dimensions, industry consensus, design philosophy

Quick Start

pip install mkdocs-material pymdown-extensions
mkdocs serve            # http://127.0.0.1:8000

License

MIT · zhenliang

About

A source-level deep dive into how Claude Code and OpenClaw manage agent state.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors