claude-code-reverse  by Yuyz0112

Reverse engineer LLM agent interactions

Created 8 months ago
1,642 stars

Top 25.5% 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 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
1
Star History
192 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
20 more.

dify by langgenius

0.5%
118k
Open-source LLM app development platform
Created 2 years ago
Updated 9 hours ago
Feedback? Help us improve.