claude-code-reverse  by Yuyz0112

Reverse engineer LLM agent interactions

created 5 months ago
955 stars

Top 38.6% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides tools and analysis for reverse-engineering Claude Code's LLM interactions, targeting developers and researchers interested in understanding its architecture and agent workflows. It offers a visualization tool to explore API request/response logs, enabling detailed study of Claude Code's behavior across various task scenarios.

How It Works

The v2 approach focuses on runtime behavior and API data, achieved by monkey-patching the beta.messages.create method within Claude Code's bundled Anthropic TS SDK. This modification intercepts and logs all LLM API requests and responses. A companion log parsing and visualization tool (parser.js and visualize.html) then processes these logs to reconstruct and display conversational flows, highlighting common prompts and tool definitions.

Quick Start & Requirements

  • Installation: Requires locating and modifying the cli.js file of an existing Claude Code installation.
  • Prerequisites: js-beautify for code formatting, Node.js environment for Claude Code.
  • Setup: Involves modifying a single file and running Claude Code to generate logs.
  • Demo: Interactive visualization available at https://yuyz0112.github.io/claude-code-reverse/visualize.html.

Highlighted Details

  • Detailed analysis of Claude Code's internal processes including quota checks, topic detection, core agent workflow, context compaction, IDE integration, short-term memory management via Todo tool, task/sub-agent workflows, and conversation summarization.
  • Prompts and tool definitions used by Claude Code are provided in prompts/ and tools/ directories.
  • Analysis indicates usage of Haiku 3.5 and Sonnet 4 models for different tasks.

Maintenance & Community

The project appears to be a personal effort by Yuyz0112, with no explicit mention of a broader community, ongoing maintenance schedule, or partnerships.

Licensing & Compatibility

The README does not specify a license. The project's nature involves reverse-engineering proprietary software, which may have legal implications depending on Anthropic's terms of service.

Limitations & Caveats

This method relies on modifying installed files of Claude Code, which could be brittle against updates. The project is presented as an experimental analysis tool rather than a robust reverse-engineering framework.

Health Check
Last commit

2 weeks ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
4
Star History
608 stars in the last 30 days

Explore Similar Projects

Starred by Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic) and Adam Wolff Adam Wolff(Claude Code Core; MTS at Anthropic).

claude-code-sdk-python by anthropics

3.4%
829
SDK for Claude Code interaction
created 2 months ago
updated 3 days ago
Feedback? Help us improve.