Repository navigation
v7.15.0
A minor release: on first launch the new binary silently reinstalls your agent integrations, refreshing the rules text and the git-hook sections. No schema change and no forced reindex. C# and TypeScript projects get the new edges on tokensave sync -f, or file by file as they change. Full detail in CHANGELOG.md.
Added
tokensave_readtakes anif_digestargument (#650). Every response that carries a body also carries itsdigest. A client that still holds that content passes the digest back asif_digest; when it matches the current body for the same mode and range, the shortunchanged: truestub is returned instead of the body, and otherwise the body is. Requested by @xorets.
Changed
- The installed agent rules now say what
tokensave_searchwithliteral: truefinds, and when grep is the right tool (#653). The rules namedtokensave_searchonly for a known symbol, and never said when grep fits, so agents reached for grep to find call sites. A new "Searching code" section in the shared rules text says that by defaulttokensave_searchreturns where a name is defined, ranked, with its kind and signature, and that withliteral: trueit finds exact text:.Name(for calls through an object,Name(for every call,: INamefor implementers. Grep is for a regex, or a file type the index skips. Claude's "When the hook denies a search" section now offers{"query": ".Name(", "literal": true}next totokensave_callersfor a symbol's uses, and the MCP server'sinitializeinstructions carry the same two points in one sentence. Every agent that installs rules text gets the new section (Claude, Augment, Codex, Copilot, Droid, Gemini, Grok, Kimi, Kiro, OMP, OpenCode, Pi, Qwen, Vibe), and existing installs pick it up on the nexttokensave installorreinstall, or the silent resync after a minor upgrade. In the reporter's A/B test the two lines cut tool calls by about 25% and lowered cost. Suggested by @xorets. tokensave_readnumbers the lines it returns (#652).fullandlinesmodes now prefix every line with its real file line number, right-aligned, then a tab, as Claude Code'sReadtool does, so alinesslice from 120 starts at 120.mapandsignaturesare unchanged. Because the body changed, a digest from an earlier release no longer matches. Requested by @xorets.tokensave_readalways returns the body unlessif_digestmatches (#650). The server used to remember every file it had sent, across sessions, and answer a repeat read with anunchanged: truestub. It cannot know what the client still holds after a context compaction, a rewind, a new session or a subagent, so the stub could leave an agent with no copy of the file. That server-side record is gone and theread_cachetable is no longer read or written.forceis still accepted but deprecated: the body is now the default, andforce: trueonly makes the server ignoreif_digest.tokensave_bodylists candidates for an ambiguous name instead of returning every body, and acceptsType.Member(#651). A bare name shared by several definitions, such as threeRefreshAsyncmethods, used to return up to three full bodies, the wanted one possibly last. When more than one definition of the best kind matches (a function or type still outranks a same-named field or import), the tool now returns no body but a candidate list with each candidate's qualified name without its file prefix (App::Coordinator::RefreshAsync), kind, file, 1-based line range and node id, plus a hint to re-call with a qualified name or the id. Exactly one match returns its body as before..is now accepted as a member separator alongside:::Coordinator.RefreshAsyncandApp.Coordinator.RefreshAsyncresolve by matching trailing segments, and the literal name is tried first so names that really contain dots still match. The match treats.and::alike on both sides, so C# namespaces stored asApp.TestsmatchTests::FakeCoordinator::RefreshAsynctoo. A newnode_idparameter (aliasid) fetches one node's body directly; the truncated-snippet handletokensave_body node_id=…thattokensave_contextemits now works as written.limitnow caps the candidate list (default 20, max 50), andsymbolis no longer a schema-required field sincenode_idcan replace it. Reported in #651.
Fixed
- Git hooks shell-quote the tokensave binary path (#636). The post-commit, post-merge and post-checkout sections put the path into the
shscript unquoted, so an install path with a space split into two words and the hook did nothing, and a;,$(...)or backtick in it would run as a command on every git operation. The path is now single-quoted, which turns off every shell expansion. Existing sections are rewritten in place byinstall,reinstall,githooks onand the upgrade resync, and the post-checkout block's version stamp goes to v3. - The MCP server caps a request line at 64 MiB (#636). Its stdin reader buffered a line of any length, so a host that never sent a newline could make the server use all available memory. A longer line is now discarded and answered with a JSON-RPC parse error, and the server keeps serving.
- Name lookups no longer read
_and%in a name as wildcards. TheLIKEfallback ofsearch_nodesand the::suffix scan ofget_nodes_by_qualified_namepassed the query to SQL unescaped, somy_functionalso matchedmyXfunction. - The grep hook's denial now gives the call to make, with the symbol filled in (#649, #654). It used to send usages to
tokensave_callers_for, which takes node ids and is not a core tool, so agents that followed it failed. A denied symbol search now spells out copyable calls for the symbol taken from the command:tokensave_search {"query": "MySymbol"}for the definition,tokensave_search {"query": ".MySymbol(", "literal": true}for method-call uses, andtokensave_search {"query": "MySymbol(", "literal": true}for every call. Adef/class/fn-anchored pattern gets the definition call only, and an alternation gets one call per name. Reported by @xorets. - More shell shapes that search for a symbol are redirected (#648).
git grepis now treated as the working-tree search it is, unless it names a revision (git grep Sym HEAD~3, or any positional before--that is not an existing path), which still passes through as a history search. A search batched beside a read-only command is redirected:sed -n 1,20p notes.md; grep -rn Sym src, and a prose grep next to a symbol grep, where the prose grep used to count as work. A search piped into read-only filters (| head,| sort | uniq,| wc -l) is redirected too; a pipe into anything that writes (| xargs,| tee,sort -o) still passes through, as does any chain with a side-effecting segment (#475). An alternation is a symbol search when any branch is symbol-shaped (MySymbol\|throw new Error), and a call pattern may carry text after the paren (MySymbol(name), though not when the paren follows a space or a control keyword (if (x). Non-code targets (--include='*.md',docs/) andTOKENSAVE_DISABLE_GREP_HOOKbehave as before. Reported by @xorets. tokensave_searchwithids: trueprints the ids in the default text format (#646). The ids only appeared withformat: "json", so a text answer could not feedtokensave_callers,tokensave_callees,tokensave_impactortokensave_node. A ranked hit now readsfile:line: Foo (interface) [id: <id>] — signature, and a literal match appends[in <enclosing>, id: <enclosing_id>]when it falls inside a symbol. Withoutids, the text is unchanged.- A literal
tokensave_searchsays whenlimitcut its matches (#645). The scan stopped atlimitand reportedcount: <limit>with nothing to say that 70 more matches existed. It now keeps counting past the limit (a substring test per line, without building the extra matches), and the JSON carriestotalandtruncatedbesidecount; the text header readscount: 5 of 73 (truncated; raiselimitto see more). The ranked search fetches one result pastlimit, and when that one survives the filters its text header readscount: 10 (truncated: more matches exist; raiselimitto see them); its JSON stays a bare array. tokensave_readinmapandsignaturesmode finds a file's symbols again on Windows and for non-plain paths (#644). The mode looks symbols up by the file's path relative to the project, but that path was cut from the canonical file path with the separators of the host, so on Windows agraph_rootread ofsrc/x/Service.cslooked upsrc\x\Service.cs, which the indexer (it stores forward slashes) never wrote, and returnedsymbol_count: 0. The served project could miss too: when its root was not in canonical form (a symlinked directory, or no\\?\prefix on Windows) the raw argument was used as given, so./src/x.rs,src/../src/x.rsor an absolute path found nothing. The lookup key, the echoedfileand the read-cache key are now always derived from the canonical root and file and use forward slashes.tokensave_entitiesuses the same key. The containment check from #636 is unchanged. Reported on Windows 11.- TypeScript imports written with a
.jsspecifier now link to the.tssource (#647). Under"module": "NodeNext"(and thebundlerresolution mode) TypeScript requires relative imports to name the emitted file, sosrc/lib/hash.tsis imported as../../src/lib/hash.js. The import'susesedge never resolved, because the specifier was matched as a symbol name (its trailing segment,js), and the reachability gate on JS/TS calls compared the callee's module stem (hash) against that same segment, so a call into another directory was dropped as unreachable.tokensave_affectedtherefore reported no tests for the module, andfile_dependents,impactand the module import graph missed the dependency. A relative import from a JS/TS/Vue/Svelte/Astro file now binds to theFilenode of the file it names, applying TypeScript's mapping (.jsto.ts/.tsx/.d.ts,.jsxto.tsx,.mjsto.mts,.cjsto.cts; extensionless specifiers try each source extension and then the directory'sindexfile), with the newrelative-importprovenance. A TypeScript importer prefers the TypeScript source when a same-named.jsfile also exists; a JavaScript importer prefers the file it names. A relative specifier that names no indexed file no longer falls through to a bare-name match on its last dotted segment. Calls into an imported file now pass the reachability gate, and incremental sync re-resolves an import when the file it names is added or re-extracted. Reported in #647. - C# property, indexer and event accessors now record the calls they make (#637). The C# extractor walked method and constructor bodies for call sites but not property bodies, so a call inside a
get/set/initaccessor, an expression-bodied accessor (get => ...), an expression-bodied property (string Short => Helper.Format(Id);) or a property initializer (= new Holder()) produced nocallsedge and no unresolved reference, and its callee could look dead. These calls are now attributed to thecsharp_propertynode. Indexers (T this[int i] { ... }), which were not extracted at all, are nowcsharp_propertynodes namedthis(signatureT this[int i]) with their accessor calls attributed to them, and calls in an event'sadd/removeaccessors are attributed to the event. Attributes on the declaration are not walked, sonameof(...)inside one is not recorded as a call. A read of a property from another member (h.Label) still produces no edge. Existing C# projects pick the new edges up on their next full reindex (tokensave sync --force) or as files change. tokensave_implementationsfinds the implementers of a C# interface, generic or not (#643). A C# base list (class A : X, IY) cannot tell a base class from an interface, so the extractor recorded a class's first base asextends, andtokensave_implementations, which readsimplementsedges, found nothing for a class whose only or first base was the interface. The resolver now stores that edge asimplementswhen its target is an interface; a base class staysextends. A generic base (IProducer<TRecord>,App.IProducer<int>) was also recorded with its type arguments, so it never matched theIProducerdeclaration and neithertokensave_implementationsnortokensave_type_hierarchysaw it; type arguments are now dropped from base-list names. No schema change: an existing index picks this up for a C# file when that file is next re-indexed, or for the whole project withtokensave sync --force.- A C# call resolves through its receiver's static type (#642, follow-up to #634).
coordinator.RefreshAsync(...)was matched on the method name alone, so a primary-constructor parameter or avarlocal gave no edge as soon as a secondRefreshAsyncexisted, and inside the class that declared one the same-file bonus bound the call to the caller's own method. The extractor now records the receiver's type next to the call, from the enclosing type's fields, properties and primary-constructor parameters, the method's parameters, explicitly typed locals, andvarlocals initialised bynew T(...), a cast,as, or a call or member read (writerFactory.CreateWriter<T>(...),await opener.OpenAsync()); a class name used as a receiver (Factory.Create()) types a static call. The resolver looks the method up on that type, reading declared return, field and property types from the signatures, unwrappingTask<T>/ValueTask<T>afterawait, and walking the base list for an inherited member. When the type is not indexed or lacks the member (an extension method, for instance), the name-based match decides as before, except that a call on a receiver other thanthis/baseno longer binds to a method of the caller's own class. Type arguments are dropped from callee names, sof.Create<T>(x)now reachesCreate. Async -fis needed to pick this up for files already indexed. Reported by @xorets and @t-macabee.