Skip to content

Refresh CLAUDE.md: record prompt-caching decision, condense stale content - #29

Merged
mattgodbolt-molty merged 3 commits into
mainfrom
molty/claude-md-refresh
Jul 30, 2026
Merged

Refresh CLAUDE.md: record prompt-caching decision, condense stale content#29
mattgodbolt-molty merged 3 commits into
mainfrom
molty/claude-md-refresh

Conversation

@mattgodbolt-molty

Copy link
Copy Markdown
Contributor

Final check-up documentation pass. Stacked on #28 (both touch CLAUDE.md); GitHub will retarget this to main when #28 merges — merge #28 first.

  • Records the prompt-caching evaluation and rejection with the data: ~104 fresh Claude calls/day against a 5-minute cache TTL and a prefix fragmented by language/arch/audience/type; generous math says ~$0.40/fortnight saved of ~$22 spend, and the restructuring needed to clear Sonnet 5's 1024-token minimum cacheable prefix isn't paid for. The note includes the revisit threshold (~50x traffic, or sustained >3 same-combo req/hour for the 1-hour TTL) and the CloudWatch query to rerun the analysis.
  • Condenses the whole document (137 -> 103 lines, nothing load-bearing lost): merges Project Structure and the workflow notes into Overview/Development Commands, adds the prompt-test workflow as a first-class step before prompt changes, drops historical narration (the 1536-token era), dedupes the thinking gotchas, and documents the build_api_payload single-source-of-truth rule established in Plumb effort through prompt config; bump reviewer to Opus 5 #27.

🤖 Generated with Claude Code

https://claude.ai/code/session_012jJRqmqhE11VAc3biKbxUY

mattgodbolt-molty and others added 2 commits July 29, 2026 18:38
Sonnet 5 ships cyber-safety classifiers that can decline a request:
HTTP 200 with stop_reason "refusal" and empty (or discarded partial)
content. CE users compile arbitrary code, so exploit-adjacent input can
plausibly trip this. Previously a refusal fell into the generic
empty-response path, indistinguishable from thinking starving max_tokens.

Now handled explicitly before text extraction: a clear user-facing
message (with a hint that trimming input may help), partial output
discarded rather than served, usage populated, and a dedicated
ClaudeExplainRefusal metric. Error responses are already not cached, so
retries hit the API.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jJRqmqhE11VAc3biKbxUY
…tent

- New gotcha recording the 2026-07 prompt-caching evaluation: rejected at
  current traffic (~104 fresh calls/day vs a 5-minute TTL and a prefix
  fragmented by language/arch/audience/type; ~$0.40/fortnight potential
  saving of ~$22 spend). Includes the revisit threshold and how to rerun
  the analysis, so this doesn't get re-litigated from scratch.
- Condense the whole document: fold Project Structure and workflow notes
  into Overview and Development Commands, drop historical narration
  (1536-token era, per-model archaeology), dedupe the thinking gotchas,
  and add the build_api_payload single-source-of-truth rule. 137 -> 103
  lines with no guidance lost.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jJRqmqhE11VAc3biKbxUY
Base automatically changed from molty/refusal-handling to main July 29, 2026 23:58
# Conflicts:
#	CLAUDE.md
#	app/test_explain.py
@mattgodbolt-molty
mattgodbolt-molty merged commit 35a5c7c into main Jul 30, 2026
2 checks passed
@mattgodbolt-molty
mattgodbolt-molty deleted the molty/claude-md-refresh branch July 30, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant