awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
lintsinghua avatar

lintsinghua/claude-code-book

0
View on GitHub↗
lintsinghua.github.io↗

Claude Code Book

This repository is a long-form technical book about how a production AI coding agent runtime, often called an agent harness, is built. It dissects a real-world coding agent's architecture chapter by chapter and turns it into transferable lessons, and it also works as a step-by-step guide to designing and building your own harness around a language model. Python scripts in the repository support the book itself rather than the agent.

The book's core subject is the machinery around the model: a streaming conversation loop that repeats tool calls until the model returns plain text, a tool protocol whose safe defaults fail closed, and a staged permission pipeline in which deny rules always win. It then covers the topics that set a full harness apart from a simple API call. These include progressive context compression with a circuit breaker, long-term memory limited to a closed set of categories, layered configuration that excludes untrusted project settings, and forked sub-agents that share a cached prompt prefix. Coordinator-and-worker orchestration is covered alongside them.

Further chapters cover extension through lifecycle hooks, skills, plugins and external tool servers connected over the Model Context Protocol. They also cover plan-first workflows, scheduling and remote triggers, shell and file tool references, streaming and startup performance, and security boundaries such as enterprise policy controls and trust levels for skills.

For navigation, the book offers a guided reading path with suggested routes for different readers. Appendices provide a source-tree map, a complete tool inventory, a feature flag reference and a bilingual glossary. Helper scripts check the Markdown chapters and validate the embedded Mermaid diagrams, and others generate the cover and a star-history chart.

Features

  • Agent Harnesses - Teaches how the runtime harness around a language model fits together, from autocomplete assistants to autonomous coding agents, with design principles and a mental model.
  • Long-term Memory Stores - Covers persistent agent memory with closed categories, an index file for recall, and a store-only-non-derivable rule that carries knowledge across sessions.
  • Agent Conversation Loops - Run the main loop as an async generator that streams events, supports cancellation, and applies backpressure between the producer and the user interface consumer.
  • Agentic Loop Design - Explains designing the core conversation loop as an async generator that emits events, handles termination reasons and injects dependencies for testing.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI
4,359 stars·847 forks·Python·2 views
  • Agentic Execution Loops - Details the streaming async-generator conversation loop that repeats tool calls until the model returns plain text, including termination reasons.
  • Subagent Architectures - Explains forking isolated subagents and delegating work to built-in explore and plan agents, with scheduled triggers for background tasks.
  • Context Compression - Applies progressively stronger context compression levels, from trimming to summarization and collapse, guarded by a circuit breaker to keep long conversations within limits.
  • Context Window Management - Teaches computing the effective context window and applying staged compression guarded by a circuit breaker to keep long agent sessions within model limits.
  • Automatic Context Compaction - Escalates from light trimming and micro-compaction to summarization and full context collapse, guarded by a circuit breaker, to keep long conversations within the window.
  • Multi-Agent Orchestration - Explains how coordinator-worker architectures and forked sub-agents inherit context and split work into parallel sub-tasks.
  • Tool-Calling Agent Loops - Implements a streaming generator loop that repeats model calls and tool execution until the model returns plain text, with cancellation support.
  • Agent Source Code Reports - Dissects a real coding agent's source chapter by chapter, with source maps, tool inventories, feature flag references and glossaries.
  • AI Agent Architecture Study Guides - Dissects a large real-world coding agent chapter by chapter, covering its loop, permissions, compression, and sub-agent scheduling as a study guide.
  • Agent Tool Permissions - Describes a staged permission pipeline across permission modes that gates every agent tool call, with deny rules always winning.
  • Tool Call Permission Pipelines - Routes every tool call through schema validation, rule matching, hooks, classifiers and user confirmation, where deny rules always override allows and early rejection halts execution.
  • Hybrid Short-and-Long Term Memory - Covers index-backed long-term memory combined with multi-level context compression and a circuit breaker for keeping long agent sessions within limits.
  • Closed Category Taxonomies - Limits long-term memory to a closed set of types such as user, feedback, project, and reference, saving only information that cannot be derived.
  • Sub-Agent Task Delegation - Spawns forked child agents that share the parent's cached prompt prefix, run in isolated state, and return results to a coordinator, with recursive forking blocked.
  • Agent Lifecycle Hooks - Describes lifecycle events across sessions, tool calls and sub-agents where hooks attach to extend agent behavior.
  • Agent Skill Integrations - Covers adding agent abilities through lifecycle hooks, skills, plugins, layered configuration, and external tool servers over a standard protocol.
  • Agent Tool Systems - Teaches a common tool protocol with a fail-closed factory, tool categories, and concurrent execution of safe tools.
  • Agent Capability Extensions - Explains how hooks, skills, plugins and an external tool protocol let developers extend an agent without changing its core.
  • Agent Skill Frameworks - Covers defining skills through frontmatter files, tiered argument substitution, layered loading and plugin caching to add reusable agent capabilities.
  • Agent Tooling - Explains how agents are given tools to read, write and act on their environment, and how tools are defined, selected and invoked.
  • Agent Tooling Protocols - Covers exposing capabilities as tools through a common protocol, including safe factory defaults and concurrent execution partitioning.
  • Session Context Managers - Explains progressive context compression, token budgeting and cross-session memory that keep long agent conversations coherent within model limits.
  • Multi-Agent Orchestration Patterns - Covers the coordinator-and-worker pattern where one agent delegates tasks to parallel workers and merges their results into one outcome.
  • Parent Agent Sub-Agent Delegation - Covers spawning child agents that inherit the parent's exact prompt bytes so they share a cached prefix and cut input token cost.
  • Parallel Tool Execution - Runs read-only tools concurrently while side-effecting tools run serialized, with unknown tools defaulting to the unsafe, fail-closed classification.
  • Context Compaction Comparisons - Orders compression approaches from micro compaction through auto compaction and history snipping to full context collapse, showing escalating intensity and trade-offs.
  • Context Memory Management - Explains how persistent cross-session memory and progressive context compression with token budgeting keep an agent effective across long conversations.
  • MCP Protocol Integrations - Explains connecting external services over the Model Context Protocol, including connection types, a five-state lifecycle, structured tool naming, and a two-way bridge.
  • Fail-Closed Tool Factories - Creates tools through a factory with fail-closed defaults for concurrency and read-only flags, so simple tools need few lines while complex ones override everything.
  • Context Summarizations - Applies tiered strategies such as trimming old messages and summarizing history to keep long conversations within the token limit while preserving key information.
  • Multi-Agent Orchestrators - Describes coordinator-worker orchestration and forked sub-agents that run in parallel, share a cached prompt prefix and merge results.
  • Agent Response Streams - Covers streaming model output and tool progress incrementally so users see results sooner and long sessions stay responsive.
  • Prompt Cache Optimizations - Explains keeping system prompts byte-stable and append-only so API prompt caches keep hitting and token costs fall.
  • Forked Agent Prefix Sharing - Builds forked and background agent requests from the parent's identical prefix so cached prompts are reused and input token costs drop.
  • Subagent Orchestrations - Covers how subagents inherit context through forking, how a coordinator delegates to workers, and how skills, plugins and bridges extend an agent.
  • Coordinator-Worker Orchestration - Teaches a coordinator-and-worker architecture where a central agent delegates tasks to parallel workers, gathers results, and combines them into one outcome.
  • Tool Server Merging - Connects external tool servers, merges their namespaced tools into the agent's registry with built-ins taking precedence, and reconnects on disconnect.
  • Autonomous Coding Agents - Breaks down an autonomous coding agent's architecture, including streaming loops, tool protocols, layered configuration, memory and sub-agent delegation.
  • Agent Event Hooks - Describes lifecycle events across sessions, tool calls, subagents, compaction, and permissions where hooks attach to run custom commands.
  • MCP Client and Server Implementations - Layers agent extension through built-in tools, skills, lifecycle hooks, plugins and external protocol servers whose tools are namespaced by server and discovered at runtime.
  • Agent Security Auditing - Covers defenses against prompt injection, tool misuse, runaway spending and malicious hooks using safety flags, trust checks, sanitization and budget caps.
  • AI Agent Permissions - Explains how layered permission checks and configuration guard an autonomous agent's actions, including defenses against supply chain attacks.
  • Tool Permission Controllers - Covers layered tool permission handling: filtering tool visibility, validating input, deciding allow, deny or ask by mode and risk, and applying runtime limits.
  • Environment-Agnostic Agent Cores - Injects I/O dependencies through adapters so the same agent loop runs unchanged in terminal, IDE, SDK, and server settings, and tests can substitute fakes.
  • Agent Skill Extenders - Describes reusable skills and plugins that extend an agent's abilities through a modular system loading new capabilities on demand.
  • Priority-Based Configuration Merging - Merges settings from enterprise policy, user, project, local and command-line layers with type-aware rules, excluding untrusted project settings from sensitive checks.
  • Agentic Plan-And-Execute Workflows - Separates read-only planning from execution so users review and approve a plan before any file changes are made.
  • Read-Only Planning Sessions - Describes switching a session into a read-only planning mode that saves the prior mode and guides the agent to explore and design without editing.
  • Tool Schema Validation - Defines each tool through a typed input schema so validation, permissions, and model-facing descriptions all derive from one declaration with fail-closed defaults.
  • Agent Lifecycle Hooks - Runs external shell commands at lifecycle points such as before or after a tool call, letting hooks approve, block or modify actions.
  • Tutorials and Educational Resources - Architectural teardown of coding agent harnesses.
  • Star history

    Star history chart for lintsinghua/claude-code-bookStar history chart for lintsinghua/claude-code-book

    How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

    Frequently asked questions

    What does lintsinghua/claude-code-book do?

    This repository is a long-form technical book about how a production AI coding agent runtime, often called an agent harness, is built. It dissects a real-world coding agent's architecture chapter by chapter and turns it into transferable lessons, and it also works as a step-by-step guide to designing and building your own harness around a language model. Python scripts in the repository support the book itself rather than the agent.

    What are the main features of lintsinghua/claude-code-book?

    The main features of lintsinghua/claude-code-book are: Agent Harnesses, Long-term Memory Stores, Agent Conversation Loops, Agentic Loop Design, Agentic Execution Loops, Subagent Architectures, Context Compression, Context Window Management.

    Which projects share features with lintsinghua/claude-code-book?

    Projects with overlapping indexed features include: liuup/claude-code-analysis — This repository is a static analysis of the Claude Code terminal coding assistant, based on a reading of its… ombharatiya/ai-system-design-guide — This is a written reference for designing, building and operating production AI systems, aimed at engineers who work… letta-ai/letta — Letta is a framework for building, deploying, and managing autonomous AI agents that maintain persistent state across… paullarionov/claude-certified-architect — This repository is a study resource for the Claude Certified Architect Foundations exam. It brings together a written… claude-code-best/claude-code — Claude Code is a command-line interface and multi-agent orchestration framework designed for autonomous software… tvytlx/ai-agent-deep-dive — ai-agent-deep-dive is a study guide for how LLM-based AI agents are designed. It combines written PDF reports that…

    Projects sharing features with Claude Code Book

    These projects share indexed features with Claude Code Book. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
    • liuup/claude-code-analysisliuup avatar

      liuup/claude-code-analysis

      4,069View on GitHub↗

      This repository is a static analysis of the Claude Code terminal coding assistant, based on a reading of its TypeScript source. It documents how the agent is built, from its startup path and a single shared execution core to the streaming tool-call loop, sub-agents, and terminal interface layers. It is a reference and study resource about the agent rather than the agent itself. The analysis centers on a few areas. One is the shared core that routes queries, sub-agents, tools, and permission checks through the same control flow. Another is memory: layered, file-based records that users can ins

      TypeScript
      View on GitHub↗4,069
    • ombharatiya/ai-system-design-guideombharatiya avatar

      ombharatiya/ai-system-design-guide

      4,200View on GitHub↗

      This is a written reference for designing, building and operating production AI systems, aimed at engineers who work with large language models. It is organized as chapters, worked case studies and interview-preparation material rather than as installable software. The central topics are tool-using LLM agents, retrieval-augmented generation, cost and model selection, evaluation and observability, and security and compliance, with explicit trade-offs among latency, cost, accuracy and safety. The agent material covers control loops such as ReAct and plan-and-execute, graph-based orchestration,

      agentic-aiagentic-workflowai
      View on GitHub↗4,200
    • letta-ai/lettaletta-ai avatar

      letta-ai/letta

      25,380View on GitHub↗

      Letta is a framework for building, deploying, and managing autonomous AI agents that maintain persistent state across long-term interactions. It provides a comprehensive suite of primitives for defining agents with configurable personas, modular memory blocks, and tool-use capabilities, enabling them to retain user preferences and conversation history over extended sessions. The platform distinguishes itself through its advanced memory management and orchestration capabilities. It allows agents to autonomously update their own memory, perform retrieval-augmented generation, and coordinate com

      aiai-agentsllm
      View on GitHub↗25,380
    • paullarionov/claude-certified-architectpaullarionov avatar

      paullarionov/claude-certified-architect

      5,197View on GitHub↗

      This repository is a study resource for the Claude Certified Architect Foundations exam. It brings together a written study guide, scenario-based practice questions, and Anki flashcard decks. The guide explains the exam format, the 100–1000 scoring scale with a passing score of 720, and the five weighted domains. It also covers realistic scenarios such as customer support agents, multi-agent research, code review pipelines, and structured data extraction. The curriculum covers designing tool-using agents. It explains how to build an agent loop driven by the model's stop reason, and how to coo

      HTML
      View on GitHub↗5,197
    Compare all 30 related projects→