claude-code-reverse  by Yuyz0112

Reverse engineer LLM agent interactions

Created 10 months ago
1,907 stars

Top 22.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

4 months ago

Responsiveness

Inactive

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

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Yaowei Zheng Yaowei Zheng(Author of LLaMA-Factory), and
5 more.

trae-agent by bytedance

0.7%
10k
LLM-powered CLI for software engineering tasks
Created 7 months ago
Updated 3 months ago
Feedback? Help us improve.