Repository navigation
Always-on bytes: tripwire for unmeasured sources, measurement-only (no trim) - #1957
Merged
Merged
Conversation
…o trim) A full plugin install puts 3952 bytes (about 988 tokens) in every session: skill descriptions 3202, command descriptions 409, SessionStart hook 341, and 0 from UserPromptSubmit hooks and agents. That is about 8% of the 12.8k cache-write gap, so the gap comes from the skill body and references loaded at review time. A 15% cut would drop pinned trigger phrases, so no trim ships. The new test fails if a plugin agent/hook or an unmeasured always-on hook appears. It also asserts the plugin default-path files (hooks/hooks.json, .mcp.json) are absent, proves from source that the network hooks print nothing on SessionStart, and parses hook commands with shlex so VAR=... prefixed and unquoted forms work. Tests: 7/7 always_loaded_surface, 6/6 always_loaded_bytes, 23/23 changelog fragments Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR measures the bytes a full plugin install loads into every session, and adds a tripwire so that number cannot grow unnoticed. It changes no shipped text.
The tripwire
scripts/test_always_loaded_surface.pyfails when any of these happens:hooks/hooks.json,.mcp.json) appear;It parses hook commands with shlex, so
VAR=...prefixes and unquoted forms are handled.Review
An independent review pinned to the lane commit
9793aecd8f90a8442abfdd2914175bc61353debefound 🔴0 🟡0 🔵2. Both nits are queued for the next nits PR:os.writeand similar calls;This branch is that commit cherry-picked onto main
31419323d5860b34faa9b39dafe15e632ee34c94.Tests
🤖 Generated with Claude Code