singhcoder/claude-code

Claude Code Snapshot for Research. All original source code is the property of Anthropic.

14 stars Python 10 components 9 connections

Python rewrite of Claude Code agent harness with archived subsystem references

Commands flow through argument parsing to query engines that route against archived reference data, producing manifest summaries and parity audits.

Under the hood, the system uses 4 data pools, 3 control points to manage its runtime behavior.

Structural Verdict

A 10-component ml inference with 9 connections. 55 files analyzed. Well-connected — clear data flow between components.

How Data Flows Through the System

Commands flow through argument parsing to query engines that route against archived reference data, producing manifest summaries and parity audits.

  1. Parse CLI args — argparse processes subcommands and arguments from user input
  2. Load reference data — JSON snapshots of commands and tools are loaded with caching
  3. Build manifest — Scan Python workspace to create current state summary (config: src_root, total_python_files)
  4. Route queries — Match user prompts against archived command/tool inventories with scoring
  5. Generate output — Render markdown summaries, audit reports, or query results

System Behavior

How the system actually operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

Command Snapshot Cache (in-memory)
LRU-cached command metadata loaded from JSON snapshots
Tool Snapshot Cache (in-memory)
LRU-cached tool metadata loaded from JSON snapshots
Reference Data Store (file-store)
JSON files containing archived subsystem and command/tool metadata
Cost Event Log (in-memory)
List accumulating resource usage events during operations

Delays & Async Processing

Control Points

Technology Stack

Python 3.13+ (framework)
Primary runtime and development language
argparse (library)
CLI argument parsing and subcommand routing
dataclasses (library)
Type-safe data models and configuration structures
functools.lru_cache (library)
Performance optimization for JSON snapshot loading
pathlib (library)
Modern path handling and filesystem operations
unittest (testing)
Test framework for the porting workspace
JSON (library)
Reference data storage format for archived snapshots

Key Components

Configuration

src/context.py (python-dataclass)

src/cost_tracker.py (python-dataclass)

src/dialogLaunchers.py (python-dataclass)

src/history.py (python-dataclass)

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Related Ml Inference Repositories

Frequently Asked Questions

What is claude-code used for?

Python rewrite of Claude Code agent harness with archived subsystem references singhcoder/claude-code is a 10-component ml inference written in Python. Well-connected — clear data flow between components. The codebase contains 55 files.

How is claude-code architected?

claude-code is organized into 4 architecture layers: CLI Interface, Core Porting Engine, Reference Data Layer, Placeholder Packages. Well-connected — clear data flow between components. This layered structure enables tight integration between components.

How does data flow through claude-code?

Data moves through 5 stages: Parse CLI args → Load reference data → Build manifest → Route queries → Generate output. Commands flow through argument parsing to query engines that route against archived reference data, producing manifest summaries and parity audits. This pipeline design reflects a complex multi-stage processing system.

What technologies does claude-code use?

The core stack includes Python 3.13+ (Primary runtime and development language), argparse (CLI argument parsing and subcommand routing), dataclasses (Type-safe data models and configuration structures), functools.lru_cache (Performance optimization for JSON snapshot loading), pathlib (Modern path handling and filesystem operations), unittest (Test framework for the porting workspace), and 1 more. A focused set of dependencies that keeps the build manageable.

What system dynamics does claude-code have?

claude-code exhibits 4 data pools (Command Snapshot Cache, Tool Snapshot Cache), 3 control points, 2 delays. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does claude-code use?

4 design patterns detected: Placeholder Package Pattern, Snapshot Loading Pattern, Dataclass Models, CLI Subcommand Pattern.

Analyzed on April 1, 2026 by CodeSea. Written by .