add-lang
Skill73k starsChanged 4 months agoMITView on GitHub
Add tree-sitter language support to codegraph end-to-end — wire the grammar + extractor, write tests, then benchmark extraction quality and retrieval value on 3 popular real-world repos. Use when the user runs /add-lang <language> or asks to add/support a new language (e.g. Lua, Elixir, Zig, OCaml) in codegraph.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about colbymchenry/codegraph
- @midu.dev“¡No quemes tokens con tu IA explorando tu proyecto! Crea un grafo semántico local de tu código con esto ✓ …”Bluesky · May 18, 2026 · 12 likes
- @novica.bsky.social“hey #rstats is anyone working R support for github.com/colbymchenry... ?”Bluesky · May 22, 2026 · 9 likes
- headroomlabs-ai/headroom“[FEATURE] Support codegraph as an alternative code-graph backend”GitHub · Jun 15, 2026 · 8 reactions
- @alexiskirke.bsky.social“I came across this impressive open-source project on GitHub that helps AI coding agents work faster and …”Bluesky · May 25, 2026 · 7 likes
- @zottmann.dev“#WorksWellForMe: For code exploration tasks, when you tell your agent to clone a repo in a temp folder, …”Bluesky · Sep 29, 2026 · 5 likes
The biggest 5 of 88 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 88
Talked about on GitHub, Bluesky and Hacker News (88 times).
On GitHub · 50
- Jun 15, 2026[FEATURE] Support codegraph as an alternative code-graph backend — headroomlabs-ai/headroom8 reactions · 2 comments
- May 19, 2026feat: support CodeGraph as optional repo exploration helper — Gentleman-Programming/gentle-ai2 reactions · 1 comment
- Nov 30, 2026codegraph 1.6.6 — chenrui333/homebrew-tap1 reaction · 1 comment
- Nov 28, 2026codegraph 1.6.5 — chenrui333/homebrew-tap1 reaction · 1 comment
- Nov 22, 2026codegraph 1.6.4 — chenrui333/homebrew-tap1 reaction · 1 comment
45 more on GitHub
- Nov 17, 2026codegraph 1.6.3 — chenrui333/homebrew-tap1 reaction · 1 comment
- Jul 27, 2026codegraph: 1.4.1 -> 1.5.0 — NixOS/nixpkgs1 reaction
- Jul 7, 2026feat: Add codegraph — appium/appium-ios-remotexpc1 reaction · 1 comment
- Jul 3, 2026Built-in graph-based code intelligence backend for dependency, call-chain, and impact queries — can1357/oh-my-pi1 reaction · 12 comments
- Jun 17, 2026Add compare table with `codegraph` — defendend/Claude-ast-index-search1 reaction · 1 comment
- Jun 15, 2026feat(codegraph): add CodeGraph local code-intelligence plugin — pleaseai/claude-code-plugins1 reaction · 4 comments
- May 29, 2026codegraph: init at 0.9.7 — numtide/llm-agents.nix1 reaction
- May 26, 2026fix(codegraph): verify MCP server is registered for the launched CLI — jasmedia/cc-pr-reviewer1 reaction · 2 comments
- May 25, 2026feat(codegraph): integrate CodeGraph MCP server to cut review token usage — jasmedia/cc-pr-reviewer1 reaction · 1 comment
- May 20, 2026CommandCode terminal freezes entirely + flickering on large output — CommandCodeAI/command-code1 reaction · 5 comments
- May 18, 2026Add Claude PR review workflow — cowprotocol/services1 reaction · 1 comment
- May 10, 2026Tools Comparisons alternatives — jgravelle/jcodemunch-mcp1 reaction · 6 comments
- Nov 30, 2026Feature: `xerj init` writes MCP config for OpenCode, Gemini CLI, Qwen Code, Kiro and Factory Droid — xerj-org/xerj0 reactions
- Nov 30, 2026agent-skills.github.colbymchenry.codegraph: 1.6.5 → 1.6.6 — sudosubin/agents.nix0 reactions
- Nov 30, 2026chore(deps-dev): bump @colbymchenry/codegraph from 1.6.2 to 1.6.4 — afframe/afframe0 reactions
- Nov 29, 2026Repo: colbymchenry/codegraph — the-book-of-ai/source0 reactions
- Nov 28, 2026agent-skills.github.colbymchenry.codegraph: 1.6.4 → 1.6.5 — sudosubin/agents.nix0 reactions
- Nov 28, 2026Bump @colbymchenry/codegraph from 1.6.3 to 1.6.4 — hananbo/kids0 reactions
- Nov 26, 2026A failed or junk scrape writes a permanent near-empty wiki page, deletes the inbox item and marks the URL processed, so it is never retried — bamaas/LucidVault0 reactions · 1 comment
- Nov 26, 2026setup codegraph or PyCharm MCP service — ksw1984/home-energy-monitoring0 reactions
- Nov 25, 2026build(deps): bump @colbymchenry/codegraph from 1.6.2 to 1.6.4 — SeriousJul/pi-extensions0 reactions
- Nov 24, 2026评估代码检索优先使用本地符号索引以降低 Embedding 成本 — yusixian/hanori0 reactions
- Nov 23, 2026Context tool scout: 2026-11-23 — sturdynut/Ullage0 reactions
- Nov 23, 2026chore(deps): bump the tooling group across 1 directory with 2 updates — elvinzhao10/LazyBuddy0 reactions
- Nov 23, 2026build(deps): bump the tooling group across 1 directory with 2 updates — elvinzhao10/LazyZCode0 reactions · 1 comment
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/yugioh-25d-holograms0 reactions · 4 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/yomi-no-kage0 reactions · 4 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/yautja-apex-hunt0 reactions · 4 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/vitrineverse0 reactions · 4 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/veilbound-les-visages-du-monde-brise0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/the-house-of-the-dead-25d0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/The-Horde-The-Last-Stand0 reactions · 4 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/terra-testudo-les-mondes-dos0 reactions · 6 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/son-of-a-legacy-forge0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/silent-hill-halo-of-flesh0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/resident-evil-bow-protocol0 reactions · 6 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/Parallaxe_Protocole90 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/media-gatherer0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/mecha-overdrive0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/massilia-cyberpunk0 reactions · 3 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/Mass-Effect-Relay-Chronicles0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/jingle-duel0 reactions · 4 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/jigsaw-mastermind0 reactions · 5 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/Franchise-Guide0 reactions · 3 comments
- Nov 22, 2026chore(ai): CodeGraph avec les skills existants — darknigthmare/fallout-Marseille0 reactions · 5 comments
On Bluesky · 36
- May 18, 2026¡No quemes tokens con tu IA explorando tu proyecto! Crea un grafo semántico local de tu código con esto ✓ -92% tool calls ✓ 71% más rápido… — @midu.devsays it tested it12 likes and reposts · 4 replies
- May 22, 2026hey #rstats is anyone working R support for github.com/colbymchenry... ? — @novica.bsky.social9 likes and reposts · 2 replies
- May 25, 2026I came across this impressive open-source project on GitHub that helps AI coding agents work faster and cheaper with local project-scoped… — @alexiskirke.bsky.social7 likes and reposts · 2 replies
- Sep 29, 2026#WorksWellForMe: For code exploration tasks, when you tell your agent to clone a repo in a temp folder, also tell it to init codegraph in… — @zottmann.dev5 likes and reposts · 1 reply
- May 25, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 colbymchenry / codegraph ⭐ 21,173 (+2,993) 🗒 TypeScript Pre-indexed code knowledge graph for Claude… — @github-trending.bsky.social5 likes and reposts · 1 reply
31 more on Bluesky
- May 6, 2026Reduce token & tool calls from 26-52 to 1-6 calls, faster 43-82%. When #codeagent explores your codebase query code #graph instead of… — @qdrddr.bsky.socialsays it tested it4 likes and reposts · 1 reply
- May 21, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 colbymchenry / codegraph ⭐ 7,633 (+1,850) 🗒 TypeScript Pre-indexed code knowledge graph for Claude… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- May 16, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 colbymchenry / codegraph ⭐ 2,110 (+397) 🗒 TypeScript Pre-indexed code knowledge graph for Claude… — @github-trending-js.bsky.social3 likes and reposts · 1 reply
- Nov 22, 2026📦 colbymchenry / codegraph ⭐ 78,382 (+86) 🗒 TypeScript Pre-indexed code knowledge graph, auto syncs on code changes, for Claude Code,… — @github-trending-js.bsky.social2 likes and reposts
- Nov 19, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 colbymchenry / codegraph ⭐ 77,940 (+129) 🗒 TypeScript Pre-indexed code knowledge graph, auto syncs on… — @github-trending-js.bsky.social2 likes and reposts
- Jun 27, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 colbymchenry / codegraph ⭐ 55,237 (+388) 🗒 TypeScript Pre-indexed code knowledge graph, auto syncs… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- Jun 17, 2026CodeGraph parses your repo with tree-sitter into a local SQLite graph served over MCP, so agents query callers, callees, and impact instead… — @jeremymorgan.com2 likes and reposts · 1 reply
- Jun 9, 2026codegraphの「コードベースを地図化してAIコーディングを軽くする」、ここはかなり筋がいいです🌿 https://x.com/so_ainsight/status/2058518896907538932… — @mint-echosphere.bsky.social2 likes and reposts · 1 reply
- May 25, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 colbymchenry / codegraph ⭐ 20,919 (+2,993) 🗒 TypeScript Pre-indexed code knowledge graph for Claude… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- May 22, 2026📈 Today's GitHub Trending: 1. https://github.com/anthropics/claude-plugins-official - Python, 2556 stars today 2.… — @ghtrend.newsmast.social.ap.brid.gy2 likes and reposts
- May 16, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 colbymchenry / codegraph ⭐ 2,109 (+397) 🗒 TypeScript Pre-indexed code knowledge graph for Claude… — @github-trending.bsky.social2 likes and reposts · 1 reply
- Nov 26, 2026📦 colbymchenry / codegraph ⭐ 78,761 (+89) 🗒 TypeScript Pre-indexed code knowledge graph, auto syncs on code changes, for Claude Code,… — @github-trending-js.bsky.social1 likes and repost
- Oct 31, 2026Index a small repo with CodeGraph, ask an agent to trace a call chain, compare against your IDE’s references. Fifteen minutes to know if… — @jeremymorgan.com1 likes and repost · 2 replies
- Oct 24, 2026Give your AI coding agent a pre-built map of your codebase: fewer tokens, fewer tool calls, 100% local. 🔗… — @prosperflowio.bsky.social1 likes and repost
- Jun 12, 2026しかも導入はタダの要約じゃない。`codegraph install` → 各プロジェクトで `codegraph init -i`、その後は file watcher で index を auto-sync。… — @mel-echosphere.bsky.social1 likes and repost
- Jun 12, 2026`codegraph`、`100% local` は本当だ。READMEにもそう書いてある。 元: https://x.com/so_ainsight/status/2058518896907538932 一次:… — @mel-echosphere.bsky.socialsays it tested it1 likes and repost · 1 reply
- Jun 3, 2026CodeGraph : un knowledge graph pré-indexé de votre codebase pour Claude Code, Cursor ou Codex. Résultat mesuré sur 7 projets réels — 35%… — @camilleroux.comsays it tested it1 likes and repost
- May 31, 2026「AIコーディングが35%安く、ツール呼び出し70%減、100%ローカルで情報も外に出ない」——codegraphが★3.4万に急上昇している。 https://x.com/opensourcelab9/status/2060602106432901196… — @sara-echosphere.bsky.socialsays it tested it1 likes and repost · 1 reply
- May 24, 2026GitHub - colbymchenry/codegraph: Pre-indexed code knowledge graph for Claude Code, Codex, Cursor, OpenCode, and Hermes Agent — fewer… — @tech-trending.bsky.social1 likes and repost · 1 reply
- May 23, 2026📈 Today's GitHub Trending: 1. https://github.com/Lum1104/Understand-Anything - TypeScript, 2331 stars today 2.… — @ghtrend.newsmast.social.ap.brid.gy1 likes and repost · 1 reply
- May 22, 2026ai ml / GitHub Trending: GitHub - colbymchenry/codegraph: Pre-indexed code kno... For engineers using AI coding agents on large codebases,… — @foursignalsdev.bsky.social1 likes and repost
- May 21, 2026Knowledge graph for your agents is a very cool ideas 🔥 https://github.com/colbymchenry/codegraph — @apvarun.com1 likes and repost
- May 21, 2026📈 Today's GitHub Trending: 1. https://github.com/anthropics/claude-plugins-official - Python, 891 stars today 2.… — @ghtrend.newsmast.social.ap.brid.gy1 likes and repost · 1 reply
- May 21, 2026💎 Hidden Gem! 💎 (1000+ new stars) 📦 colbymchenry / codegraph ⭐ 7,633 (+1,850) 🗒 TypeScript Pre-indexed code knowledge graph for Claude… — @github-trending.bsky.social1 likes and repost · 1 reply
- May 20, 2026📈 Today's GitHub Trending: 1. https://github.com/colbymchenry/codegraph - TypeScript, 1910 stars today 2.… — @ghtrend.newsmast.social.ap.brid.gy1 likes and repost · 1 reply
- May 16, 2026codegraph pre-indexes your codebase into a local knowledge graph for Claude Code — so it spends fewer tokens and tool calls hunting for… — @mahdi-17.bsky.social1 likes and repost · 1 reply
- May 14, 2026Claude Codeの探索を効率化するローカル専用のコードナレッジグラフツールらしい AIのコード理解を深めて作業を高速化したいときに試したい yug1224 starred colbymchenry/codegraph… — @yug1224.com1 likes and repost
- May 8, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 colbymchenry / codegraph ⭐ 1,045 (+148) 🗒 TypeScript Pre-indexed code knowledge graph for Claude Code… — @github-trending-js.bsky.social1 likes and repost
- Oct 30, 2026Blast radius of a code change is a graph problem. CodeGraph builds an AST-derived graph of symbols, calls, and imports, then exposes it to… — @jeremymorgan.com0 likes and reposts · 1 reply
- Jun 12, 2026同じ README の benchmark、平均は `47% fewer tokens` `58% fewer tool calls`。そこは効いてる。 でも cost は `16% cheaper` 止まりで、Excalidraw と Tokio は `even`… — @mel-echosphere.bsky.social0 likes and reposts · 1 reply
- May 28, 2026💎 README原文:"CodeGraph only helps when queried directly — otherwise a sub-agent reads files regardless and CodeGraph becomes overhead."… — @nemu-echosphere.bsky.social0 likes and reposts · 1 reply
On Hacker News · 2
- Jul 26, 2026Codegraph5 points
- May 24, 2026Supercharge Claude Code, Cursor, Codex with Semantic Code Intelligence1 point · 2 comments
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/codegraph.mdcCursor rule
- agent-evalSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 1 is distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Run from the codegraph repo root.
- Very specific: line 41
Check whether the language is already wired: look for the token in the LANGUAGES const (src/types.ts) and the EXTRACTORS map …
- Very specific: line 97
add '<lang>', to the LANGUAGES const (before 'unknown').
- Very specific: line 98
add '/*.<ext>', to DEFAULT_CONFIG.include.
- Very specific: line 105
vendored only: add <lang> to the (lang === 'pascal' || lang === 'scala' || …) wasm-path branch.
- Very specific: line 145
Add to __tests__/extraction.test.ts, modeled on the Rust Extraction block:
- Very specific: line 179
Read each parse-run.mjs summary printed by run-all.sh: tool calls, file Reads, Grep/Bash, codegraph-tool calls, duration, and cost — for …
- Very specific: line 186
README.md: add <Lang> to the "19+ Languages" feature bullet, and add a row to the Supported Languages table: | <Lang> | \.ext\ | Full …
- Very specific: line 189
CHANGELOG.md: add an ## [Unreleased] section at the top (above the latest version) with ### Added → a user-perspective bullet, e.g.
- Distinctive: line 218
If a grammar can't be obtained, or extraction can't reach PASS, STOP and report — don't ship a half-wired language.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Add a language to CodeGraph
Wire a new tree-sitter language into codegraph's extraction pipeline, prove it extracts real symbols on popular repos, and prove it beats no-codegraph for an agent. Runs fully autonomously — pick repos, benchmark, update docs, then report. Never commit, push, publish, or tag (house rule); leave all changes for the user to review.
The argument is the language token used throughout the Language union, e.g.
lua, elixir, zig. If none was given, ask which language. Use the lowercase
single-token form everywhere (csharp, not c#).
Prerequisites
- Run from the codegraph repo root.
node,git,gh, and a logged-inclaudeCLI (the benchmark spawns realclaude -pruns). - The benchmark uses the local dev build — Step 8 builds + links it on PATH.
Workflow
Copy this checklist and work through it in order:
- [ ] 1. Resolve language; bail early if already supported (just benchmark)
- [ ] 2. Find a grammar + health-check it (ABI / heap corruption)
- [ ] 3. Discover the grammar's AST node types (dump-ast.mjs)
- [ ] 4. Wire the language (4 files; sometimes a 5th core touch)
- [ ] 5. Build + verify-extraction loop until PASS
- [ ] 6. Add extraction tests; make them green
- [ ] 7. Auto-pick 3 popular repos by size tier; add to corpus.json
- [ ] 8. Benchmark all 3: extraction + with/without A/B
- [ ] 9. Update README + CHANGELOG
- [ ] 10. Report; do NOT commitStep 1 — Resolve + short-circuit
Check whether the language is already wired: look for the token in the
LANGUAGES const (src/types.ts) and the EXTRACTORS map
(src/extraction/languages/index.ts). If it is already supported (e.g.
typescript, rust), skip Steps 2–6 and go straight to benchmarking
(Steps 7–8) to validate/measure it — note in the report that no code changed.
Step 2 — Find a grammar, then health-check it
ls node_modules/tree-sitter-wasms/out/ | grep -i <lang> # csharp -> c_sharp- Present → likely off-the-shelf;
grammars.tsresolves it fromtree-sitter-wasmsautomatically. (Many languages: elixir, zig, ocaml, solidity, toml, yaml, …) - Absent → vendor a
.wasmintosrc/extraction/wasm/(likepascal/scala/lua) and add the token to the vendored branch in Step 4.
Always health-check before writing an extractor — a present grammar can still be unusable:
node scripts/add-lang/check-grammar.mjs <lang> path/to/valid-sample.<ext>It prints the grammar's ABI version and parses a valid sample many times in a multi-grammar runtime. If it FAILs (ERROR trees on valid code — an old ABI corrupting the shared WASM heap, which silently drops nested calls/imports on every file after the first; e.g. the tree-sitter-wasms Lua grammar is ABI 13 and fails), do NOT use that wasm. Vendor a newer (ABI 14/15) build instead:
npm pack @tree-sitter-grammars/tree-sitter-<lang> # often ships a prebuilt *.wasm
# or build one: npx tree-sitter build --wasm (needs Docker/emscripten)
cp <the>.wasm src/extraction/wasm/tree-sitter-<lang>.wasmthen add the token to the vendored branch in Step 4 and re-run check-grammar on the vendored path until it PASSes. If you cannot obtain a healthy wasm, STOP and tell the user.
Step 3 — Discover AST node types
Get a representative source file (write a small sample covering functions,
classes/structs, imports, enums; or curl a raw file from a known repo), then:
node scripts/add-lang/dump-ast.mjs <lang> path/to/sample.<ext>
# vendored grammar: pass the wasm path instead of the token
node scripts/add-lang/dump-ast.mjs src/extraction/wasm/tree-sitter-<lang>.wasm sample.<ext>The frequency table + field names (name:, parameters:, body:,
return_type:) tell you what to map. Open the existing extractor closest to the
language's paradigm as a model: rust.ts/scala.ts (functional, traits),
java.ts/csharp.ts (OO), python.ts/ruby.ts (scripting), go.ts
(top-level methods + receivers).
Step 4 — Wire the language (4 files)
These are exact, fragile wiring — match the existing style precisely:
src/types.ts— TWO edits:- add
'<lang>',to theLANGUAGESconst (before'unknown'); - add
'**/*.<ext>',toDEFAULT_CONFIG.include. Don't skip this — it's the file-scan allowlist; without the glob,codegraph initfinds 0 files even though detection/extraction are wired.
- add
src/extraction/grammars.ts— three maps:WASM_GRAMMAR_FILES:<lang>: 'tree-sitter-<lang>.wasm',EXTENSION_MAP: each file extension →'<lang>'(e.g.'.lua': 'lua',)getLanguageDisplayName:<lang>: '<Display Name>',- vendored only: add
<lang>to the(lang === 'pascal' || lang === 'scala' || …)wasm-path branch.
src/extraction/languages/<lang>.ts— new file exportingexport const <lang>Extractor: LanguageExtractor = { … }. Map the node types from Step 3. Required fields:functionTypes,classTypes,methodTypes,interfaceTypes,structTypes,enumTypes,typeAliasTypes,importTypes,callTypes,variableTypes,nameField,bodyField,paramsField. Add hooks as the grammar needs them (getSignature,getVisibility,isExported,extractImport,visitNode,getReceiverType,interfaceKind,enumMemberTypes, etc. — seesrc/extraction/tree-sitter-types.ts).src/extraction/languages/index.ts—import { <lang>Extractor } from './<lang>';and add<lang>: <lang>Extractor,toEXTRACTORS.
Sometimes a 5th, core touch in src/extraction/tree-sitter.ts — variable
extraction has per-language branches in extractVariable (the generic fallback
only finds direct identifier/variable_declarator children). If the grammar
nests declared names (e.g. Lua's variable_declaration → variable_list), add a
} else if (this.language === '<lang>') branch there, mirroring the existing
ts/python/go ones. Import forms that aren't a distinct node (Lua/Ruby require
is a call) are handled in the extractor's visitNode hook instead.
Step 5 — Build + verify loop
npm run build # tsc + copy-assets (copies any vendored *.wasm into dist/)Index a small sample repo and check extraction:
( cd <sample-repo> && codegraph init -i )
node scripts/add-lang/verify-extraction.mjs <sample-repo> <lang>verify-extraction.mjs fails (exit 1) if the language isn't detected or only
file/import nodes were produced — the classic symptom of wrong node-type
names. On FAIL or a thin WARN: re-run dump-ast.mjs on a richer file, fix the
mappings in <lang>.ts, npm run build, re-index, re-verify. Repeat until
PASS.
Step 6 — Tests
Add to __tests__/extraction.test.ts, modeled on the Rust Extraction block:
- a
detectLanguageassertion indescribe('Language Detection') - a
describe('<Lang> Extraction')block asserting functions/classes/imports are extracted from an inline source string.
npx vitest run __tests__/extraction.test.tsGreen before continuing.
Step 7 — Auto-pick 3 repos + corpus
Pick without asking. Find candidates, then curate 3 that are genuinely
<lang>-dominant, one per size tier:
gh search repos --language=<lang> --sort=stars --limit 40 \
--json fullName,stargazerCount,descriptionTiers (match corpus.json): Small <~150 files · Medium ~150–1500 ·
Large >~1500. Skip repos that are tagged <lang> but mostly another
language. Write one cross-file architecture question per repo (the kind that
needs tracing across files). Add a "<Language>" block to
.claude/skills/agent-eval/corpus.json (fields: name, repo, size,
files, question) so /agent-eval can reuse them.
Step 8 — Benchmark all 3 (extraction + A/B)
Make the dev build the codegraph on PATH once, then loop:
npm run build && ./scripts/local-install.sh
scripts/add-lang/bench.sh <lang> <name> <url> "<question>" headless # ×3bench.sh clones (shared /tmp/codegraph-corpus), wipes + indexes, runs
verify-extraction.mjs, then the with/without retrieval A/B via
scripts/agent-eval/run-all.sh (skips the paid A/B if extraction is broken).
Read each parse-run.mjs summary printed by run-all.sh: tool calls, file
Reads, Grep/Bash, codegraph-tool calls, duration, and cost — for both the
with and without arms. After the loop, restore the dev link if needed:
./scripts/local-install.sh.
Step 9 — Docs + CHANGELOG
- README.md: add
<Lang>to the "19+ Languages" feature bullet, and add a row to the Supported Languages table:| <Lang> | \.ext` | Full support (classes, methods, …) |`. - CHANGELOG.md: add an
## [Unreleased]section at the top (above the latest version) with### Added→ a user-perspective bullet, e.g. "CodeGraph now indexes<Lang>(.ext) — functions, classes, imports, and call edges." If## [Unreleased]already exists, append under it. (It's folded into the next versioned block at release time.)
Step 10 — Report (do NOT commit)
Summarize for review:
- Files changed: the 4 wiring edits + new extractor + tests + README +
CHANGELOG + corpus.json (+ any vendored
.wasm). - Extraction per repo: files / nodes / edges /
verify-extractionresult. - A/B per repo:
withvswithout(tool calls, file Reads, cost) and a one-line verdict — did codegraph reduce effort, and did both arms reach a correct answer? - Gaps / follow-ups (node types not yet mapped, resolution edges missing, framework routes, etc.).
Hand the changes to the user. Do not run git commit/push or publish —
releases go through the GitHub Actions Release workflow.
Notes
- The A/B spawns real paid
claude -pruns (opus,--max-budget-usd), 2 arms × 3 repos. The corpus dir/tmp/codegraph-corpusis shared with/agent-eval, so clones are reused across runs. - Any new
*.wasmmust live insrc/extraction/wasm/—copy-assets(run bynpm run build) ships it; otherwise it won't be indist/. - An index must be served by the same binary that built it. Step 8 builds + links the dev build first, so this holds.
- If a grammar can't be obtained, or extraction can't reach PASS, STOP and report — don't ship a half-wired language.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

