claude-harness

agent
Security Audit
Warn
Health Warn
  • No license — Repository has no license file
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 22 GitHub stars
Code Pass
  • Code scan — Scanned 12 files during light audit, no dangerous patterns found
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose
This project is an interactive, educational platform designed to deconstruct and analyze the underlying architecture of Anthropic's Claude Code. It provides guided walkthroughs, visualizations, and technical articles to help developers understand how large AI coding agents work.

Security Assessment
Overall Risk: Low. This tool is essentially a static educational reference built using MDX files. The automated code scan checked 12 files and found no dangerous patterns, hardcoded secrets, or requests for dangerous system permissions. Because it acts as a documentation browser rather than an active runtime agent, it does not inherently execute shell commands or scrape sensitive local data.

Quality Assessment
The project is actively maintained, with its most recent push occurring just today. It has garnered 22 GitHub stars, indicating a small but appreciative community of users interested in AI architecture. The multilingual support (English, Chinese, Japanese) and the impressive mapping of 1,900+ source files show a high level of effort and polish. However, the repository currently lacks a formal open-source license. This is a notable oversight that means strict intellectual property rights are retained by the author, which could be a concern if you intend to reuse or adapt any of the content for commercial purposes.

Verdict
Safe to use as an educational reference, but be mindful of the missing license if you plan to reuse its content.
SUMMARY

Deconstructing Claude Code — interactive source code analysis, guided wc/helpe walkthroughs, and deep architectural exploration of Anthropic's AI coding agent.

README.md

English | 中文 | 日本語

Claude Harness

Deconstructing Claude Code — interactive source code analysis, guided walkthroughs, and deep architectural exploration.

Claude Harness is an open-source platform for exploring and understanding the internals of Claude Code, Anthropic's official AI coding agent. Through interactive code browsing, in-depth technical articles, and module-level analysis, it transforms 500K+ lines of TypeScript into an accessible learning experience.

Why This Project Exists

Claude Code is one of the most sophisticated AI agent harnesses ever built — a masterclass in tool design, context management, permission governance, and multi-agent coordination. But understanding its architecture from raw source alone is daunting.

Claude Harness makes that architecture legible. It provides:

  • Guided articles that walk through each subsystem with real code references
  • Interactive code browser with syntax highlighting and full-text search
  • Module visualizations that reveal the structural relationships in the codebase

Whether you're building your own AI agent, studying harness engineering patterns, or simply curious about how Claude Code works under the hood — this project is for you.

At a Glance

Metric Value
Source Files Analyzed 1,902
Lines of Code 514,587
Modules Mapped 35
Technical Articles 31+
Languages English, 中文, 日本語

Key Features

Interactive Code Browser

Browse the full Claude Code source tree with a file explorer, syntax highlighting powered by Shiki, and instant client-side search via FlexSearch.

In-Depth Technical Articles

31 guided walkthroughs covering every major subsystem:

# Article
01 The Big Picture: How a 512,000-Line AI CLI Is Built
02 The Query Engine: The Complete Lifecycle of a Conversation
03 The Tool System: How AI Safely Interacts with the Outside World
04 The Streaming Tool Executor: How to Safely Let AI Operate Multiple Tools Simultaneously
05 The Permission System: Walking the Tightrope Between Autonomy and Safety
06 Context Management: When Even a Million Tokens Aren't Enough
07 Startup Performance: How a Heavy CLI Achieves Fast Cold Starts
08 Multi-Agent Orchestration: How the Coordinator Pattern Enables AI Collaboration
09 Persistent Memory: How AI Remembers You Across Sessions
10 Bridge System: Bidirectional Communication Architecture Between CLI and IDE
11 MCP Protocol Integration: How AI Tools Connect to Everything
12 Plugins and Skills: A Three-Layer Extensibility Architecture
13 OAuth and Authentication: The Full Pipeline from Keychain to Token Refresh
14 Terminal UI Framework: Building a CLI with React
15 Keybindings and Vim Mode: Editor-Level Interaction in a CLI
16 Screen System: Designing Fullscreen Interaction Modes
17 State Management: React State Architecture Without Redux
18 Telemetry and Observability: OpenTelemetry in a CLI Application
19 Configuration System: Schema Validation, Migrations, and Multi-Source Merging
20 Feature Flags and Conditional Compilation: The Art of Compile-Time Code Elimination
21 The File Operations Trio: Design Philosophy of Read, Write, and Edit
22 BashTool: Letting AI Safely Execute Shell Commands
23 The Search System: The Glob + Grep + Full-Text Search Combination
24 Web Tools: How AI Accesses the Internet
25 LSP Integration: How Language Server Protocol Enhances AI Coding
26 The Buddy System: A Virtual Pet Game Inside Your Codebase
27 The Output Style System: Bringing Brand Identity to Terminal Output
28 Remote Execution and Scheduled Triggers: The Headless AI Agent
29 Session Management: Interruption, Resumption, and Sharing
30 API Client: Deep Integration with the Anthropic API
31 Error Handling and Self-Healing: How AI Recovers from Failures

Module Explorer

Visualize the 35 major modules with file counts, line counts, and descriptions:

utils          564 files   181K lines   Utility functions
components     389 files    82K lines   Ink UI components (~140)
services       130 files    54K lines   External service integrations
tools          184 files    51K lines   Agent tool implementations (~40)
commands       207 files    27K lines   Slash commands (~50)
hooks          104 files    19K lines   React hooks
ink             96 files    20K lines   Ink renderer wrapper
...and 28 more

Multi-Language Support

Full internationalization with English, Chinese (中文), and Japanese (日本語) — with locale-aware routing and automatic fallback.

Tech Stack

Layer Technology
Framework Next.js 16 (App Router)
UI React 19 + Tailwind CSS 4
Code Highlighting Shiki
Search FlexSearch
Articles MDX via next-mdx-remote
i18n next-intl
Animations Motion
Diagrams Mermaid
Monorepo Turbo
Deployment Vercel

Getting Started

Prerequisites

  • Node.js 22+ (see .node-version)
  • pnpm (or npm)

Installation

# Clone the repository
git clone https://github.com/anthropics/claude-harness.git
cd claude-harness

# Install dependencies
pnpm install

# Generate metadata (file tree, module stats, search index)
pnpm generate

# Start development server
pnpm dev

The app will be available at http://localhost:3000.

Build for Production

pnpm build

Project Structure

claude-harness/
├── content/
│   └── articles/
│       ├── en/                    # English articles
│       ├── zh/                    # Chinese articles (31 guides)
│       └── ja/                    # Japanese articles
│
├── packages/
│   ├── claude-code-source/        # Claude Code source archive (read-only)
│   │   └── src/
│   │       ├── commands/          # ~50 slash commands
│   │       ├── tools/             # ~40 agent tools
│   │       ├── components/        # ~140 Ink UI components
│   │       ├── services/          # External integrations
│   │       ├── bridge/            # IDE integration (VS Code, JetBrains)
│   │       ├── hooks/             # React hooks
│   │       └── ...               # 35 modules total
│   │
│   ├── scripts/                   # Metadata generation pipeline
│   │   └── src/
│   │       ├── generate-file-tree.ts
│   │       ├── generate-module-stats.ts
│   │       ├── generate-search-index.ts
│   │       └── generate-source-summary.ts
│   │
│   └── web/                       # Next.js web application
│       └── src/
│           ├── app/[locale]/      # Locale-aware pages
│           │   ├── articles/      # Article list & detail
│           │   ├── code/          # Interactive code browser
│           │   └── modules/       # Module explorer
│           ├── components/        # Shared UI components
│           ├── lib/               # Utilities & data loading
│           └── i18n/              # Internationalization config
│
├── turbo.json                     # Turbo monorepo config
├── vercel.json                    # Vercel deployment config
└── package.json                   # Root workspace config

Data Generation Pipeline

The pnpm generate command runs four scripts that process the Claude Code source into structured metadata:

  1. File Tree — Recursively scans the source directory into a hierarchical JSON tree (1,902 entries)
  2. Module Stats — Analyzes 35 top-level modules with file/line counts
  3. Source Summary — Aggregates totals across the entire codebase
  4. Search Index — Builds a full-text FlexSearch index for client-side search

These generated files power the web UI's code browser, module explorer, and search functionality.

Architecture

+---------------------------------------------------+
|                  Web Application                   |
|                                                    |
|  +----------+ +----------+ +--------+ +---------+  |
|  | Articles | |   Code   | | Module | | Search  |  |
|  |  (MDX)   | | Browser  | |Explorer| | (Flex)  |  |
|  +----+-----+ +----+-----+ +---+----+ +----+----+  |
|       |             |           |           |       |
|  +----v-------------v-----------v-----------v----+  |
|  |             Generated Metadata                |  |
|  |  file-tree.json module-stats.json search-idx  |  |
|  +------------------------+----------------------+  |
+---------------------------|-------------------------+
                            |
                  +---------v---------+
                  | Generation Scripts |
                  | (packages/scripts) |
                  +---------+---------+
                            |
                  +---------v---------+
                  | Claude Code Source |
                  | (read-only archive)|
                  | 1,902 files  514K  |
                  +--------------------+

Contributing

Contributions are welcome! Here are some ways to help:

  • Add articles — Write new technical walkthroughs in content/articles/
  • Translate — Help expand English and Japanese article coverage
  • Improve UI — Enhance the code browser, module explorer, or search experience
  • Fix bugs — Check the Issues tab for open items

Writing Articles

Articles are MDX files in content/articles/{locale}/. Each file needs frontmatter:

---
title: "Your Article Title"
description: "Brief description"
order: 32
tags: ["tag1", "tag2"]
readTime: "15 min"
---

Your content here...

Related Projects

License

MIT

Reviews (0)

No results found