惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

SecWiki News
SecWiki News
I
InfoQ
The Cloudflare Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
T
Tailwind CSS Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
量子位
博客园_首页
罗磊的独立博客
V
V2EX
李成银的技术随笔
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
True Tiger Recordings
Vercel News
Vercel News
Cyberwarzone
Cyberwarzone
Cisco Talos Blog
Cisco Talos Blog
F
Fox-IT International blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
M
Microsoft Research Blog - Microsoft Research
Know Your Adversary
Know Your Adversary
爱范儿
爱范儿
The Register - Security
The Register - Security
G
Google Developers Blog
The Hacker News
The Hacker News
Malwarebytes
Malwarebytes
S
Securelist
博客园 - 三生石上(FineUI控件)
Jina AI
Jina AI
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
S
SegmentFault 最新的问题
博客园 - 叶小钗
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
宝玉的分享
宝玉的分享
博客园 - 聂微东
T
Threatpost
博客园 - 【当耐特】
D
Docker
P
Privacy & Cybersecurity Law Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
V
Visual Studio Blog
C
Cisco Blogs
IT之家
IT之家
S
Security Archives - TechRepublic
Latest news
Latest news
阮一峰的网络日志
阮一峰的网络日志

Hacker News - Newest: "AI"

The Inevitability: Why AI Cannot Be Stopped, Slowed, or Resisted WebBridge - Let Kimi Agent Drive Your Browser | Kimi GitHub - SkepticCTO/decoding_the_language_machine: Documentation, Prompts, and Media for the "Decoding the Language Machine" series Block open-sourced Goose, an AI agent that scaled to 60% of the company Beyond Recall: Behavioral Specification as an Interpretive Layer for AI Personalization GitHub - compuficial/apery: Synthetic Data Generator for Agents Will AI cause a job apocalypse? 3 AIs Answer Why AI Agents Should Be State Machines Show HN: I built a tool to estimate AI agent costs before you ship GitHub - aws-samples/sample-well-architected-skills-and-steering: Reusable skills and steering that teach AI coding agents how to apply the AWS Well-Architected Framework. One set of playbooks, 12 supported tools. BurnKit – Stop being the human event loop for your AI coding sessions Release BoquilaHUB 0.5 · boquila/boquilahub Neo-Capital — Local-first bookkeeping GitHub - microsoft/agent-governance-toolkit: AI Agent Governance Toolkit — Policy enforcement, zero-trust identity, execution sandboxing, and reliability engineering for autonomous AI agents. Covers 10/10 OWASP Agentic Top 10. Vendorlobby — Vendor pitches, on autopilot AiAffList — The Biggest AI Affiliate Programs List Sam Altman: I was wrong, AI unlikely to lead to jobs apocalypse Typerion: The coherence system for software development AI speeds up discovery of next-gen computer chips and electronic materials Daily links from Cory Doctorow Microsoft and Uber Are Running into an AI Cost Problem GitHub - JustVugg/judicex: Open-source Legal AI workspace for evidence-grounded legal drafting, matter analysis and verifiable answers. Uber president says AI spending is getting ‘harder to justify’ The state of AI voice assistants is bad but there's a clear winner A reality check on the AI jobs hysteria OpenClaw for Sales: How AI Agents are Revolutionizing Revenue Teams | Kickscale AI overly affirms users asking for personal advice ING的“Vibe Coding”人工智能正在构建其新的交易系统 Improving Local Techdocs for Your AI Coding Agent | Philip Heltweg Do I have AI Psychosis? AI Agent Token Cost Calculator - TinyOps Studio Show HN: Presentforme.ai – Make slide decks explain themselves The first class of AI natives is graduating Client Challenge Analyst - Data Analysis Platform Joi AI is hiring masturbation consultants to test "Daily Guided Masturbation" GitHub - rednakta/nilbox: Desktop sandbox for AI agents and MCP servers — with Zero Token Architecture so your API keys never touch the agent. The terrifying rise of schoolboys making AI girlfriends Enhance or Eliminate? How AI Will Likely Change These Jobs GitHub - patchen0518/AgentBrew: The MCP that centralized all MCP, skills and tools. Spotify chief defends AI-generated music Show HN: AgentToolBench-Code – security benchmark for AI coding agents GitHub - argustek/Argus: Desktop AI coding assistant that never gets stuck – multi‑agent collaboration with automatic recovery. Amazon Agrees To Settle $20.5M Class Action Lawsuit Over AI Data Center Pollution In Eastern Oregon Crypto code commits fall 75% as developers move to AI projects Cited AI Workspace: No More Re-Uploading Files Free SEO Competitor Analyzer | Fox AI Audio to Video Converter AI Online Free ContextVault – Local-First AI Conversation Recorder for ChatGPT, Claude, Gemini Wyoming Company Uses High-Tech AI Sprinklers To Save Homes From Wildfire Notes on Pope Leo XIV’s encyclical on AI The Evolution of AI-Assisted Software Engineering Paradigms: From Statistical Completion to Agentic Loop 这些人工智能专家每天向华尔街银行收取25,000美元 GitHub - ClickHouse/nerve I Made 6 Frontier AIs Take the MBTI 600 Times. They All Came Back INTJ. Pope Leo XIV urges AI regulation for the common good | AP News Pope Leo says AI could warp humanity AI deskilling is a structural problem Show HN: Unsiloed AI – #1 on OlmOCR-Bench,Beats Reducto, LlamaParse and GPT-5.5 Show HN: AI skills for program / project / delivery managers Citing Gandalf, Pope Leo says we must "disarm" AI Show HN: Built a tool to create brand-consistent images using AI Bae — the AI companion who actually knows you An AI safety safe harbor [pdf] concerning law enforcement exemptions in the draft AI act transparency guidelines How to tame AI's voracious appetite for energy – Knowable Magazine Ask HN: Are we in the 'Goldilocks era' of AI capabilities? We tested 6 AI assistants on the same solar data. The results surprised us Free AI APIs – Build Anything with Pollinations The IPO wave will enshrine the AI gods' control over the future Insane AI Breakthroughs with Demis Hassabis [video] Pope Leo says AI must be 'disarmed' in first major teaching Cognitive Security as an AI Safety Cause Area — LessWrong Color palette gives away AI slop AI is turning Engineers into Farmers, Doctors and Gardeners · aswinmohan.me Bursting my AI bubble Your AI Evaluation Is Biased — By Design This big university system is embracing AI. Students and faculty aren't all on board AI Datacenters Were Built for GPUs — Almartis An AI Interface for Research Papers Agentic AI Changes the CPU/GPU Equation Deconstructing Cognitive Overload: Deep Self-Understanding Ubers COO says its getting harder to justify the money spent on AI tokenmaxxing GitHub - bitomule/musts: The validation loop that stops AI coding agents from claiming work is done before it actually is. CoworkGuard — Runtime Visibility for AI Tools Is AI flattening your team’s creativity? Here’s how to tell. Feynman - AI research assistant SynapCores — the AI-native database Using AI to write better code more slowly The Open/Closed Problem in AI GitHub - Noumenon-ai/AutoMaxFix: Controlled AI repair loop. Audit → Reproduce → Patch → Test → Report. Safety boundaries most AI agents skip. Show HN: Hackobar – One feed for AI news GitHub - agentpatterns-ai/website: Website content for agentpatterns.ai Torvalds Tightens Linux Kernel Rules to Reject Deluge of Low-Value AI Fixes Anthropic's Olah says AI must be guided from outside Big Tech How to get your team past the AI coding plateau The Stepford AI PhoneDiffusion App - App Store Pope Leo calls for being ‘profoundly human’ in the age of AI Anthropic Billionaire Cofounder Joins Pope Leo, Warns AI Job Losses Will Spark "Moral Imperative Of Historic Proportions"
GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps
2026-04-11 · via Hacker News - Newest: "AI"

Architecture, Patterns & Internals of Anthropic's AI Coding Agent


This repository is purely educational. It contains no source code from Claude Code — not a single line. Every code block is original pseudocode written to illustrate architectural patterns. The goal is to help engineers understand how production AI agents are built, not to reproduce or redistribute proprietary software.


When Anthropic shipped Claude Code on npm, the .js.map source maps contained a sourcesContent field with the full original TypeScript. This book is the result of studying that architecture and distilling the patterns, trade-offs, and design decisions into a technical narrative that any engineer can learn from.

18 chapters across 7 parts. ~400 pages in print equivalent.

Every chapter has layered depth: a narrative flow for technical leaders, deep-dive sections for implementers, and an "Apply This" closing that extracts transferable patterns you can steal for your own systems. Diagrams use Mermaid and render natively on GitHub.


Who This Is For

  • Senior engineers building agentic systems — steal the patterns, understand the trade-offs, implement in your own stack
  • Technical leaders evaluating architectures — follow the narrative without reading every code block
  • Anyone curious about how production AI tools actually work under the hood

Table of Contents

Part I: Foundations

Before the agent can think, the process must exist.

# Chapter What You'll Learn
1 The Architecture of an AI Agent The 6 key abstractions, data flow, permission system, build system
2 Starting Fast — The Bootstrap Pipeline 5-phase init, module-level I/O parallelism, trust boundary
3 State — The Two-Tier Architecture Bootstrap singleton, AppState store, sticky latches, cost tracking
4 Talking to Claude — The API Layer Multi-provider client, prompt cache, streaming, error recovery

Part II: The Core Loop

The heartbeat of the agent: stream, act, observe, repeat.

# Chapter What You'll Learn
5 The Agent Loop query.ts deep dive, 4-layer compression, error recovery, token budgets
6 Tools — From Definition to Execution Tool interface, 14-step pipeline, permission system
7 Concurrent Tool Execution Partition algorithm, streaming executor, speculative execution

Part III: Multi-Agent Orchestration

One agent is powerful. Many agents working together are transformative.

# Chapter What You'll Learn
8 Spawning Sub-Agents AgentTool, 15-step runAgent lifecycle, built-in agent types
9 Fork Agents and the Prompt Cache Byte-identical prefix trick, cache sharing, cost optimization
10 Tasks, Coordination, and Swarms Task state machine, coordinator mode, swarm messaging

Part IV: Persistence and Intelligence

An agent without memory makes the same mistakes forever.

# Chapter What You'll Learn
11 Memory — Learning Across Conversations File-based memory, 4-type taxonomy, LLM recall, staleness
12 Extensibility — Skills and Hooks Two-phase skill loading, lifecycle hooks, snapshot security

Part V: The Interface

Everything the user sees passes through this layer.

# Chapter What You'll Learn
13 The Terminal UI Custom Ink fork, rendering pipeline, double-buffer, pools
14 Input and Interaction Key parsing, keybindings, chord support, vim mode

Part VI: Connectivity

The agent reaches beyond localhost.

# Chapter What You'll Learn
15 MCP — The Universal Tool Protocol 8 transports, OAuth for MCP, tool wrapping
16 Remote Control and Cloud Execution Bridge v1/v2, CCR, upstream proxy

Part VII: Performance Engineering

Making it all fast enough that humans don't notice the machinery.

# Chapter What You'll Learn
17 Performance — Every Millisecond and Token Counts Startup, context window, prompt cache, rendering, search
18 Epilogue — What We Learned The 5 architectural bets, what transfers, where agents are heading

The 10 Patterns That Make It Work

If you read nothing else:

  1. AsyncGenerator as agent loop — yields Messages, typed Terminal return, natural backpressure and cancellation
  2. Speculative tool execution — start read-only tools during model streaming, before the response completes
  3. Concurrent-safe batching — partition tools by safety, run reads in parallel, serialize writes
  4. Fork agents for cache sharing — parallel children share byte-identical prompt prefixes, saving ~95% input tokens
  5. 4-layer context compression — snip, microcompact, collapse, autocompact — each lighter than the next
  6. File-based memory with LLM recall — Sonnet side-query selects relevant memories, not keyword matching
  7. Two-phase skill loading — frontmatter only at startup, full content on invocation
  8. Sticky latches for cache stability — once a beta header is sent, never unset mid-session
  9. Slot reservation — 8K default output cap, escalate to 64K on hit (saves context in 99% of requests)
  10. Hook config snapshot — freeze at startup to prevent runtime injection attacks

How This Book Was Made

The source was extracted from npm source maps. 36 AI agents analyzed nearly two thousand TypeScript files in four phases:

  1. Exploration: 6 parallel agents read every file in the source tree
  2. Analysis: 12 agents wrote 494KB of raw technical documentation
  3. Writing: 15 agents rewrote everything from scratch as narrative chapters
  4. Review & Revision: 3 editorial reviewers produced 900 lines of feedback; 3 revision agents applied all fixes

The entire process — from source extraction to final revised book — took approximately 6 hours.


Disclaimer

This repository does not contain any source code from Claude Code. All code blocks are original pseudocode using different variable names, written to illustrate architectural patterns. No proprietary prompt text, internal constants, or exact function implementations are included. This project exists purely for educational purposes — to help engineers understand the design patterns behind production AI coding agents.

The "NO'REILLY" cover is a parody/meme for illustrative purposes only. This project has no affiliation with O'Reilly Media. The crab is just a crab.

This is an independent analysis. Claude Code is a product of Anthropic. This book is not affiliated with, endorsed by, or sponsored by Anthropic.