Skip to main content
skill CX Codex

claude-code-source-study — Claude Code skill: agent architecture deep

A 25-article breakdown of Claude's source: system prompt, tools, agents and permissions. Useful if you are building your own agent.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add reason-machines/trending-skills --skill claude-code-source-study -a claude-code
Open on GitHub

What claude-code-source-study does

The skill gives you a 25-article series that walks through Claude's roughly 1900-file source, module by module. Each piece points at exact files, line numbers and code snippets, and pulls out patterns you can reuse in your own agent.

The stack under the microscope is Bun, TypeScript, Ink (React for terminals) and the Anthropic API. Topics include segmented system prompt construction with cache boundaries, an AsyncGenerator conversation loop, the tool system built around buildTool(), multi-agent orchestration, MCP, hooks, permissions and context auto-compact against a token budget.

The articles are written in Chinese, and that is the catch: if you cannot read Chinese, the file references and TypeScript snippets will only get you so far. Three reading routes are offered — a 7-article quick pass, a 9-article AI engineering route and the full 25. For a general picture of the architecture, the quick route is enough.

What it helps with

  • understand how an agent conversation loop works internally
  • design a tool system with conditional registration
  • build a system prompt in cacheable segments
  • figure out multi-agent orchestration patterns
  • walk through a layered permission decision pipeline

Example prompts for the agent

  • show me the reading route for building an agent from claude-code-source-study
  • explain the buildTool pattern from the tool system article
  • how does Claude auto-compact context against a token budget

How to install claude-code-source-study

1Skills CLI (Vercel)

npx skills add reason-machines/trending-skills --skill claude-code-source-study -a claude-code

2Manually: put the files in place

~/.claude/skills/claude-code-source-study/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/claude-code-source-study/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about claude-code-source-study

How do I install claude-code-source-study in Claude?

Run npx skills add reason-machines/trending-skills --skill claude-code-source-study -a claude-code. The skill file then lands at ~/.claude/skills/claude-code-source-study/SKILL.md.

What does claude-code-source-study do?

It is a 25-article series dissecting Claude's source code by module. Each article extracts reusable patterns for building your own agent: system prompt, tools, agents, permissions and MCP.

What language are the articles in?

Chinese. The breakdowns include file references, line numbers and TypeScript snippets, but the article text itself is in Chinese.

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set42

kordoc-korean-document-parser This skill turns Korean HWP 5.x, HWPX and PDF files into Markdown and structured blocks. Useful when you need text, tables or form fields out of a document. CX Codex +1 774installs see-through-anime-layer-decomposition Splits a single anime illustration into semantic layers and exports a layered PSD with depth maps for 2.5D animation. CX Codex +1 759installs open-multi-agent-orchestration A skill that teaches your agent to build AI agent teams on the open-multi-agent TypeScript framework: roles, models, task dependencies. CX Codex +1 710installs omnivoice-tts A skill for OmniVoice: clone a voice from a sample, generate speech from a text description, or run batch synthesis from Python and CLI. CX Codex +1 680installs cabinet-ai-knowledge-base This skill sets up Cabinet, a self-hosted knowledge base and startup OS with markdown pages, agents that keep memory, cron jobs and embedded HTML apps. CX Codex +1 607installs x-mentor-skill-nuwa A skill that turns six creators' methods and open-source algorithm data into concrete advice on hooks, threads and account growth. CX Codex +1 594installs bluehammer-vulnerability-poc A skill that walks the agent through the BlueHammer repo: building the C exploit, running it, and reading the vulnerability code. For isolated labs only. CX Codex +1 570installs 3dsvg-interactive-react Turns SVGs and text into interactive 3D React components with the 3dsvg library. Useful for a dimensional logo or hero badge. CX Codex +1 529installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor