v2.2.0 — MCP query tools, CLAUDE.md inject, CI drift check
Added
MCP query tools
search_exports— find an export by name, signature, or JSDoc substring. Returnsfile:linelocations so your agent jumps straight to a definition instead of pulling the whole snapshot.get_file_context— compact contract block (signatures, line numbers, JSDoc) for a single file. Much cheaper thanget_contextwhen the agent already knows the file.
--inject[=<file>]
Writes the snapshot between <!-- contextsnap:start/end --> markers in CLAUDE.md / AGENTS.md (auto-detected) or any file. Your content outside the markers is never touched; re-runs are idempotent. Every Claude Code / agent session picks the context up automatically — no clipboard, no MCP setup. Composes with --watch. Config key: "inject": true | "<file>".
--check
CI drift guard: regenerates the snapshot in memory and compares it (generation dates ignored) against the committed .ai-context.md — or the injected block when combined with --inject. Exits 1 on drift, like a lint step:
- run: npx contextsnap src --checkFixed
- MCP scans no longer crash with
ENOENTwhen an auto-detect directory (e.g.src/lib) doesn't exist. - MCP server version now reads from package.json instead of a stale hardcoded string.
🤖 Generated with Claude Code