analysis_claude_code
CLAUDE.md315 starsChanged 16 months agoApache-2.0View on GitHub
This is a research repository containing reverse engineering analysis of Claude Code v1.0.33. The repository focuses on understanding the architecture, mechanisms, and implementation patterns of modern AI Agent systems through systematic analysis of obfuscated source code. Based on the analysis workspace structure, the following commands are commonly used: When working with this repository:
The file
We split this CLAUDE.md into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 85
All technical assertions must have source code location references
- Distinctive: line 107
When working with this repository:
- Very specific: line 109
Analysis Work: - Follow the established SOP in work_doc_for_this/
- Distinctive: line 111
Documentation: - All findings must be properly documented with source references
- Distinctive: line 119
All findings should be considered approximations for educational purposes
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a research repository containing reverse engineering analysis of Claude Code v1.0.33. The repository focuses on understanding the architecture, mechanisms, and implementation patterns of modern AI Agent systems through systematic analysis of obfuscated source code.
Project Structure
Main Analysis Workspace
claude_code_v_1.0.33/stage1_analysis_workspace/- Complete analysis results for v1.0.33chunks/- Deobfuscated code chunks (102 files) split from the main CLI filedocs/- Comprehensive technical documentation and analysis reportsscripts/- Analysis tools and utilities for processing obfuscated code
Key Directories
analysis_results/merged-chunks/- Optimized and merged code blocksdocs/Open-Claude-Code/- Open source reconstruction project templatework_doc_for_this/- Project methodology and standard operating procedures
Common Commands
Based on the analysis workspace structure, the following commands are commonly used:
Code Analysis and Processing
# Beautify and format obfuscated code
node scripts/beautify.js source/cli.mjs
# Split large files into manageable chunks
node scripts/split.js cli.beautify.mjs
# Merge and improve code chunks
node scripts/merge-again.js
# LLM-assisted analysis of code segments
node scripts/llm.jsDevelopment Commands (Open-Claude-Code Project)
# Build TypeScript project
npm run build
# Run tests with coverage
npm run test:coverage
# Performance benchmarking
npm run benchmark
# Code quality checks
npm run lint
npm run validate
# Development mode
npm run devArchitecture Insights
Core Technical Discoveries
- h2A Async Message Queue System - Real-time steering mechanism with dual-buffer architecture
- Multi-layered Agent Architecture - Main agent loop (nO), sub-agents (I2A), and task-specific agents
- Intelligent Context Management - 92% threshold auto-compression with wU2 compressor
- 6-Layer Security Framework - From UI validation to execution sandboxing
Key Components Analyzed
- Agent Loop System - Asynchronous generator-based core scheduler
- Tool Execution Framework - 6-stage pipeline with concurrency control
- Memory Management - Dynamic context compression and token optimization
- Security Framework - Multi-layer permission validation and sandboxing
Analysis Methodology
Static Code Analysis
- Code Preprocessing - Deobfuscation and formatting
- Intelligent Chunking - Breaking large files into analyzable segments
- LLM-Assisted Pattern Recognition - Using AI to identify architectural patterns
- Cross-Validation - Multiple rounds of verification for accuracy
Documentation Standards
- All technical assertions must have source code location references
- Cross-document consistency validation required
- Minimum 95% accuracy threshold for final reports
- Complete lifecycle coverage from UI to execution
Research Focus Areas
- Real-time Message Processing - h2A dual-buffer mechanisms
- Agent Orchestration - Multi-agent coordination patterns
- Context Management - Intelligent compression and memory optimization
- Security Architecture - Layered protection and sandboxing
- Tool Integration - Plugin-based execution framework
Important Files
Claude_Code_Agent系统完整技术解析.md- Complete technical analysisFINAL_VALIDATION_REPORT.md- Comprehensive validation results实时Steering机制完整技术文档.md- Real-time steering mechanism details分层多Agent架构完整技术文档.md- Multi-agent architecture analysis
Development Guidelines
When working with this repository:
- Analysis Work - Follow the established SOP in
work_doc_for_this/ - Code Quality - Maintain high standards for any new analysis scripts
- Documentation - All findings must be properly documented with source references
- Validation - Cross-verify technical claims across multiple documents
- Research Ethics - This is for educational and research purposes only
Notes
- This repository contains research analysis, not production code
- The analysis is based on obfuscated source code with inherent limitations
- All findings should be considered approximations for educational purposes
- The Open-Claude-Code project provides TypeScript implementations based on analysis
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

