Skip to content

The plugin's skill listing costs less than half the first-request bytes it did - #1727

Merged
zlareb1 merged 3 commits into
mainfrom
fix/plugin-skill-descriptions-shorter
Nov 28, 2026
Merged

zlareb1 merged 3 commits into
mainfrom
fix/plugin-skill-descriptions-shorter

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Related: #1720

Changelog category (leave one):

  • Performance Improvement

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 code mode.

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:

  • A description holds its trigger conditions and its nearest exclusion. The summary and the routing moved into the body where the body did not already say them: the "let me grep for that" cue and the unindexed-repository sign in loom-code, a "Not this skill" paragraph in loom-memory, the X-Loom-Hint header, the list of planes and "a hint that already names the op needs nothing from here" in loom-mentor.
  • The memory skill says it is for memory first. Its description opens with "Loom memory, not code", so a session that only works on code has the reason to skip it in the first four words.
  • A test holds the budget. tests/skills.test.mjs fails when a listed description passes 400 bytes, when the listed ones pass 1,100 together, or when a fourth skill becomes listed.
Listed description, bytes main this branch
loom-code 642 279
loom-memory 651 303
loom-mentor 952 368
Total 2,245 950
The three listing lines 2,306 1,011

The 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 main and 12,035 here). By the same byte count the plugin's part of a code mode 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

  • Touches: the frontmatter and the first paragraphs of three SKILL.md files, their generated Codex copies, one new test, both plugin manifests.
  • Leaves alone: every reference.md, the other four skills, the root skills/ package, hooks, the server.
  • A skill could load less often, or where it should not. That is what the eval below measures: the expected skill loaded in 12 of 12 runs before and after, and no skill loaded in 8 of 8 runs of three prompts that should load none, before and after.
  • One difference in the eval. In two of the three runs of pr_review_batch on this branch the agent loaded loom-mentor as well, after loom-memory, to ask how to call a typed-record op through loom_op; that is the mentor's stated use, and the next call had the right arguments. It happened in none of the three runs on main. Three runs cannot tell a change in the description from run-to-run variation.
  • Codex: the copies are generated and carry the same text. Whether Codex lists the four skills marked disable-model-invocation is not checked here; their text is unchanged.
  • Each of the three files is 112 to 295 bytes smaller, since less moved into each body than left its description; all three stay under their size caps.

Compatibility, rollout and rollback

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, the NOT for LOCAL-FIRST sessions frontmatter check and the mentor's purpose words.

  • Bytes, from the frontmatter of each SKILL.md on main and here: the table above. The three listing lines on main add 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 on main's tree and once on this branch's, client 2.1.332, mocked server:

    skill-fired, runs of 3 main this branch
    pr_review_batch 3 3
    research_note_revisions 3 3
    sre_alert_investigation 3 3
    shared-records-and-tasks 3 3
    Runs that loaded another skill 0 2

    The suite has no case for loom-code and 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 on main and 8 of 8 here (the code question and the correction three times each, the duplicate check twice).

  • The suite's scored graders fail on main and here alike, so only skill-fired is reported. In this client a tool_used grader with max: 0 and no min reads as "expected 1..0" and cannot pass; the same grader with min: 0 passes. 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.py 16, test_refusals_as_results.py 9 (the mentor frontmatter check among them), test_agent_instructions.py 8, test_skill_eval.py 13, test_public_copy.py 5, test_cursor_plugin.py 5, test_loom_code_skill.py 2, test_plugin_checkout_bytes.py 1. 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 --check on the changed test, claude plugin validate integrations/claude-code-plugin --profile directory --strict. The mypy gate reports only server/llm/vertex_auth.py, where this machine has no stubs for google-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

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/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).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

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 description frontmatter 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-memory now opens with “Loom memory, not code” so code-only sessions can skip it sooner.

A new skills.test.mjs case 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.

…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>
@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Nov 28, 2026 11:20pm UTC
loom-telemetry Ready Ready Preview Nov 28, 2026 11:20pm UTC

Request Review

zlareb1 and others added 2 commits November 29, 2026 03:25
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>
@zlareb1
zlareb1 merged commit d1c9ce0 into main Nov 28, 2026
74 of 78 checks passed
@zlareb1
zlareb1 deleted the fix/plugin-skill-descriptions-shorter branch November 28, 2026 23:21
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