npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@mariozechner/cchistory

v1.1.11

Published

Extract and compare prompts from different Claude Code versions

Downloads

64

Readme

cchistory

Extract and compare system prompts and tools from different Claude Code versions.

Prerequisites

  • You must be logged in to Claude Code (authentication required for all modes)
  • Claude Code installation is optional if using --binary-path with a custom binary
  • Note: Each version tested will send a single haiku request to Claude, which may incur costs if you're on a pay-per-token plan instead of Claude Max

Installation

npm install -g @mariozechner/cchistory

Usage

cchistory [version] [--latest] [--binary-path <path>] [--claude-args "<args>"]

Options

  • version - NPM version of Claude Code to extract (e.g., 1.0.0)
  • --latest - Extract all versions from the specified version to the latest published version
  • --binary-path <path> - Use a custom/local Claude Code binary instead of downloading from npm
  • --claude-args "<args>" - Pass additional arguments to Claude Code during execution
  • --version, -v - Show cchistory version
  • --help, -h - Show help message

Examples

# Extract prompts from a single version
cchistory 1.0.0

# Extract prompts from version 1.0.0 to latest
cchistory 1.0.0 --latest

# Test a custom/local build of Claude Code
cchistory --binary-path /path/to/custom/cli.js

# Test with additional Claude Code arguments
cchistory 1.0.0 --claude-args "--mcp-config /path/to/config.json"

# Combine custom binary with custom arguments
cchistory --binary-path ./build/cli.js --claude-args "--verbose"

# Pass system prompt modifiers to any version
cchistory 1.5.0 --claude-args "--append-system-prompt"

How it works

Standard Mode (NPM versions)

  1. Downloads the specified Claude Code version from npm
  2. Patches the version check to prevent auto-updates
  3. Runs the patched version with claude-trace to intercept API requests
  4. Sends a single test haiku request to trigger an API call
  5. Extracts the system prompt, user message format, and available tools from the intercepted request
  6. Saves the results to prompts-{version}.md

Custom Binary Mode (--binary-path)

  1. Uses the specified binary directly (skips download and patching)
  2. Runs it with claude-trace to intercept API requests
  3. Sends a single test haiku request to trigger an API call
  4. Extracts the system prompt, user message format, and available tools from the intercepted request
  5. Saves the results to prompts-custom-{timestamp}.md

Existing prompt files are automatically skipped to avoid redundant downloads and API calls.

Output Format

Each prompts-{version}.md file contains:

  • User Message: The format of user messages sent to Claude
  • System Prompt: The system instructions Claude receives
  • Tools: Available tools with their descriptions and input schemas (excluding MCP tools)

Advanced Usage

Testing Local/Development Builds

The --binary-path flag is particularly useful for:

  • Testing local modifications to Claude Code before publishing
  • Comparing development builds against released versions
  • Debugging prompt or tool changes in your fork
# Test your local development build
cchistory --binary-path /path/to/your/fork/cli.js

# Compare with a released version
cchistory 1.0.0
# Now you have both prompts-1.0.0.md and prompts-custom-*.md to compare

Passing Arguments to Claude Code

The --claude-args flag allows you to test Claude Code with different configurations:

# Test with MCP server configuration
cchistory 1.5.0 --claude-args "--mcp-config ~/.config/claude/mcp.json"

# Test with verbose logging
cchistory --binary-path ./build/cli.js --claude-args "--verbose"

# Combine multiple flags
cchistory 1.0.0 --claude-args "--debug --no-cache"

Note: Arguments are parsed safely using shell-quote to prevent command injection. Shell operators and control characters are filtered out.

Debugging

Enable debug output to see detailed information about the extraction process:

DEBUG=1 cchistory 1.0.0

This will show:

  • All API requests found in the claude-trace log
  • Model names and tool counts for each request
  • Full stack traces for any errors

Security Notes

  • All shell commands use proper escaping via the shell-quote library
  • The --claude-args parameter filters out shell operators for safety
  • Version patching only modifies the version check function (no other code changes)
  • Custom binaries are executed directly without modification