motiful

A/B test proving Claude Code's billing header breaks cross-session prompt cache sharing. One env var fix saves ~85% on system prompt tokens.

11
1
100% credibility
Found Apr 02, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Shell
AI Summary

This repository provides a one-line fix and an A/B test script to disable a dynamic billing header in Claude Code that breaks prompt cache sharing across sessions, significantly reducing API costs.

How It Works

1
🧐 Notice higher AI costs

You realize your AI coding sessions are getting more expensive lately because prompts aren't reusing shared memory well.

2
📖 Find this helpful guide

You come across a simple guide explaining why this happens and how to fix it with a quick test.

3
Apply the easy fix

You add one short line to your computer's settings to let sessions share memory smoothly.

4
🧪 Run the comparison test

You launch a quick check that runs a few example questions twice—once with the old way and once with the fix.

5
📊 See the big difference

The results show most sessions now reuse almost everything, slashing costs by about 85%.

🎉 Save money and time

Your AI helper now works faster and cheaper across all your coding projects without any hassle.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 11 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is cc-cache-audit?

This Shell script runs a straightforward A/B test on the Claude Code CLI, comparing prompt cache hits with the default billing header enabled versus disabled via one env var. It proves the header's dynamic hash breaks cross-session cache sharing, forcing ~12K system prompt tokens to rebuild each time and spiking costs. Users get raw metrics, a generated report, and an instant 85% token savings fix for new sessions.

Why is it gaining traction?

In a sea of A/B testing frameworks on GitHub, this A/B test GitHub project stands out for zero setup: just chmod and run to audit your own Claude Code billing and cache behavior. Developers hook on the quantifiable proof—99% hit ratios post-fix—and the non-disruptive toggle that other tools like claude-code-router already ship. It's a punchy A/B testing tool for AI costs, not marketing fluff.

Who should use this?

Claude Code CLI power users burning through Anthropic tokens on long system prompts in interactive or agent sessions. Devs auditing API bills after v2.1.69 updates, or teams running subagents where cache misses compound. Ideal for those tweaking env vars to optimize prompt caching without rewriting workflows.

Verdict

Run it if you're deep in Claude Code—solid proof with easy repro, despite 11 stars and 1.0% credibility signaling early-stage niche tool. Low maturity means verify locally, but the fix delivers real savings now.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.