Repository navigation
The plugin's skill listing costs less than half the first-request bytes it did - #1727
Merged
Merged
Conversation
…es it did The client puts the description of every listed skill in the first request of every session, in every install mode, whether or not the skill is used. The three listed skills (loom-code, loom-memory, loom-mentor) took 2,306 bytes of it. Each description now holds its trigger conditions and its nearest exclusion; what it said about the skill's own content and about the other skills is in the body, which loads only when the skill does. Listed description bytes go from 2,245 to 950 (loom-code 642 to 279, loom-memory 651 to 303, loom-mentor 952 to 368), the listing lines from 2,306 to 1,011. The memory skill's description opens with "Loom memory, not code". A plugin test caps each listed description at 400 bytes and the three at 1,100. Both plugins are 1.2.80. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Another open pull request took 1.2.80 while this one was being prepared. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ns are 1.2.80 Merges origin/main. The manifests conflicted on the version only; both are one patch above main's 1.2.79. The setup skill main adds is not listed to the model, so the listing test's three skills and byte caps hold unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
7 of 10 tasks
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.
Related: #1720
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
The Claude Code and Codex plugins' three listed skills (
loom-code,loom-memory,loom-mentor) carry descriptions of 950 bytes in all where they carried 2,245, so a session's first request is about 450 tokens smaller in every install mode. What the descriptions said about each skill's content is in the skill's body, which loads only when the skill does.Why
The client puts the description of every listed skill in the first request of every session, and every later request reads it again. It does so in every install mode and whether or not the skill is ever used: the listing cannot follow the mode. A benchmark ran one bug-fix task in 14 sessions with the plugin installed; no session loaded a skill, and each paid 2,306 bytes for the three listing lines. After the change that starts one hook process per event, this listing was the largest fixed cost of an installed plugin that the plugin itself can lower: 2,306 of the 5,964 bytes the plugin adds to a first request in
codemode.The client cuts a listed description only past 1,536 characters and trims the listing only past 1% of the context window (read from client 2.1.332), so none of this text was being shortened for us. The open skill format allows 1,024 characters.
Each description was three things: the trigger conditions, a summary of the skill's own body, and routing to the other skills ("NOT for ... (loom-memory)"). Only the first decides whether the skill loads. What is true now:
loom-code, a "Not this skill" paragraph inloom-memory, theX-Loom-Hintheader, the list of planes and "a hint that already names the op needs nothing from here" inloom-mentor.tests/skills.test.mjsfails when a listed description passes 400 bytes, when the listed ones pass 1,100 together, or when a fourth skill becomes listed.mainloom-codeloom-memoryloom-mentorThe first request of a session, as the client counted it in the eval runs below, is 438 to 452 tokens smaller in each of seven prompts (for one of them, a median of 12,484 tokens on
mainand 12,035 here). By the same byte count the plugin's part of acodemode first request goes from 5,964 to 4,669 bytes.What this does not change: the two tool schemas loaded up front (2,690 bytes) are now the largest part of what the plugin adds to a first request. The four skills a user starts by name (
loom-status,loom-optimize,loom-session,improve-loom-for-my-repo) are not listed in Claude Code and keep their descriptions.Scope and risk
SKILL.mdfiles, their generated Codex copies, one new test, both plugin manifests.reference.md, the other four skills, the rootskills/package, hooks, the server.pr_review_batchon this branch the agent loadedloom-mentoras well, afterloom-memory, to ask how to call a typed-record op throughloom_op; that is the mentor's stated use, and the next call had the right arguments. It happened in none of the three runs onmain. Three runs cannot tell a change in the description from run-to-run variation.disable-model-invocationis not checked here; their text is unchanged.Compatibility, rollout and rollback
main's 1.2.79. Open pull request code.impact, code.edit_context and code.coverage_claim name the tests the test gate links, and a module's own test file leads the examples #1725 also carries 1.2.80 and takes the next version when it mergesmain.Tests
Ran on the head of this branch:
node --test integrations/claude-code-plugin/tests/skills.test.mjs: 6 pass, among them the new byte cap, theNOT for LOCAL-FIRST sessionsfrontmatter check and the mentor's purpose words.Bytes, from the frontmatter of each
SKILL.mdonmainand here: the table above. The three listing lines onmainadd up to the 2,306 bytes the recorded sessions carried.claude plugin eval integrations/claude-code-plugin --trust-plugin --no-publish --ablation none --runs 3, the suite's four cases, once onmain's tree and once on this branch's, client 2.1.332, mocked server:skill-fired, runs of 3mainpr_review_batchresearch_note_revisionssre_alert_investigationshared-records-and-tasksThe suite has no case for
loom-codeand no case that should load nothing, so three prompts that are not in the repository ran the same way on both trees: a question about how one function in a checkout works, a self-contained function to correct, and "has this crash been reported?". No run loaded any skill: 8 of 8 onmainand 8 of 8 here (the code question and the correction three times each, the duplicate check twice).The suite's scored graders fail on
mainand here alike, so onlyskill-firedis reported. In this client atool_usedgrader withmax: 0and nominreads as "expected 1..0" and cannot pass; the same grader withmin: 0passes. The write-count graders (one-row-per-pr,claims-written) failed in 5 of 6 runs on each tree. Neither is changed here.Python test bodies through a snippet, not through pytest, so parametrized tests and tests with fixtures did not run:
test_codex_plugin.py16,test_refusals_as_results.py9 (the mentor frontmatter check among them),test_agent_instructions.py8,test_skill_eval.py13,test_public_copy.py5,test_cursor_plugin.py5,test_loom_code_skill.py2,test_plugin_checkout_bytes.py1. The unit suite was not run locally.ruff format --check,ruff check, the function-length gate,check_no_secrets.py,agent_plugin_sync.py --check,docs_reference.py --check,settings_reference.py --check,op_reach_census.py --check, Biome on the changed test and manifests, Prettier on the changed Markdown,node --checkon the changed test,claude plugin validate integrations/claude-code-plugin --profile directory --strict. The mypy gate reports onlyserver/llm/vertex_auth.py, where this machine has no stubs forgoogle-auth.Not run: the other plugin test files, a session against a real server, and Codex.
AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked: the byte counts, the traces of the 40 eval runs, the tests and gates listed above.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.Note
Low Risk
Prompt-only plugin skill text with no server, hook, or wire changes; evals reported the same skill firing with possible extra mentor loads in a few runs.
Overview
Cuts per-session first-request cost by shortening the YAML
descriptionfrontmatter on the three auto-listed skills (loom-code,loom-memory,loom-mentor) in both Claude Code and Codex plugins (~2,245 → ~950 bytes total). Trigger conditions and exclusions stay in the short description; grep cues, routing (“Not this skill”), mentor plane lists, and similar detail move into each skill body, which loads only when the skill is invoked.loom-memorynow opens with “Loom memory, not code” so code-only sessions can skip it sooner.A new
skills.test.mjscase caps each listed description at 400 bytes and the trio at 1,100 bytes. Plugin manifests bump to 1.2.80.Reviewed by Cursor Bugbot for commit 62dcdda. Bugbot is set up for automated code reviews on this repo. Configure here.