plugin: pin the npx version to the release; ship a usage skill - #10
Merged
Conversation
added 3 commits
August 5, 2026 10:31
The plugin launched the MCP server with an unpinned spec (npx -y @infino-ai/code-context mcp). npx prefers an already-installed copy over the registry, so any machine with a stale global install silently ran the old server - plugin users never received auto-index on first query or anything shipped since their global was installed. Pin the exact published version so the plugin release decides what runs. A new test keeps package.json, the plugin manifest, and the .mcp.json pin in lockstep, and the release steps in CONTRIBUTING.md now name all three files. The unpinned npx command in README/context7 install docs is left as-is: manual 'claude mcp add' users manage their own version.
Claude Code sessions increasingly defer MCP tool schemas and load them on demand (ToolSearch). The server's instructions cover the tools once loaded, but nothing teaches the model when to reach for code-context over grep, how to write index SQL against the search table functions, or that a first query auto-builds the index - and nothing at all loads when the tools are still deferred. Ship skills/code-context/SKILL.md with the plugin (auto-discovered, no manifest registration). The description is written for model-triggered invocation on repo-spanning questions; the body covers tool choice, search/sql usage with the canonical rank-and-aggregate query, the zero-touch index lifecycle (auto-index on first query, auto-sync, per-root indexes for git worktrees), multi-repo targeting, and cost awareness around first-index/backfill work.
Until c712051 (0.1.1) the npm package's cx install wrote a usage skill into the user's .claude/skills/; dropping the installer in favor of the plugin also dropped that guidance. The skill added on this branch independently re-covered most of it - fold in what it had that this one lacked: answer from returned chunk content before opening files, and put identifiers plus intent into one search rather than several narrow ones.
Audited the skill against the server's actual tool registrations and closed the gaps: the partial-index marker (missing match != absent code), the usage receipt contract (surface the line verbatim), path is an absolute repo root, and k's max of 50.
ashishmishra26
approved these changes
Aug 5, 2026
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.
Problem
The Claude Code plugin launches the MCP server with an unpinned spec:
npxprefers an already-installed copy over the registry, so any machinewith a stale global install silently runs that old server regardless of
what the plugin ships. Observed in practice: a box with a global 0.1.0
kept returning the strict "no index yet — call the reindex tool once"
error even though 0.1.4 (auto-index on first query,
src/mcp/ensure.ts)had been out for days. The first-use experience the release shipped never
reached the user, with no visible signal that anything was stale.
Change
.mcp.json(
@infino-ai/code-context@0.1.4) so the plugin release decides whatruns. An exact pin also resolves from the npx cache, unlike
@latestwhich re-checks the registry on every server start.
test/plugin.test.ts: keepspackage.json, the plugin manifest(
.claude-plugin/plugin.json), and the.mcp.jsonpin in lockstep, soa release can't forget to move the pin.
CONTRIBUTING.mdto name all three files.Left as-is deliberately: the unpinned
npxcommand in the README /context7 install docs — manual
claude mcp addusers manage their ownversion; the plugin is the surface we version.
Also: ship a skill with the plugin
Until c712051 (0.1.1),
cx installwrote a usage skill into the user's.claude/skills/; dropping the installer in favor of the plugin alsodropped that guidance — the plugin registers only the MCP server. This
restores it, updated for 0.1.4 behavior.
Claude Code sessions increasingly defer MCP tool schemas and load them on
demand. The server's instructions only reach the model once its tools are
loaded, and they don't teach tool choice. New
skills/code-context/SKILL.md(auto-discovered — no manifest registrationneeded) covers: loading the tools when deferred, search-vs-sql-vs-grep
choice, index SQL against the search table functions, the zero-touch index
lifecycle (auto-index on first query, auto-sync, per-root worktree
indexes), multi-repo
pathtargeting, and cost awareness aroundfirst-index/backfill.
Testing
npm run buildclean;npm test92/92 passing (12 files), including thetwo new lockstep guards.