Generated by Code IQ · v1.0

claudeCode
Knowledge Tutorial

claudeCode is an advanced AI CLI tool designed to act as an autonomous software engineer. It features a robust Query Engine that orchestrates conversation loops, manages state, and executes a diverse suite of tools including file editing, terminal commands, and Computer Use. The system emphasizes safety and control through a granular Permission & Security System (enhanced by an Auto-Mode Classifier), detailed Cost Tracking, and deep Git Integration for context-aware coding assistance.

19
Chapters
35
Subsystems
Rabbit Holes
▶ Start Reading ⎇ View on GitHub
System Architecture

How the pieces fit

claudeCode is organized as connected concepts and components. Start broad, then drill down chapter by chapter.

⚙️
State Management
State Management
⚙️
Ink UI Framework
Ink UI Framework
⚙️
Query Engine
Query Engine
🔧
FileEditTool
FileEditTool
🔧
Git Integration
Git Integration
🔧
BashTool
BashTool
🔧
Shell Safety Checks
Shell Safety Checks
🛡
Permission & Security System
Permission & Security System
🛡
Rule Matching
Rule Matching
⚙️
Auto-Mode Classifier
Auto-Mode Classifier
🔧
NotebookEditTool
NotebookEditTool
🔧
WebSearchTool
WebSearchTool
claudeCode — bash
open tutorial
◆ Scanning numbered chapters
◆ Building navigation and Mermaid diagrams
◆ Generating chapter and subsystem pages
✓ 19 chapter pages built
✓ Theme toggle enabled
Repository Overview

Intro and Architecture Diagram

claudeCode is an advanced AI CLI tool designed to act as an autonomous software engineer. It features a robust Query Engine that orchestrates conversation loops, manages state, and executes a diverse suite of tools including file editing, terminal commands, and Computer Use. The system emphasizes safety and control through a granular Permission & Security System (enhanced by an Auto-Mode Classifier), detailed Cost Tracking, and deep Git Integration for context-aware coding assistance.

flowchart TD A0["Query Engine"] A1["Ink UI Framework"] A2["State Management"] A3["FileEditTool"] A4["NotebookEditTool"] A5["BashTool"] A6["Shell Safety Checks"] A7["WebSearchTool"] A8["Computer Use"] A9["Model Context Protocol (MCP)"] A10["Permission & Security System"] A11["Rule Matching"] A12["Auto-Mode Classifier"] A13["AgentTool"] A14["Teammates"] A15["Unique Features"] A16["Cost Tracking"] A17["Git Integration"] A18["Feature Gating"] A0 -->|"Tracks usage"| A16 A1 -->|"Observes state"| A2 A1 -->|"Displays warnings"| A6 A3 -->|"Verifies permissions"| A10 A3 -->|"Computes diffs"| A17 A4 -->|"Verifies permissions"| A10 A5 -->|"Validates commands"| A6 A7 -->|"Checks availability"| A18 A8 -->|"Requires permission"| A10 A9 -->|"Requires permission"| A10 A10 -->|"Evaluates rules"| A11 A10 -->|"Delegates decisions"| A12 A12 -->|"Runs side queries"| A0 A13 -->|"Initializes servers"| A9 A13 -->|"Spawns sub-agents"| A14 A14 -->|"Registers tasks"| A2 A15 -->|"Utilizes background agents"| A14 A16 -->|"Persists session data"| A2
Tutorial Chapters

All 19 chapters

Follow sequentially or jump to any topic. Start with State Management.

Ch.01 CORE
State Management
Welcome to the claudeCode codebase! If you are new here, you might be wondering: How does the application remember what I just asked it to…
Ch.02 CORE
Ink UI Framework
In the previous State Management chapter, we learned how claudeCode remembers information (like "Fix the bug"). However, data sitting in me…
Ch.03 CORE
Query Engine
In the previous chapters, we built the application's memory in State Management and its face in the Ink UI Framework.
Ch.04 TOOLS
FileEditTool
In the previous Query Engine chapter, we built the "brain" that decides what to do. But a brain without hands cannot build anything.
Ch.05 TOOLS
Git Integration
In the previous FileEditTool chapter, we gave claudeCode the "hands" to modify your code files. But anyone who has written code knows that…
Ch.06 TOOLS
BashTool
In the previous Git Integration chapter, we gave claudeCode the ability to understand the history of your project. It can look around and s…
Ch.07 TOOLS
Shell Safety Checks
In the previous BashTool chapter, we gave claudeCode the ability to run terminal commands. We described this as giving the AI "hands."
Ch.08 SECURITY
Permission & Security System
In the previous Shell Safety Checks chapter, we learned how to detect dangerous commands like rm -rf. But detecting danger is only the firs…
Ch.09 SECURITY
Rule Matching
In the previous Permission & Security System chapter, we built a "Bouncer" that stops the AI from running commands without your approval.
Ch.10 CORE
Auto-Mode Classifier
In the previous Rule Matching chapter, we learned how to create strict permission rules like "Always allow npm test."
Ch.11 TOOLS
NotebookEditTool
In the previous Auto-Mode Classifier chapter, we discussed how the AI decides if an action is safe enough to perform automatically.
Ch.12 TOOLS
WebSearchTool
In the previous NotebookEditTool chapter, we learned how to manipulate local data science files. We gave claudeCode the ability to be a car…
Ch.13 ADVANCED
Feature Gating
In the previous WebSearchTool chapter, we gave claudeCode access to the internet. Before that, in NotebookEditTool, we gave it access to da…
Ch.14 ADVANCED
Model Context Protocol (MCP)
In the previous Feature Gating chapter, we learned how to turn specific features on and off.
Ch.15 TOOLS
AgentTool
In the previous Model Context Protocol (MCP) chapter, we learned how to extend claudeCode by connecting it to external tools and data sourc…
Ch.16 AGENTS
Teammates
In the previous AgentTool chapter, we learned how to spawn "Sub-Agents" to handle complex tasks. However, those sub-agents were blocking. W…
Ch.17 ADVANCED
Unique Features
In the previous Teammates chapter, we learned how to spawn background agents to help us multitask.
Ch.18 ADVANCED
Computer Use
In the previous Unique Features chapter, we explored special modes like "Auto-Dream" and "Ultraplan" that make the AI smarter.
Ch.19 ADVANCED
Cost Tracking
Welcome to the final chapter of our journey!
Subsystem Deep Dives

Beyond the chapters

Each major subsystem has its own folder with granular breakdowns and individual file pages.

🤖
assistant/
Assistant
This project serves as a robust backend utility for managing chat session history. It acts as a…
6 files
📁
bootstrap/
Bootstrap
This project serves as the central nervous system for an AI agent, maintaining a monolithic Glo…
6 files
🌉
bridge/
Bridge
The Bridge project implements a remote control capability that allows the CLI to function as a…
7 files
👥
buddy/
Buddy
The project implements a persistent digital companion that lives in the terminal alongside the…
6 files
💻
cli/
Cli
The project is a robust Command Line Interface (CLI) designed to connect a local terminal envir…
9 files
⌨️
commands/
Commands
This project implements a sophisticated AI coding assistant CLI (Claude Code). It is built upon…
7 files
🖥
components/
Components
This project focuses on the Agent Creation process, providing a user-friendly interface to buil…
2 files
📁
constants/
Constants
The project implements the core logic for Claude Code, an intelligent CLI tool. It centers on a…
7 files
💬
context/
Context
This project provides the foundational React contexts and state management infrastructure for a…
7 files
🎯
coordinator/
Coordinator
This project transforms the AI into a Coordinator, a high-level manager that orchestrates softw…
6 files
📁
entrypoints/
Entrypoints
This project implements Claude Code, an advanced AI agent accessible via a terminal interface.…
7 files
🪝
hooks/
Hooks
This project is a sophisticated terminal-based AI agent framework that orchestrates complex use…
6 files
🖊
ink/
Ink
Ink is a library for building interactive command-line interfaces using React. It mirrors the b…
7 files
📁
keybindings/
Keybindings
This project implements a robust keyboard shortcut system for a terminal-based React applicatio…
7 files
🧠
memdir/
Memdir
This project implements a persistent, file-based memory system that allows an AI assistant to r…
7 files
📁
migrations/
Migrations
This project functions as an automated maintenance system that ensures the application's config…
6 files
📁
moreright/
Moreright
This project functions as a smart extension system for a chat application, acting like an advan…
6 files
📁
native-ts/
Native Ts
This project implements high-performance, native-quality utilities in pure TypeScript, removing…
8 files
📁
outputStyles/
Outputstyles
This system manages Output Styles, which act like "recipes" telling the AI how to format its re…
6 files
🔌
plugins/
Plugins
This project manages built-in plugins that are compiled directly into the application code but…
6 files
⚙️
query/
Query
This project implements a robust execution runtime for an AI agent, designed to manage the life…
5 files
📁
remote/
Remote
This project enables the remote control of an AI agent running in a separate environment (CCR)…
6 files
📐
schemas/
Schemas
This project defines a flexible schema for a reactive hook system that allows an automated agen…
6 files
📁
screens/
Screens
This project builds the interactive terminal screens for an AI assistant application. It featur…
6 files
🖧
server/
Server
This project implements a Direct Connect system to establish and manage real-time communication…
5 files
services/
Services
The services project implements the core cognitive architecture of an AI agent. It manages the…
8 files
🎓
skills/
Skills
This project manages skills, which are custom capabilities or commands (like /loop or /debug) a…
7 files
🗂
state/
State
This project manages the application's data using a Single Source of Truth approach, where the…
6 files
📋
tasks/
Tasks
This project functions as a unified task management system that orchestrates diverse background…
7 files
🔧
tools/
Tools
The tools project implements a comprehensive suite of capabilities for an autonomous AI agent,…
8 files
📝
types/
Types
This project defines the core TypeScript type definitions that structure the Claude Code CLI. I…
7 files
📁
upstreamproxy/
Upstreamproxy
This project establishes a secure local bridge that allows tools running inside an isolated con…
6 files
🛠
utils/
Utils
This project acts as the central nervous system for an AI agent, managing its configuration hie…
7 files
⌨️
vim/
Vim
This project implements a robust Vim emulation engine that processes user keystrokes through a…
7 files
🎤
voice/
Voice
This project manages the activation logic for a Voice Mode feature within an AI application. It…
6 files
About This Project

Generated by Code IQ

This tutorial was automatically generated by Code IQ and rendered with the shared tutorial site builder. It can be produced for any repository tutorial folder that follows the numbered markdown chapter layout.

View Code IQ ↗
python build_site.py '/home/runner/work/Code-IQ/Code-IQ/output/claudeCode'

// → 19 chapters, 35 subsystem folders
// → source: adityasoni99/Code-IQ