github colbymchenry/codegraph v1.6.4

35 minutes ago

[1.6.4] - 2026-11-20

Highlights

  • Small questions cost less. Ask your agent what a function or constant is, or who calls it, and codegraph_explore now answers with the definition and every line that uses it, instead of a long answer about related files.
  • Faster answers in Claude Code. The prompt hook now asks the CodeGraph server already running for your project instead of loading the index again on every prompt, which matters most in large projects, and codegraph impact is as fast as it was in 1.6.2 again.
  • Safer on a shared computer. Each agent session now checks that the background server it connects to runs as you before sending it anything.
  • More of your code in the graph. Elysia (Bun) routes, PHP includes built from the web server's root or the file's own folder, Dart 3.13 primary constructors and newer Kotlin syntax are now read, and ASP.NET Core routes are named the way ASP.NET serves them.
  • More accurate links. Dozens of fixes help calls reach the code they mean, most of all in JavaScript and TypeScript, Python, Rust, C#, PHP and Java, and codegraph affected no longer picks tests on the far side of an HTTP call, a queue or an event unless you pass --cross-tier.
  • Fewer stuck commands. A git add or commit no longer fails with "index.lock: File exists" while CodeGraph syncs, a file whose parse never ends no longer keeps codegraph init or sync from finishing, and a server whose project folder was deleted now shuts down.
  • Upgrading: re-index your projects with codegraph index after this release. Many of these fixes are written while indexing, and codegraph status and your agent both tell you when an index was built by an older version.

Security

  • On a computer shared with other users, each agent session now checks that the CodeGraph background server it connects to runs as you before sending it anything, and serves the session itself when the server can't prove it, so another user can no longer stand in for your server to read your agent's queries or feed it made-up answers. Thanks @aidenpan0x for pointing it out.

New Features

  • The Claude Code prompt hook now gets its context from the CodeGraph server already running for your project instead of loading the index again on every prompt, so structural prompts are answered sooner, most of all in large projects; with no server running, one that is busy, or one that can't prove it runs as you, the hook works it out itself as before. Thanks @aidenpan0x for the report, the measurements and the pull request. (#3284)
  • Elysia (Bun) backends now have their HTTP routes in the graph, named by the full path a request takes, with the prefixes of new Elysia({ prefix }), .group() and a .use() in another file included, and linked to their handlers, so codegraph_explore can follow a request from its route into your code. Thanks @ChampPABA for the report. (#3255)
  • PHP includes built from the web server's root, like require $_SERVER['DOCUMENT_ROOT'] . '/inc/header.php', now link to their file: CodeGraph works out which folder the server serves from where your includes' paths name files, links nothing when they don't settle it rather than guess, and takes "webRoot": "public" in codegraph.json (or "." for the project root) when you'd rather name it yourself. Thanks @artisanya for the report. (#3298)
  • Kotlin is now read with a newer version of its grammar, so code it used to misread, such as an annotated class whose methods showed up as top-level functions, a class that delegates by another object, or newer syntax like when guards and explicit backing fields, now has its classes, functions and calls in the graph where they belong. (#3410)
  • codegraph_explore now answers a question about one symbol, like "who calls toValidURL?" or "what is MAX_RETRIES?", with that symbol's source and every line that uses it, each with the function it sits in and the line's text, instead of filling its whole answer with files that only share words with the name, so these small questions cost less and leave nothing to search for afterwards. Thanks @GeorgeTaveras1231 for the measurements. (#3407)

Fixes

Setup, the background server and the CLI

  • codegraph affected no longer selects tests on the other side of an HTTP call, a queue or an event, like an Angular app's specs for a change to the Spring controller it calls, since those tests mock that boundary; pass --cross-tier to include them. Thanks @jotder for the report. (#3320)
  • CodeGraph no longer takes git's index lock while it checks your repository for changes, so a git add in a pre-commit hook, a commit or a checkout that runs while CodeGraph syncs no longer fails with "index.lock: File exists". Thanks @iamclaudia-ai for the report. (#3295)
  • codegraph impact and codegraph_impact are as fast as they were in 1.6.2 again, with the same results: 1.6.3 read each symbol's dependents in a way that slowed down every step of the walk. Thanks @inth3shadows for the report and the fix, and @Marcos-199-GitHub for #3285. (#3248)
  • When the CodeGraph server's catch-up sync on a large project is stopped because the tool calls it is serving keep its write-ahead log from shrinking, it now waits before trying again, a little longer each time, instead of starting over every second while you keep working. Thanks @kiliman for the report. (#3273)
  • A CodeGraph MCP server started in a folder with no index no longer starts its separate hang-watchdog process until the session first calls a tool or opens a project, so sessions that only list the tools, as many hosts open them, use less memory. Thanks @AiurArtanis for the report and @johnhldiver-beep for #3257. (#3250)
  • A CodeGraph server whose project folder is deleted, like a removed git worktree, now exits within about half a minute, closing its file watcher and dropping out of the servers codegraph daemon lists, instead of running until its last session ends and it times out. On Windows it also stops keeping that folder's index files from being deleted. Thanks @deniskern for the report and @johnhldiver-beep for #3259. (#3245)
  • codegraph upgrade run from your home folder no longer treats your agents' user-wide setup as a project's: Cursor's CodeGraph server keeps following the workspace you open instead of being pinned to your home folder, and no CodeGraph section is written into ~/AGENTS.md, ~/GEMINI.md or ~/QWEN.md. Thanks @shoma-endo for the report and @b84330808 and @LuisAlbertoMK. (#3234)
  • In OpenCode, CodeGraph's instructions, both the ones its server sends and the section codegraph install writes to OpenCode's AGENTS.md, now name its tools the way OpenCode lists them (codegraph_codegraph_explore), so the agent no longer calls a tool name that doesn't exist. Thanks @expiren for the report. (#1267)
  • codegraph init in a project whose last index run was killed or failed partway now says the index is incomplete and to run codegraph index, instead of "Already initialized", which read like a working setup. Thanks @maxmilian for the report and @LuisAlbertoMK. (#3228)
  • codegraph callers, callees and impact now warn when a file in the answer changed on disk after it was last indexed, as codegraph node and explore already did, so a shifted line number no longer reads as a current one. With --json the warning goes to stderr and the answer lists those files under changedOnDisk. Thanks @arifpambudi242 for the report and @mohitdixit02. (#3260)
  • codegraph status now reports edits, new files and deletions in gitignored source that codegraph.json include brings into the index, instead of calling the index up to date until a sync picked them up. Thanks @mixxer for the report and the pull request. (#3086)
  • On Linux and macOS, when the system kills CodeGraph with a signal, such as when it runs out of memory during codegraph init or codegraph index, the command now says which signal and exits as a shell would (137 for SIGKILL), instead of exiting 1 with no message. Thanks @inth3shadows for the report and @johnhldiver-beep. (#3277)
  • A Spring or Laravel test's request is now linked only to a route of its own app, not to a JavaScript or TypeScript server's route that happens to match the path, so codegraph affected no longer selects Java or PHP tests for a change to your web code. Thanks @jotder for the report. (#3320)

Indexing and sync

  • codegraph sync and the file watcher now follow an edit that adds, removes or repoints a member of an exported object, like export const api = { getUser, saveUser }, so a call such as api.saveUser() in a file the edit didn't touch links to the new member, or back to the object, as a fresh index does. Thanks @inth3shadows for the report. (#3015)
  • A file whose parse never ends, like a .tsx file with a half-typed JSX attribute, no longer keeps codegraph init from exiting or leaves codegraph sync and the file watcher spinning at full CPU: its parse now stops at the file's parse time limit, and the file is listed as a parse that timed out. Thanks @inth3shadows for the report. (#3274)
  • After you upgrade, codegraph status and the first CodeGraph answer in each agent session now flag a project indexed by 1.6.3 or earlier as out of date, since this release reads code those indexes are missing, like Dart primary constructors, Elysia routes, PHP includes built from __DIR__ and the methods of an export default object; run codegraph index in each project to rebuild it. (#3411)

JavaScript and TypeScript

  • JavaScript and TypeScript event handlers registered with on() are now linked only from code that emits on the same emitter, and to the handler defined where they are registered, so two modules that each keep their own emitter and use the same event name no longer cross-link. Thanks @inth3shadows for the report. (#2973)
  • In JavaScript, methods written the classic way, Ctor.prototype.m = function () {…} and a static Ctor.m = function () {…}, are now indexed as methods of their constructor, and the functions of a module.exports = {…} object as that module's exports, so this.m() inside them reaches the constructor's or the object's own m instead of an unrelated function of the same name elsewhere. Thanks @inth3shadows for the report. (#2966)
  • In JavaScript and TypeScript, the functions of an object a module default-exports, like a Vuex store split into actions.js, getters.js and mutations.js (export default { fetchUser() {…} }), are now indexed as default::fetchUser, so codegraph_explore, node, query, callers and impact find them, and a call through the module's default import, this.fetchUser() or a Vuex dispatch('fetchUser') links to them; a Vuex commit now always links to a mutation and a dispatch to an action. Thanks @daniel-luan-tran for the report. (#3393)
  • In JavaScript and TypeScript, this.findAll() in a class that wraps an imported helper of the same name now links to the class's own method instead of the imported helper. Thanks @inth3shadows for the report. (#2954)
  • In JavaScript and TypeScript, a call written on this, like this.cast() or this.validate(), no longer links to a const, a require binding or a function declaration that only shares its name, in the same file or another, because what the call reaches is a property of the object.
  • In TypeScript, a call on a parameter or local named like an import, like stream.write() inside stream(c, async (stream) => …), now goes by that parameter or local, and a method called on an imported function no longer links to the function itself; the same mistake through require was already fixed in 1.6.3. Thanks @inth3shadows for the report. (#2953)
  • In JavaScript and TypeScript, a call to a name that a function around the caller declares for itself, like a helper an inner arrow function calls, now links to that local declaration instead of the file's import of the same name. Thanks @inth3shadows for the report. (#2949)
  • In JavaScript and TypeScript, a call to a helper declared inside a describe(…) block, or any other callback, now links to the helper that block declares instead of a same-named one from another block that happens to sit nearer. Thanks @inth3shadows for the report. (#2944)
  • In JavaScript and TypeScript, a call inside a spread, like <input {...register('email')} /> with register taken from useForm(), no longer links to an unrelated project function that shares the name. Thanks @inth3shadows for the report. (#2962)
  • In JavaScript and TypeScript, a module namespace that another module hands on by name, like zod's import { z } from 'zod' of import * as z from './external'; export { z }, or export * as ns from './schemas', now leads z.string() to what that module exports, as import * as z does, instead of a same-named method elsewhere. Thanks @inth3shadows for the report. (#2951)
  • In JavaScript and TypeScript, an import through a barrel of several export * lines now links to the module that exports the name itself, whichever line comes first, instead of a same-named method of an object another module exports. Thanks @inth3shadows for the report. (#3233)
  • In JavaScript and TypeScript, a method called on a variable that a library call fills in, like const root = createRoot(el) from react-dom, net.createServer() or canvas.getContext('2d'), no longer links to the one project method that happens to share its name. Thanks @inth3shadows for the report. (#2947)
  • In TypeScript, a method called on a variable a class's static factory fills in, like const writer = DatabaseConnection.initialize(path), now links to the method of the class the factory says it returns, instead of a class guessed from the variable's name. Thanks @inth3shadows for the report. (#2946)
  • In TypeScript, a call through an interface's function-typed property, like matcher.snapshot(), no longer links to an unrelated class's method of the same name; a class that implements the interface, or builds it, is still linked. Thanks @inth3shadows for the report. (#3035)
  • In JavaScript and TypeScript, a call two or more fields deep from this, like this.cache.list.push(1) or this.extractor.functionTypes.includes(type), no longer links to an unrelated project method named like JavaScript's own push, includes, has or set, or to a property that merely shares the name. Thanks @inth3shadows for the report. (#2948)
  • In JavaScript and TypeScript, a workspaces entry that points outside the project, like "../shared" in package.json or pnpm-workspace.yaml, no longer makes that folder's package count as part of the project, so a call through an import of it is no longer linked to an unrelated function of yours with the same name. Thanks @bompus for the report and @johnhldiver-beep. (#3093)
  • In JavaScript and TypeScript, a call on a local variable declared after another one in the same statement, like let n = 0, ob = make(), or beside a default in a destructuring, like const { ob = make() } = o, links again when a variable of the same name outside the function holds a library's type, as it did before 1.6.3. Thanks @inth3shadows for the report and @mohitdixit02. (#3293)
  • In JavaScript, a call to a member a required module of your project doesn't have, like utils.missing() after const utils = require('./utils'), no longer links to an unrelated class's method of that name. Thanks @inth3shadows for the report and @johnhldiver-beep. (#3272)
  • A fetch or HTTP-client call to another company's API, like fetch('https://api.github.com/users/…'), no longer links to your own server's route with the same path; a call to localhost, to a host your code fills in, or through a client's base URL still links. Thanks @inth3shadows for the report and @johnhldiver-beep. (#2974)
  • In JavaScript and TypeScript, a call or new of a global, like parseInt(…), new Response(…) or new URL(…), in a module that doesn't import that name no longer links to a same-named export of another file in your project. Thanks @inth3shadows for the report. (#3238)
  • In JavaScript, a require() of a folder by a relative path, like require('..') from a package's tests, now loads the file the folder's package.json names as main, as Node does, so calls through it link to the function that file exports. Before, a folder without an index.js wasn't followed, and the call linked to the variable holding the require() result; on fastify, every test's Fastify() linked to its own test file. Thanks @inth3shadows for the report. (#2964)
  • In JavaScript, a variable that holds what a required module's function returns, like const app = require('./app')(), no longer counts as the module itself, so a call like app.listen() no longer links to the module's factory function, and links to the method of the class the factory returns when that is known. Thanks @inth3shadows for the report. (#2964)
  • In JavaScript and TypeScript, a name imported from a package your package.json doesn't list but your project has installed, like import { useForm } from 'react-hook-form' hoisted to a monorepo's root node_modules, no longer links to an unrelated function of the same name elsewhere in your project (#3271). Re-index JavaScript and TypeScript projects after upgrading.

Python

  • In Python, import time no longer links the importing file to a project function that happens to be named time, so such a function stops listing every file that imports the standard library module among its callers and in its impact. The same goes for json, copy, random, logging and any other module, and for a fallback variable like brotli = None beside a guarded import brotli. Thanks @inth3shadows for the report. (#3239)
  • In Python, a call to a function or method declared with typing.overload, like click's command and prompt, now links to the def that runs instead of the first @overload stub, so the implementation shows its callers and a call path goes on through it. A stub with no implementation below it, as in a Protocol, stays the target, and another library's overload whose bodies all run is left alone. Thanks @inth3shadows for the report and @nilotpal-n7. (#2963)
  • In Python, a call like self.create_app() on an attribute that holds a callable no longer links to a same-named function or variable in another file, nor, when the class sets that attribute itself, to another class's method of that name, so flask's app loading stops showing an example app as its callee. A method the class has, inherits or a subclass overrides still links, as does a function the class stores under that name. Thanks @inth3shadows for the report and @nilotpal-n7. (#2958)
  • In Python, a builtin written bare, like raise TimeoutError(…), class Bad(ValueError) or sorted(rows), no longer links to a project class or function of that name in a file the code doesn't import, so a project's own TimeoutError stops collecting every file that raises the builtin. A name the file defines or imports itself still links. Thanks @inth3shadows for the report. (#3232)
  • In Python, a call of a name the code around it binds itself, like a local flat = lambda …, a parameter, a loop or comprehension variable, a lambda's parameter, or a local or parameter of an enclosing function, no longer links to a module-level function or variable of that name, whether it is in the same file or in one the code never imports. Thanks @inth3shadows for the reports and @johnhldiver-beep. (#3037, #3230, #3231)
  • In Python, a local built from a class through its module, like client = httpx.AsyncClient(), or bound by with or async with … as client, now has that class, so client.get() links to AsyncClient.get instead of the method of a class named like the variable, such as Client.get. A with whose class hands out something else from __enter__, and a class from a module outside your project, still give the local no type. Thanks @inth3shadows for the report and @nilotpal-n7. (#2957)
  • In Python, a method called on a local bound from a call, like made = make(q) or s = store.stage(), now goes by the type the called function or method declares it returns: a Path, a str or another class from outside your project links nothing, where any project method that happened to share the name could, and one of your own classes links its own method even when other classes have one of that name. Thanks @inth3shadows for the reports and @johnhldiver-beep. (#3038, #3240)
  • In Python, a from x import name written inside a function now applies to that function only, so calls of name in the rest of the file reach the file's own def name instead of the imported function, as a wrapper that imports the original it wraps expects. Thanks @inth3shadows for the report. (#3229)

Java, Kotlin, C# and ASP.NET

  • In Java, when two packages declare a class of the same name, a static call, a call on a new object or a call through a variable now reaches the one the calling file can see, including through a wildcard import, and a call written with the package, like com.x.b.Util.log(…), reaches that package's class. Thanks @inth3shadows for the reports and @johnhldiver-beep. (#2976, #3290, #3291)
  • In Kotlin, an extension declared on an import alias of a library type, like fun DeclAlias.pad() after import androidx.compose.ui.Modifier as DeclAlias, now links from calls on that type, whatever name the calling file imports it under. Thanks @mixxer for the report and the pull request. (#3084)
  • In C#, a method called on what a method of the same class returns, like GetMailer().Send(), now links to the method of the type that method is declared to return. Thanks @Gobakabana for the report. (#2906)
  • In ASP.NET Core, attribute routes are now named the way ASP.NET serves them: [controller] and [action] are filled in, each controller uses its own [Route] (or its base controller's), ~/ paths stand alone, and actions marked [HttpHead], [HttpOptions] or [AcceptVerbs], with their own [Route], or in an attribute list are no longer missed. Thanks @Gobakabana for the report. (#2905)
  • In C#, an extension method is now matched by the type its this parameter takes, so "hi".Shout() and mailer.Shout() each reach their own extension, and a call of a string's own method no longer reaches a project extension of the same name. Thanks @Gobakabana for the report. (#2906)
  • In C#, a method called through ?. or !., like _mailer?.Send(), now links to the method of the receiver's type. Thanks @Gobakabana for the report. (#2906)
  • In C#, a method passed or stored as a value through its object, like Task.Run(worker.Run) or Action later = worker.Run;, now counts as a use of that method, so codegraph callers and impact show it. Thanks @Gobakabana for the report. (#2906)
  • In Kotlin, a call named after a modifier keyword at the start of a statement, like annotation("jakarta.persistence.Entity") in a Gradle allOpen { } block or a class's own open(), is now read as the call it is, so a build script made of such calls no longer warns that it contributes nothing to the graph. Thanks @clayly for the report. (#3410)

PHP and Laravel

  • In PHP, a method called on a freshly built object, like (new SettingClient())->getSet(1), now links to the class the file's namespace and use imports name, or to a method it inherits, so these calls show up in callers and impact. Thanks @holysor for the report. (#3244)
  • In Laravel, a route written like [UserController::class, 'show'] now links to the controller the routes file imports, through a plain or aliased use, a group use, an imported namespace or a fully qualified name, instead of a same-named controller elsewhere or nothing. Thanks @inth3shadows for the reports and @johnhldiver-beep. (#2975, #3292)
  • In PHP, a method called in a different letter case than its declaration, like PriceConverter::CalcBasePrice(1) or $c->GetRate() for calcBasePrice and getRate, now links to that method, as PHP reads method names without regard to case, so those calls show up in callers and impact. Thanks @artisanya for the report and @johnhldiver-beep. (#3297)
  • In PHP code written for PHP 7 and older, a string offset in braces, like $code{0}, no longer makes the function or class around it disappear from the index with its calls credited to the file; it now reads like $code[0]. Thanks @artisanya for the report. (#3299)
  • In PHP, a require or include of a file inside a function or method now counts as that function depending on the file, so callers and impact follow code in the included file back to the function and its callers. Thanks @artisanya for the report. (#3296)
  • In PHP, an include built from the file's own directory, like require_once __DIR__ . '/inc/a.php' or dirname(__FILE__) . '/inc/b.php', now links to that file the way a plain require_once 'lib.php' does, and a path starting with ./ or ../ links only to the file named exactly, as PHP loads it, never one with .php added. Thanks @artisanya for the report and @inth3shadows. (#3298)

Rust

  • In Rust, a call through a module that a glob use brings in, like gzip::write() in a test module with use super::*, or that a use inside the function names, now links to that module's function again. Thanks @Egrn for the report and @mohitdixit02. (#3253)
  • In Rust, codegraph_explore's blast radius now recognizes unit tests in a #[cfg(test)] module or a tests.rs file, instead of reporting "no tests found" for the functions they test. Thanks @moogiemode for the report and @maxmilian. (#3265)
  • In Rust, a function or method passed as a value through its path, like g.map(Graph::counts) or .map(Self::helper), now counts in its callers and impact the way a function passed by name already did, linked only when the path names it for certain: never another type's method of the same name, and never a method of a trait implementation, since which one Rust uses there depends on the type of the argument. Thanks @Egrn for the report and @inth3shadows. (#3254)
  • In Rust, a call on a value whose type comes from outside your project, like an outside crate's builder chain or stdout.flush(), no longer links to one of your methods that only shares its name, such as your own impl Write's write and flush or an associated function like Graph::build(n), and Rules::default() on a #[derive(Default)] type no longer links to another type's default. Thanks @Egrn for the report. (#3252)
  • In Rust, a call written in the arguments of format!, println!, write!, assert_eq!, vec!, matches! or serde_json's json! now links to the function or method it calls, as the same call outside the macro does, and a variant in a matches! pattern now counts as a use of its enum. Thanks @Egrn for the report. (#3251)

Go, Swift, Dart, C and C++

  • A C++ .h header that only declares functions and extern variables, with no class, namespace or template in it, is now read as C++ when it uses a template type like CComPtr<IDiaDataSource>, a reference parameter like bstr_t& path or const qstring &name, or a default argument like int depth = 0, instead of as C, which dropped its symbols and warned "parse produced no symbols (tree has errors)". Thanks @sonyps5201314 for the report. (#3397)
  • In Swift, a type no longer picks up the inheritance of a type nested inside it, which linked a name used in the type to an unrelated type's nested type and put it in the wrong impact results. Thanks @bob-codedaptive for the report and @remote-controlled-man. (#3213)
  • In Go, a method called on new(T) or make(T) now links to that type's method, not a same-named method of another type that happened to be found first. Thanks @inth3shadows for the report. (#3237)
  • In Swift, an if or while whose condition is try await f() no longer breaks the method around it: the next member landed inside that method, and calls were recorded under names made of source text. Swift files are now read with a newer Swift grammar, which also parses more Swift 6 code without errors. Thanks @bob-codedaptive for the report. (#3212)
  • In Dart, a class declared with a Dart 3.13 primary constructor, like class Point(final int x, final int y) {…} or class const Foo({required final int a}), is now indexed under its own name with its members, where it had been named const or dropped with the rest of its file; Dart files are now read with a newer Dart grammar, which also parses dot shorthands and other recent Dart syntax without errors. Thanks @cutehackers for the report. (#3270)

Don't miss a new codegraph release

NewReleases is sending notifications on new releases.