This repository contains a comprehensive extraction and analysis of Claude Code's system prompt, along with detailed explanations of inferred key subsystems and tools, and an architectural analysis using a prompting technique we call "Induced Introspection", which systematically prompts the system to articulate its own "self-image" through structured dialogue. This allows us to document how Claude Code functions as an agentic system for software engineering tasks.
- About
- Purpose
- Repository Structure
- Methodology
- Architecture Overview
- Key Architectural Components
- Subsystems Integration
- Documentation Contents
Rather than reverse engineering from external artifacts, we guided Claude Code to reflect upon and document how it conceptualizes its own internal mechanisms. This approach offers unique insights into how agentic LLM-based systems represent their own operational models.
Note: This documentation represents Claude Code's self-conceptualization, not a definitive description of the actual implementation.
This repository serves as a reference for:
- Understanding Claude's capabilities and limitations
- Learning about Claude Code's available tools
- Improving Claude interactions by aligning with its parameters
- Academic research on LLM agent frameworks
- Studying agentic LLM system design principles
- Exploring patterns for building similar systems
claude-code-docs/
├── docs/
│ ├── architecture/ # High-level architectural analysis
│ ├── subsystems/ # Detailed subsystem explanations
│ └── system-prompt/ # Raw system prompt files
├── METHODOLOGY.md # Induced Introspection technique details
└── README.md # This file
The complete methodology is detailed in METHODOLOGY.md.
Claude Code implements a multi-layered system:
- Central Reasoning Engine: Claude LLM for interpreting requests and decision-making
- Tool Orchestration Layer: Manages specialized tool interactions
- Hierarchical Delegation System: Assigns complex subtasks to sub-agents
- Persistent State Management: Maintains state across interactions
- Structured Workflows: Formalizes procedures for common operations
The system follows a TOSPO (Thought, Observation, Selection, Planning, Operation) execution loop with safety mechanisms and clear design principles.
- Task Planning: Todo system for planning multi-step operations
- Search and Discovery: Glob and Grep tools locate relevant files and content
- Code Understanding: Read tools provide context for modifications
- Precise Modification: Edit tools enable careful code changes
- Execution: Bash tools run commands, tests, and builds
- Version Control: Git workflows manage code systematically
- External Knowledge: Web tools access documentation and information
docs/system-prompt/claude_code_core_instructions.txt
: The main system prompt governing Claude's behaviordocs/system-prompt/claude_code_tool_schemas.txt
: JSONSchema definitions for all available tools
docs/subsystems/todo_system_explanation.md
: Task tracking systemdocs/subsystems/batch_system_explanation.md
: Parallel tool executiondocs/subsystems/task_agent_explanation.md
: Agent-based delegationdocs/subsystems/search_tools_explanation.md
: Glob and Grep toolsdocs/subsystems/edit_tools_explanation.md
: Code manipulation toolsdocs/subsystems/bash_tool_explanation.md
: Command execution systemdocs/subsystems/git_workflow_explanation.md
: Git operations workflowsdocs/subsystems/web_tools_explanation.md
: External knowledge access
docs/architecture/claude_code_architecture.md
: Comprehensive architectural analysisdocs/architecture/claude_code_architecture.dot
: GraphViz DOT source filedocs/architecture/claude_code_architecture.png
: Visual architecture representation