Discover and explore top open-source AI tools and projects—updated daily.
cnighswongerClaude Code cache fix proxy and module
Top 77.9% on SourcePulse
This project addresses significant cost increases and performance regressions in Anthropic's Claude Code, particularly on resumed sessions, by acting as a transparent HTTP proxy or Node.js interceptor. It targets power users and developers seeking to optimize API usage and maintain stable, cost-effective interactions with Claude Code. The primary benefit is a substantial reduction in API costs through improved prompt cache hit rates and prevention of silent quota burn.
How It Works
The core approach involves a local HTTP proxy (or a Node.js --import module for older versions) that sits between Claude Code and the Anthropic API. This proxy applies a pipeline of hot-reloadable extensions to requests and responses. Key extensions normalize request structures by stabilizing tool ordering, stripping unstable version fingerprints, managing Time-To-Live (TTL) markers, and normalizing identity fields. This mechanism directly combats cache-busting bugs without altering Claude Code's core functionality, offering enhanced observability into session costs and behavior.
Quick Start & Requirements
npm install -g claude-code-cache-fixnode "$(npm root -g)/claude-code-cache-fix/proxy/server.mjs" &ANTHROPIC_BASE_URL=http://127.0.0.1:9801 claudedocker run -d --name cache-fix-proxy --restart=always -p 9801:9801 ghcr.io/cnighswonger/claude-code-cache-fix:latestHighlighted Details
/api/claude_cli/bootstrap, GrowthBook flags) with audit, block, and allowlist modes.CACHE_FIX_IMAGE_KEEP_LAST and CACHE_FIX_IMAGE_MAX_DIM mitigate costs associated with image data in conversations.~/.claude/quota-status/ for monitoring quota, TTL, and cache performance.Maintenance & Community
The project lists numerous contributors, including key figures like @cnighswonger, @ArkNill, @bilby91, and @fgrosswig, indicating active community involvement. Production usage is noted by Crunchloop DAP and VM Farms. Community interaction primarily occurs through GitHub issues and discussions.
Licensing & Compatibility
HTTPS_PROXY, NO_PROXY, CACHE_FIX_PROXY_CA_FILE).Limitations & Caveats
The proxy requires a running process before Claude Code initialization; running it as a service is recommended. It cannot prevent server-side TTL downgrades triggered by quota overage, though it aims to reduce the likelihood of overage. Microcompact degradation is monitored but not preventable. The system prompt rewrite feature is experimental and preload-only. Major Claude Code refactors may necessitate package updates.
5 days ago
Inactive
BerriAI
zilliztech