A minor release with one feature in coordination with claude-code-meter v0.7.0, two opt-in surfaces (server-side debug logging and a corp-proxy / custom-CA install-service path), one cache bugfix that affects users behind a chained reverse proxy, and tooling cleanup.
Highlights
Recover per-CC-session attribution from usage.jsonl (#210, cross-repo with meter v0.7.0)
Adds optional request_id to MeterRowSchema v:1 rows. Gated default-off via CACHE_FIX_USAGE_LOG_REQID=on. Sourced from the upstream request-id response header.
Why this matters: the existing sid field is sha256(pid + Date.now() + Math.random()) generated once at proxy boot and shared across every CC session the proxy serves. On multi-session hosts, session-level cost questions are structurally unanswerable from the meter view. With request_id on, every row carries a value that CC's per-session JSONL transcripts at ~/.claude/projects/<project>/<session-uuid>.jsonl also record — the post-hoc join recovers per-session attribution.
Requires claude-code-meter >= v0.7.0 to ingest rows carrying the field. v4.1.0 ships the gate default-off so unpatched meter installs don't see breakage. The gate flips default-on in v4.2.0; operators upgrading to v4.2.0 will need meter v0.7.0+.
Opt-in server.mjs debug logging (#190, @nisqatsi)
CACHE_FIX_DEBUG=1 activates a per-request trace log at ~/.claude/cache-fix-debug.log (override path via CACHE_FIX_DEBUG_LOG). Header redaction is mandatory at the capture site: Authorization, x-api-key, cookie, set-cookie, proxy-authorization never appear in the log. Dispatcher catches async handler rejections so promise rejections from preForward() or pipeline hooks no longer escape to unhandledRejection. 500 fallback body is generic — no error.message echo.
install-service threads auth options to systemd / launchd (#189, @nisqatsi)
CACHE_FIX_PROXY_CA_FILE and CACHE_FIX_PROXY_REJECT_UNAUTHORIZED now ride into the rendered systemd unit and launchd plist. Corp-proxy and custom-CA setups survive install-service round-trips on both platforms. The systemd Environment= value escape is hardened against % (specifier expansion) and \ (C-string unescape); the launchd plist escape handles all five XML entities.
Fix: preserve base-path in upstream URL forming (#188, @nisqatsi)
Configurations that chain cache-fix-proxy through another reverse proxy that mounts the Anthropic API under a path prefix (e.g., https://corp.example/api/anthropic/v1/messages) now forward correctly. Previously the proxy concatenated only the upstream host with the inbound path, dropping the base-path component.
tools/cache_analysis.py reference helper (#138)
Closes meter#22 part 1. Now version-controlled in this repo and shipped via the existing tools/ package.json entry. The host-installed copy at ~/.claude/mcp/cache_analysis.py had been silently returning None for 15 days post-v3.5.0 because the local helper lacked the new path-fallback.
Documentation
- Scrubbed the npm token location, org name, and rotation cadence from
docs/release-workflow.md(#208). The combination was a public-repo information-hygiene issue per CLAUDE.md. - README freshen for v4.0.0: version callout, extension-count language, Docker tag ladder, bootstrap-defense framing (#209).
Contributors
@nisqatsi — three PRs this release (#188, #189, #190). Thank you for the upstream-URL fix, the install-service auth threading + escape hardening, and the server.mjs debug logging.
Upgrade
npm install -g claude-code-cache-fix@4.1.0
systemctl --user restart cache-fix-proxy # Linux
launchctl kickstart gui/\$(id -u)/com.cnighswonger.cache-fix-proxy # macOSNo daemon-reload or plist reinstall required for the code-only upgrade. Existing services continue to work; the new features and gates are opt-in.