Repository navigation
SigMap 8.86.0
Minor. The agent study, and the two opt-in things it pointed at: a UserPromptSubmit hook that ranks each prompt before the agent starts (sigmap hooks install claude --prefetch) and a two-tool MCP profile (mcp.tools: "locate") (#1063). SigMap against no SigMap in a real agent loop, 22,540 recorded runs on Claude Haiku 5.5, Haiku 4.5 and Sonnet 5.5, with the plan and the bar fixed before the runs. The result is modest and conditional, and the results page says so: across twenty repositories SigMap was not tuned on, no setup met the bar written down for "saves reliably" (Haiku 5.5, real cost against no SigMap: index −1% [−8, +5], prefetch −7% [−19, +4], locate −7% [−13, −2]); on this repository's own source, which the models have not read, index cut the cost of a task by 28% to 44% on every model. The same work changes what the index holds. A source file the extractor reads nothing from is now findable by its path, the PHP extractor reads final and readonly classes and enums, a top-level directory called constructor no longer breaks generation, and a Python virtual environment below the source root is no longer indexed. The release also carries the release-automation work of #1051 to #1054 (a prepared release is tagged only when a runtime file changed; a daily guard on the look-alike npm names; a security policy that says what is in scope) and the first three Dependabot pull requests.
Added
- A source file with no signature is now indexed by its path. The retrieval index lists what a file declares and exports; a file the extractor reads nothing from (
export default new Plugin(), a script with no exports, a Rust binary with nopubitem, a module of constants) had no entry, sosigmap askcould not return it even for a question that named it.generatenow records such a file under abarelist in.context/sig-index.json(a programming-language file of at least 5 non-blank lines that is not a test, mock, generated, minified or declaration file;src/retrieval/bare-files.js), and the callers that rank (ask,--query,validate, the MCPquery_contextand the retrieval runner) askbuildSigIndex(cwd, { bare: true })for it as an entry with no signatures, ranked on its path. The context file is byte-identical (checked on 20 repositories), every other reader of the index (doctor, the call graph, the wiki,verify, the planner) sees the index it saw, and body words are unchanged;explainsays "ranked by its path only" (pathOnlyin--json). Over the 222 held-out questions, with the PHP fix: the expected file is in the top five for 166 against 159 (confirm split 120 against 114, MRR 0.552 to 0.563), for none fewer in any repository; 207 of 4,591 indexed files are path-only entries. Three questions lose the first place, two gain it. The registered size bound (an index grows under 5%) failed for one seven-file repository (+6.7%, 212 bytes); the largest absolute growth is 3.5 KB. Protocol, Stage H. - A more doubtful header, tested and not shipped.
benchmarks/agent-study/hooks/prototype-hook.cjshas adoubtstyle (varianthook-doubt) that puts a header saying the ranking looks weak above a flat list (last shown score above 57% of the first), fitted offline on 200 held-out questions; it flags 67 of them, 34% with a wrong ranking against 22% overall. In 1,340 first-ask runs (Claude Code, Haiku 5.5, the 67 questions in 17 repositories, five repetitions) the agent verified much more (tool calls +25% [+16, +35] against the standard header) and the accuracy loss on the 23 wrong rankings halved, but it cost +11% [+7, +15] against the standard header and the file-found gain was +2.4 points [−0.3, +6.0]: the shipped hook is unchanged. New tooling:summarize.mjs --found-did(file-found difference of differences, interval resampling questions) andrun-hook-study.shIDS_FILE=(run only listed questions). - The agent study — protocol and results, data and tools in
benchmarks/agent-study/(data/runs.ndjson,summarize.mjs,run-token-saving.sh,run-change.sh). SigMap against no SigMap in a real agent loop,index(the documented setup) andprefetch, on 45 questions about eight famous frameworks and 30 about this repository's own source, on Claude Haiku 5.5, Haiku 4.5 and Sonnet 5.5, reported the way stet.sh's study of six token-saving modes reports: per repetition, whole workload and typical task, with a bootstrap interval. Headline: on code a model has not memorised,indexcut real cost by 28% to 44% on every model; on famous frameworks the saving depends on the agent (none in Claude Code with Haiku 5.5, 17% to 33% in the small API agent) and tokens often rise even when cost falls, because the baseline writes every grep result into the prompt cache. Closed-book, Haiku 5.5 names the right file for 40 of 45 famous-framework questions and 0 of 30 about this repository. mcp.tools: "locate"andsigmap hooks install claude --prefetch— the two things the agent study pointed at."locate"is a named MCP profile ofquery_contextandget_linesonly (426 tokens of definitions a turn against 1,505 forcore, measured on the API's token counter): −4% [−7, −2] againstcorefor Haiku 5.5 over 887 paired runs and −10% [−16, −4] for Sonnet 5.5 over 110, with the file found as often. It drops the tools an edit or a check needs, so it is for where-is-it questions and is never the default;doctorshows what it would cost.--prefetchadds aUserPromptSubmithook that runssigmap askon each substantive prompt and returns the top five files with signatures and anchors as additional context: it skips slash commands, shell escapes, notes and prompts under four words, never repeats a block already injected in the session, caps the block at 8 KiB (the host's limit is 10,000 characters) and the work at 8 s, prints nothing on any failure, andSIGMAP_PREFETCH=0turns it off;hooks remove claude --prefetchremoves only it. The benchmark'sprefetch(the same ranking put in the prompt by the harness) took, over twenty repositories on the Messages-API agent (Haiku 5.5), tokens −27%, tool calls −44%, time −18% and cost −8% [−11, −4] and cost more on five of them. The installed hook is a smaller thing: on a clean comparison in Claude Code (eight repositories, first asks) it took cost −4% [−7, −1], tool calls −41% and time −11%, against −12% for the same ranking in the prompt (see theprefetch-hookentry below). It is opt-in. 22 new tests (prefetch-hook.test.js,tool-profile.test.js).- Two controls for the agent study: a placebo arm and five repositories SigMap was not tuned on (
--sigmap-variant placebo,scripts/build-heldout-set.mjs; 2,660 runs). Against a size-matched block of generic search guidance,indexis still 27% to 46% cheaper on SigMap's own code (Haiku 5.5 and Sonnet 5.5, both question sets), so the saving is not the prompt text. On five unseen repositories (Python, TypeScript, Go, Rust, Java; 55 questions from their merged changes) the saving is much smaller:index−7% [−12, 0] (Haiku 5.5) and −8% [−18, +2] (Sonnet 5.5), carried by one repository, +24% on another;prefetch−18% [−25, −10] with tokens −42%, tool calls −52% and time −24% (Haiku 5.5). The standing cost ofindexis 2,266 tokens a turn (761 section + 1,505 for the seven tools), not the 1.6k first written. - Second round of the agent study: twenty unseen repositories and a two-tool profile (
--sigmap-variant locate,scripts/select-heldout-repos.mjs,summarize.mjs --by-repo; 4,668 runs). On twenty repositories in eight languages (Haiku 5.5, 222 questions from their merged changes) no setup met the bar set beforehand for "saves reliably": real cost, resampling repositories,index−1% [−8, +5],prefetch−7% [−19, +4],locate−7% [−13, −2];indexraised total tokens by 51%.locate(theindexsetup with onlyquery_contextandget_lines, a setting that already exists) is −4% [−7, −2] againstindexfor Haiku 5.5 and −10% [−16, −4] for Sonnet 5.5. The saving tracks how much the unaided agent spends per question, not repository size or language. The write-up says plainly that this is a modest, conditional saving. --sigmap-variant prefetch-hook: the agent A/B with the realUserPromptSubmithook. The SigMap arm's copy gets a.claude/settings.jsonregistering the product's own hook command and nothing else (no## SigMapsection, no MCP server, no CLI allowance); it needs--agent claude --session-auth. Every run proves the hook fired once in the SigMap arm (success, exit 0, more than zero bytes of context) and never in the baseline, and a probe runs the registered command before the first call. The design and decision rule are in the protocol, written before the run. Result (Haiku 5.5, eight of the twenty repositories, a live Claude Code session), and what the first comparison got wrong: the hook fired in every SigMap-arm run and in none of the baseline. A first comparison (hook −1%, the same ranking in the prompt −15%) was confounded twice: Claude Code serves a repeated question's identical opening prompt from the prompt cache, which flatters arms that add question-specific text (rows are now taggedask: first | repeat,summarize.mjs --ask first), and the hook ranks the whole submitted prompt, benchmark boilerplate included, so it had a worse ranking (expected file in the top five for 47 of 87 questions against 61 for the bare question).--prompt-style questionfixes both (the bare question plus a one-token reference; the instructions move to the system prompt). Clean result (348 first-ask pairs): the hook took cost −4% [−7, −1], tool calls −41%, time −11%, tokens −23%, file found 321/348 against 326/348; the same ranking in the prompt −12% [−15, −9], tool calls −54%, found 315/348 against 328/348; the hook cost +6% [+4, +9] more than the prompt text, pair for pair. Three prototype deliveries (hook-plain,hook-firm,hook-brief,benchmarks/agent-study/hooks/prototype-hook.cjs) did not improve on the shipped hook (−2% [−7, +3], −3% [−8, +2] in the confirmationhook-firmrequired, −3% [−8, +3], each against its own baseline). The eight repositories were picked after the earlier results and are not a sample.trace-analysis.mjsdescribes what the agent does first, andsummarize.mjs --versus a:b --adjustedcompares each series against its own baseline.--agent api— the agent A/B through the Messages API directly (scripts/lib/agent-ab-api.mjs), for a key that plain/v1/messagescalls accept but Claude Code requests are refused for ("credit balance is too low"). A small loop with read-only Read, Grep, Glob and Bash (Grep and Glob run ripgrep, sorgmust be onPATH: without it the run refuses to start, and the tools answer with an error rather than "No matches found"), the SigMap MCP server for the MCP variants, prompt caching, a per-run budget and turn cap (a capped run is a scored miss, never a dropped pair). Cost is computed from reported usage and a price table that reproduces 2,700 Claude Code runs' own reported costs exactly for the Haiku models.--sigmap-variant index | prefetch | lean | skill*,--session-auth,--task-idsfornpm run benchmark:agent-ab.indexis the documented setup (strategy: "index"plus thecoreMCP profile);prefetchputssigmap ask's ranking after the question;leanand the skill variants are probes. The report answers "did it save?" per repetition in two ways (scripts/lib/agent-ab-stats.mjs).- Arm hygiene check. The harness removes every file
gen-contextwrote into the SigMap arm's checkout and refuses a plan whose two arms differ in anything the agent can search except the config and skill files under test. Found because the first API runs left the generated signature map searchable in the SigMap arm. --change: the article's task type.scripts/build-change-tasks.mjsturns merged bug fixes from this repository's history after the models' cutoff into tasks (issue text with the fix's locations redacted, the fix's tests hidden, valid only if the tests fail before and pass after the real fix, twice); the agent edits a checkout with Edit, Write and RunTest and its patch is graded by the hidden tests on a pristine copy. 144 runs on nine tasks (Haiku 5.5, Sonnet 5.5; $5.39) passed 3/27 against 3/27, 3/27 against 3/27 and 1/18 against 2/18: only the one well-specified task was solved, because five of the nine tasks' hidden tests need names the real fix invented (screen-change-tasks.mjslists them). It says nothing about patch quality yet. 6 tests.- A prepared release is tagged only when a runtime file changed (#1051; refs #999, #1000, #1050).
scripts/check-runtime-change.mjs(npm run check:runtime-change) compares the runtime files (gen-context.js,gen-project-map.js,src/,packages/) and thepackage.jsonfields that change what runs (main,bin,exports,engines, the dependency tables) between two refs, ignoring the version string, and writesruntime_changedfor Actions. On this repository's tags it reproduces the nine releases with no runtime change that #999 counts, and finds 11 of 71 since 2026-09-15.tag-on-mergenow tags a prepared release only when it says a runtime file changed; a dispatch withforce=truetags it anyway, and a failing check tags as before so the guard cannot stall a release. A test fails whenpackage.jsonfilesgains an entry the checker has not classified. This release changes the runtime, so it is tagged. - A daily guard that the look-alike npm names stay owned (#1053, #1054; #1000 item 7).
scripts/check-npm-names.mjsand.github/workflows/npm-name-guard.yml: anonymous registry reads, and the job fails when a reserved name is unclaimed, held by someone else or has nolatest, when the real package's maintainer changes, when a new look-alike appears in the registry's search, or when the registry cannot be reached; the token is read-only and the one job that files a tracking issue holdsissues: write. The@sigmapscope is not available (npm answered "The organization name 'sigmap' is not available" on 2026-10-29), so@sigmap/clicannot be claimed and the reserved list stays at the five published names; a package called@sigmap/clipublished by anyone but the maintainer fails the guard asNEW-LOOKALIKE.npm-name-guard.test.jsruns the real script against a local fake registry and plants each breach; the script and the workflow were mutated 22 ways on temporary copies and every mutant failed a test.
Changed
- The prerelease workflow publishes to npm with Trusted Publishing, and the release pushes use a GitHub App token (#1051).
prerelease-publish.ymltakesid-token: writeon the one publishing job and passes--provenance, so no workflow readsNPM_TOKENany more;tag-on-mergeandsync-develop-mainmint a GitHub App installation token whenRELEASE_APP_CLIENT_IDis set and fall back toSYNC_PATwhile that secret exists, and the credential step refuses to tag only when no credential can start the publish workflow.release-automation.test.jsruns that step under each combination of credentials instead of matching its text, andworkflow-pins.test.jsnow expectsid-token: writeon three jobs and pins that no workflow readsNPM_TOKEN.CONTRIBUTING.mdwrites the tag rule down. SECURITY.mdsays what is in scope, how to check that a release is the one the pipeline built, and how fixes ship (#1052; refs #1000). In scope: the npm package and the workflows that publish it; the docs site, benchmarks, tests and scripts are not part of the package and are triaged by what they can reach. To verify a release:npm audit signaturesanddist.attestations, run against sigmap@8.85.1 (one verified registry signature, one verified attestation). Fixes ship as a new release of the latest 8.x line.- Three pinned actions moved by Dependabot (#1055, #1056, #1058):
actions/upload-pages-artifact3.0.1 → 5.0.0,actions/checkout4.4.0 → 7.0.1 andactions/setup-java4.9.1 → 6.1.0, each a commit SHA with its release in a comment, asscripts/check-workflow-pins.mjsrequires. The first pull requests the file added in 8.85.1 produced. - CI's
testjob installs ripgrep (#1063). The agent A/B harness's API agent searches with it and its tests run those tools; the runner image does not have it. It is a multi-linerun:step, whichrelease-hygiene.test.jstreats as provisioning, sonpm run test:cistill equals the single-line steps.CONTRIBUTING.mdsays a contributor installsrgwith their package manager and that the tests that need it skip without it locally and fail whenCIis set.
Fixed
- The PHP extractor reads
finalandreadonlyclasses, enums, and namespaced parents and interfaces. Its class pattern tookabstract classand a bare-wordextendsonly, sofinal class X extends \Foo\Bar, everyreadonlyclass and everyenumyielded no signature, and a file made of them was not in the retrieval index at all (onmartin-georgiev/postgresql-for-doctrine, 398 of 1,049 source files; onintaro/pinboard, 39 of 128). It now reads a modifier (abstract,final,readonly, in any order),\in a parent or interface name, several interfaces across lines andenumwith or without a backing type; output for the forms it already read is unchanged. On the 222 held-out questions of the agent study it moves no expected file into the top five (it is a correctness fix, not a ranking one). Not changed:finalorabstractbefore a method's visibility, which it still skips. - The prefetch hook stays silent for a prompt the ranker cannot read.
sigmap ask's tokenizer reads only A-Z, a-z and 0-9, so for a prompt written mostly in Chinese, Russian or Greek only a few identifiers reach the ranking, and over 222 held-out questions the list was wrong for 18 of the 22 queries under 90% ASCII letters; the agent that trusted it found the file less often than one with no hook (483 runs of 540 against 497 on twelve repositories, net −14 pairs, p = 0.02). The hook now injects nothing when less than 90% of the letters of the query it would rank are ASCII (a few accents, as in German or French, do not trip it);SIGMAP_PREFETCH_GUARD=0turns it off. Run on the same twelve repositories (1,080 runs, first asks) the guarded hook took real cost −8% [−10, −5] against its baseline and found the file in 485 runs of 540 against 492 (net −7 pairs, p = 0.28), with no measurable cost to the saving (0% [−3, +2] against the unguarded hook). It fires on 22 of the 222 questions, all in two Chinese-language repositories; no signal tried (flatness, top score, margin, readable share; AUC at most 0.66) predicts an English prompt whose ranking is wrong. Offline analysis:benchmarks/agent-study/guard-eval.mjs; the agent-study harness now expects a silent hook run exactly where the product'sscreen()says the prompt is guarded; two new tests inprefetch-hook.test.js, one inagent-ab.test.js. - The prefetch hook no longer ranks the greetings, instructions and pasted output around a question.
UserPromptSubmithands the hook the whole prompt, and a BM25 ranking over a whole prompt is only as good as the prompt is focused: in the agent study the expected file was in the top five for 47 of 87 questions when the question sat inside about fifty words of instructions, against 61 of 87 for the bare question. A prompt of more than 24 words now goes throughsrc/session/query-focus.jsfirst: fenced code blocks, pasted tool output and sentences made only of conversation or instructions about the answer are left out (alabel: questionorTask: ...lead-in stays with its sentence), and a prompt of 24 words or fewer is ranked exactly as written. Over 222 held-out questions in thirteen kinds of wrapper, the expected file was in the top five for 59% of raw wrapped prompts, 66% after focusing and 72% for the bare question (first for 28%, 36% and 45%): about half the damage, with a plain question untouched (0 of 222 changed). It does not tell constraints written in ordinary software words ("keep the public API unchanged") from a question, and a pasted traceback loses its frames;SIGMAP_PREFETCH_FOCUS=0ranks the whole prompt as before. Evaluated bybenchmarks/agent-study/query-focus-eval.mjs; five new tests inprefetch-hook.test.js. In an agent (Claude Code, Haiku 5.5, eight repositories, the benchmark's own wrapped prompt, 1,392 runs, every one a first ask) the hook took real cost −3% [−6, 0] with focusing and +3% [0, +6] without it, each against its own baseline; focused against unfocused −6% [−9, −2] (--prompt-style wrapped,run-hook-study.shwithprefetch-hook:nofocus). On the twelve other repositories of the twenty (2,160 runs) the focused hook took −7% [−10, −5] and the unfocused 0% [−3, +2], but the file was found in 483 runs of 540 against 497 for its baseline (net −14 pairs, p = 0.02), mostly on one repository whose ranking is poor however the query is built: the saving is not free where the ranking is weak. - A top-level directory called
constructor,toStringorhasOwnPropertyno longer breaks generation or disappears from the module list. The generator grouped files by their top-level directory in a plain{}, so the groupconstructorwasObject.prototype.constructorandgroups[group].push(...)threw:--adapter claudeprinted "adapter error: groups[group].push is not a function" and wrote no file (found onconda/constructorwhile building the agent study's held-out set). Thelist_modulestool and the architecture view grouped the same way and dropped such a directory from their table and totals (or counted it as NaN). They now group on a prototype-free object. 3 tests (prototype-key-dirs.test.js), which fail on the old code. - A Python virtual environment below the source root is no longer indexed.
excludeis a list of names and a config that sets it replaces the default list, so a repository with<dir>/.venv/lib/python3.x/site-packagesbelow asrcDirsof["."]put every installed package into the context file and the retrieval index (about two thirds of one real repository's generatedCLAUDE.md). Newsrc/util/vendored-dir.js: a directory that holdspyvenv.cfgorconda-meta/is an environment root and is never walked, whatever it is called; a directory namedsite-packages,dist-packages,node_modules,__pycache__or a tool cache is skipped.venv,env,vendorandbuildare not on the list because projects keep code under those names. Applied in the generator's walker and the five other walkers that must agree with it. 4 tests. - A missing
rgis no longer read as "No matches found" (#1063; found by CI). The API agent'srun()mapped any non-numericexecFileerror code to exit status 1, and ripgrep exits 1 for "no match", soENOENTon a machine without ripgrep made every Grep and Glob answer "No matches found" and a run scored a miss it had not earned: two tests failed on Node 18, 20 and 22 on a runner with norg. A program that is not onPATHis now an error result that names it (Bash reports "command not found"), and--agent apirefuses to start withoutrg(exit 2). One new test runs the tools and the CLI with an emptyPATH.
Notes
- One published figure moves, and it is the grep side of the honest comparison. The scan reads the repository's own files, so it finds 49 of 125 answers (39.2%) where it found 50 (40.0%) and the lift reads 2.37× where it read 2.32×; SigMap's side is unchanged at 116 of 125 (92.8%, MRR 0.776), and the reading with SigMap's files left out moves 58 to 57 of 125 (2.00× to 2.04×). A control at the v8.85.1 tag reproduces 50 / 125, 135 places and 2.32×, and an untouched merged
developreads 49 / 125, 134 places and 2.37×, so the movement belongs to the merged code and documents (#1063 adds the agent study's pages, data and scripts, four modules and a changed PHP extractor) and not to this release's text. Token reduction (95.2%), retrieval hit@5 (80.4%), the task-success proxy (61.9%), prompt reduction (44.4%), test-discovery F1 (98.0%), the grounding corpus and the third-party corpus (118 of 208, no task changed hit status) hold; retrieval, test discovery and the grounding regression reproduce v8.85.1 leaf for leaf. The one repository that moves in the matrix islaravel, which the PHP extractor now reads 10 more files of (1,536 to 1,546; the v8.85.1 bundle run on the same clone reads 1,536), so the quality page's totals move with it: 5,345 to 5,355 files hidden in the raw flow, 4,557 to 4,567 left out of the written map by its budget, 50,589 to 50,642 dark symbols. hardhas 0 tasks of headroom, and which side of the floor it lands on depends on how much git history is present. The gate's floor is 68.0% (62 of 90). In the depth-1 checkout CI uses, this release reads 62 of 90 (68.9%) and passes, as the mergeddevelopdoes; in a clone with full history the same tree reads 61 of 90 (67.8%) and fails, because the generatedrecent changesblock (the files of the last five commits) is indexed and feeds the last file's vocabulary.minedreads 65.0% (39 of 60) in both. The publish and release workflows run only the unit tests, so shipping is unaffected; a contributor who runsnpm run validate:retrievalin a full clone sees a failure CI does not. The floor is not changed here.- What is on by default and what is not. Path-only index entries and the PHP,
constructorand virtual-environment fixes are on:sigmap askand the MCP search tools may now return a file by its path, and over the 222 held-out questions the expected file reaches the top five for 166 against 159, for none fewer in any repository. The prefetch hook and thelocateprofile are opt-in, andstrategy, the default profile and the generated context file are unchanged. - The package is 4 files and 66 KB larger. 226 to 230 files, 1,187 to 1,211 KB packed, 3,960 to 4,026 KB unpacked:
src/retrieval/bare-files.js,src/session/prefetch.js,src/session/query-focus.jsandsrc/util/vendored-dir.js. - The study's numbers are the study's. They come from
benchmarks/agent-study/data/runs.ndjsonthroughsummarize.mjs, were not re-run for this release, and cost real money to reproduce (about $168 in this set); the headline benchmark figures above are separate and were re-measured on this tree.