- Go 100%
R1 — Add jsBuiltins and pyBuiltins maps in detectRemovedSymbols; language
detected from file extension. Eliminates false positives on parseFloat,
isNaN, and ~60 other JS/Node/test-framework globals; ~40 Python builtins.
R2 — New graph.EnclosingSymbol() heuristic (nearest named function at or
before line in same file). Anonymous callers/callees in ogr_usage and
ogr_context now include enclosing_symbol field when kind=="anonymous".
R3 — ogr_context accepts depth and limit params (same defaults/clamping as
ogr_usage). Passes them through to graph.Usage() instead of hardcoding.
R4 — testRefs SQL extended to match .test.*, .spec.*, and __tests__/ path
conventions used by Jest/Vitest in addition to existing _test pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
||
|---|---|---|
| .github/workflows | ||
| .processdocs | ||
| cmd | ||
| internal | ||
| .gitignore | ||
| .goreleaser.yaml | ||
| .ographle.toml | ||
| CLAUDE.md | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
Ographle
Exact, minimal code context for coding agents.
Ographle (ographle) parses your codebase via Tree-sitter and LSP, stores a dependency graph in SQLite, and exposes it through a CLI and an MCP stdio server. Cuts agent context-gathering from 26–52 filesystem reads down to 1–6 graph queries.
- Combines Tree-sitter AST with live LSP semantics
- Incremental indexing — only re-parses changed files
- Detects cross-file inconsistencies (signature mismatches, removed symbols, duplicate definitions)
- MCP server for direct integration with Claude Code and other MCP clients
Install
Go install
Requires Go 1.22+ and a C compiler (GCC/Clang) for CGO.
go install codeberg.org/teleyos/ographle@latest
Binary (Linux)
Download the latest release from codeberg.org/teleyos/ographle/releases, extract, and move to your PATH:
tar -xzf ographle_<version>_linux_amd64.tar.gz
mv ographle /usr/local/bin/
Build from source
git clone https://codeberg.org/teleyos/ographle
cd ographle
go build -o ographle .
mv ographle /usr/local/bin/
Shell completions
ographle completion bash >> ~/.bashrc
ographle completion zsh >> ~/.zshrc
ographle completion fish > ~/.config/fish/completions/ographle.fish
Quick start
cd myproject
ographle init # scaffold .ographle.toml, auto-detects languages
ographle lsp install --all # install LSP servers for detected languages
ographle index # build the graph
ographle usage main.go:42 # show call graph context around a symbol
ographle search "parseConfig" # full-text search over symbol names
Run ographle watch in a separate terminal to keep the graph updated as you edit files.
Config
ographle init generates .ographle.toml. Edit it to add or remove languages:
[db]
path = ".ographle/graph.db"
[[languages]]
extensions = [".go"]
lsp = "gopls"
[[languages]]
extensions = [".ts", ".tsx", ".js", ".jsx"]
lsp = "typescript-language-server"
lsp_args = ["--stdio"]
Supported LSPs (built-in registry): gopls, typescript-language-server, pylsp, rust-analyzer, clangd, lua-language-server, zls
Custom registry entries can be added directly in .ographle.toml.
Commands
ographle index
Build or update the code graph.
| Flag | Default | Description |
|---|---|---|
--full |
false | Ignore file cache, reindex everything |
--path <dir> |
cwd | Root directory to index |
ographle usage <file:line:col\|symbol>
Show call graph context around a symbol.
| Flag | Default | Description |
|---|---|---|
--depth <int> |
2 | Max traversal depth |
--limit <int> |
20 | Max nodes returned |
--ignore-assigns |
false | Skip assignment edges |
--include-docs |
false | Include docstrings |
--format <text|json> |
text | Output format |
ographle search <term>
Full-text search over symbol names and docs.
| Flag | Default | Description |
|---|---|---|
--limit <int> |
20 | Max results |
--format <text|json> |
text | Output format |
ographle verify [file]
Run LSP diagnostics on a file. Exits with code 1 if errors are found.
| Flag | Default | Description |
|---|---|---|
--format <text|json> |
text | Output format |
ographle inconsistencies
Detect cross-file inconsistencies: removed symbols, argument mismatches, duplicate definitions.
| Flag | Default | Description |
|---|---|---|
--since <git-ref> |
— | Limit to files changed since ref (e.g. HEAD~1) |
--format <text|json> |
text | Output format |
Exits with code 1 if issues are found.
ographle watch
Watch files and keep the graph live (2-second debounce, incremental updates).
| Flag | Default | Description |
|---|---|---|
--path <dir> |
cwd | Root directory to watch |
ographle init
Scaffold .ographle.toml for the current project. Auto-detects supported languages.
| Flag | Description |
|---|---|
-f, --force |
Overwrite existing config without prompting |
ographle lsp
Manage LSP installations.
ographle lsp list # list known LSPs and their status
ographle lsp install <name> # install an LSP by registry name
ographle lsp install --all # install all LSPs in .ographle.toml
ographle lsp uninstall <name> # remove a managed LSP
ographle lsp update <name> # reinstall at latest version
ographle lsp which <name> # print resolved binary path (exit 1 if not found)
ographle mcp
Start the MCP stdio server.
MCP integration
ographle mcp speaks JSON-RPC 2.0 over stdio. Add it to your MCP client config to expose the code graph as tools.
Claude Code — add to .claude/settings.json:
{
"mcpServers": {
"ographle": {
"command": "ographle",
"args": ["mcp"]
}
}
}
Available MCP tools: ogr_usage, ogr_search, ogr_verify, ogr_inconsistencies, ogr_node