No description
teleios c7b32b08b5 feat: 0011 follow-ups — builtins filter, enclosing_symbol, context depth, test patterns
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>
2026-05-02 17:50:25 +02:00
.github/workflows Cleaning up 2026-04-30 13:11:36 +02:00
.processdocs feat: 0011 follow-ups — builtins filter, enclosing_symbol, context depth, test patterns 2026-05-02 17:50:25 +02:00
cmd feat: surface anon-scope callers and neighbor docs/signatures 2026-05-02 15:57:13 +02:00
internal feat: 0011 follow-ups — builtins filter, enclosing_symbol, context depth, test patterns 2026-05-02 17:50:25 +02:00
.gitignore Cleaning up 2026-04-30 13:11:36 +02:00
.goreleaser.yaml fix: P2-1 — extract buildRegistry() in cmd/lsp.go 2026-05-01 10:26:27 +02:00
.ographle.toml Cleaning up 2026-04-30 13:11:36 +02:00
CLAUDE.md fix: phase 2 quality — dry registry, async mcp, lsp caps, watcher guards 2026-04-30 14:10:29 +02:00
go.mod Cleaning up 2026-04-30 13:11:36 +02:00
go.sum feat: phase 7 — file watcher, ogr watch daemon 2026-04-30 11:30:21 +02:00
main.go Cleaning up 2026-04-30 13:11:36 +02:00
README.md fix: phase 2 quality — dry registry, async mcp, lsp caps, watcher guards 2026-04-30 14:10:29 +02:00

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