Skip to content

v2.3.0 — token budget, duplicate detector, monorepo hints

Latest

Choose a tag to compare

@myothuko98 myothuko98 released this 05 Jul 07:56

Added

--budget=<tokens> — fit any context window

Trims the least-imported exports until the snapshot fits a token ceiling. Usage ranking only counts imports that actually resolve to the scanned files (with /index fallback) or name a workspace package — import { format } from 'date-fns' can never inflate a local export's rank. --budget also lifts the scan cap from 300 to 5,000 files, since large repos are exactly who needs it. Config key: "budget".

--dupes — find duplication before your AI adds more

Flags likely duplicate exports: identical names in different files (parseISOparse_iso) and same-words-different-order names (formatDatedateFormat), each with file:line locations. Exits 1 when any are found — slots into CI next to --check.

Monorepo awareness

npm/yarn/pnpm workspaces are auto-detected (package.json workspaces, pnpm-workspace.yaml). Import hints for files in another workspace package now say @acme/ui instead of ../../packages/ui/src/button — in markdown, JSON, and MCP output.

Fixed

  • MCP root parameter on all tools: Claude Desktop starts MCP servers in / or the home directory, so cwd-based scans silently found nothing there. Pass your project path once and the tools work from any host.
  • Version-stamped snapshots: the header now carries contextsnap@<version> (JSON gets a "version" field). --check detects a generator/checker version mismatch and tells you to pin the version in CI, instead of reporting a misleading "stale".
  • Prompt-injection hardening: JSDoc is capped at 600 chars and the snapshot preamble instructs the AI to treat comment text as reference material, never as instructions.
  • README no longer claims --budget "guarantees" a ceiling — token counts are ~4 chars/token estimates.

🤖 Generated with Claude Code