security-review's 5-minute cache TTL expires between every invocation (82.2% hit vs 97% fleet) #173
Labels
No labels
already-shipped
bug
documentation
duplicate
enhancement
external-review
good first issue
help wanted
in progress
invalid
needs-decision
proposal
question
security
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: crenshawdev/cadence-archived#173
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Traced from the 3.x cache figures. The decline is one surface, not a fleet-wide drift.
/security-reviewruns onclaude-opus-4-7atxhigh: 61 invocations in the 3.x era, each a fresh ~2-minute process reviewing one commit's diff. 12.57M writes against 58.2M reads, 82.2% hit, versus 96-98% everywhere else. Cost ~$138, of which $78.57 is pure cache-write.Excluding it, the 3.x fleet sits at 97.0%.
The mechanism. Every subagent and one-shot write uses the 5-minute TTL (100% of them; only the main session gets 1h). Security-review invocations are a median 27 minutes apart, and zero of the 60 gaps fall under 5 minutes. The shared system+tools prefix expires before the next invocation, every single time.
Two exits: raise that surface to a 1h TTL (2x write, but converts the next cold write into a 0.1x read), or batch the reviews so consecutive invocations land inside the window.
Not reachable from config. Both the TTL selection and the model pin are compiled into the
claudebinary (~/.local/share/claude/versions/2.1.233): the TTL is chosen at the call site (ae==="1h"?3600000:300000) andclaude-opus-4-7is pinned in the skill's own definition. Nothing insettings.jsonreaches either, so this is an upstream ask rather than a local fix.Ruled out: subagent turns are 98.8% under one minute apart, with only 0.2M tokens of writes following a >5m gap. The 5-minute TTL is not expiring mid-dispatch, it only bites across the short-session boundary.
Closing: not actionable here. The 5-minute/1-hour TTL selection is compiled into the claude binary and no settings key reaches it. #174 gets the same result by running the reviews close enough together that the prefix is still warm.