You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codex CLI gets CodeGraph context on your prompt.codegraph install now offers Codex the prompt hook Claude Code has: ask how something works or what a change affects, and Codex is handed the relevant code before it picks a tool. Open Codex and type /hooks once after installing to review it.
Settings and translation keys can be found. In JavaScript and TypeScript, a field of an object is found by its name, by a word of its name, or by the comment above it, and codegraph_explore answers with the lines around it. This holds for a const, a default export, module.exports, an object handed to a call such as defineConfig({…}), and a class property. These used to answer "No relevant code found" for code that was there.
A setting is shown beside the code that uses it. Ask session idle and you get the function and the sessionIdleMinutes setting, where you used to get the function alone.
Quicker answers about very large classes and objects. A question that lands on a class of 10,000 methods is answered in about a third of the time.
A slow tool call says what it was doing. A "busy" answer now tells you whether the call was waiting for a free worker or had been running the whole time, and the server's log records where a slow call's time went.
Upgrading: re-index your projects with codegraph index after this release. Fields become findable when a project's files are indexed again.
New Features
Codex CLI can get CodeGraph context on your prompt, as Claude Code does. With Codex chosen, codegraph install offers a prompt hook: when you ask how something works, where it is or what a change affects, Codex is given the relevant code from your index before it picks its first tool. Codex runs a new hook only after you have reviewed it, so open Codex and type /hooks once after installing. Your other Codex hooks are kept, and codegraph uninstall removes only this one. Thanks @flipcyde101 for the request and a first implementation. (#3335)
Fixes
In JavaScript and TypeScript, a field of a settings-style object can now be found: by its name, by a word of its name, and by the comment above it. CodeGraph kept only the first 100 characters of such an object for search, so asking for a field written further down, or for a word of its comment, answered "No relevant code found" for code that was there. codegraph_explore now answers with the lines around the field, nested objects included, through as const and satisfies. The object can be a const, a default export (export default {…}, as a file of messages is written), module.exports = {…}, an object handed to a call (export default defineConfig({…}), defineStore('cart', {…})), or a property of a class. It also shows the field beside a function your question matches when the question names the field or says two words of its name, where it used to show the function alone, and does the same for a class property or an interface member the question names (BATCH_SIZES). codegraph_search and codegraph query list the field with its file and line, and codegraph_node shows it. A field with a comment is a symbol in the index (SETTINGS.sessionIdleMinutes). One without is found from a list of names kept with its object, which costs about 25 bytes a field where a symbol costs a thousand. codegraph_explore also finds an interface member or a class field by a word of its comment when nothing else matches. Run codegraph index to pick this up in a project indexed earlier. Thanks @easonlao for the report and @danusha2345 for a first implementation. (#3408)
codegraph_explore no longer reads every member of a very large class or object to answer a question that lands on it. Walking out from a match, it read all of a declaration's members and kept a handful: the lookup behind a question that landed on a class of 10,000 methods took 59 ms and now takes 21. The answers are the same. (#3408)
A long value cut short for display no longer ends in half a character. A constant shows the first 100 characters of its value. When the cut fell in the middle of an emoji, one of CodeGraph's two extractors kept half of it, which is stored as a replacement mark, and the other dropped it and left out the ... that says the value goes on, so the same file could be indexed two ways. Both now stop before the character and mark the cut. This holds for every length-limited value in every language. (#3408)
The CodeGraph server's query workers now open the index read-only. They opened it for writing, so a worker that started while an index was being built or rebuilt could "repair" it part way through: rebuild the search table and put back indexes the build had set aside for speed. Repairs are the writer's job, and stay with it. (#3286)
When a tool call such as codegraph_explore is answered "busy" after 45 seconds, the message now says which it was: the call was still waiting for a free worker, or a worker had been running it all that time. It used to say "waited in the queue" for both, which sent people looking for traffic when the query itself was slow. The server's log (.codegraph/daemon.log) also gets one line for any call slower than 10 seconds, with how long it waited and how long it ran, and one when a call finishes after its caller stopped waiting. A tool's name is logged, never its arguments. Thanks @shenyiheyi for the report and the measurements. (#3286)