
ContextL_
ContextL is the deterministic repository intelligence layer. Equip your AI agents with a dynamic toolkit to query structural dependencies, calculate blast radius, find standalone files, and map your entire codebase. Installs in one click via the automated configuration wizard.
Pure architecture intelligence.
Zero black boxes.
Every score is fully explainable. ContextL operates via a deterministic, 4-step local pipeline written in pure Python. It never calls an external API and requires no vector database.
Repository Scanner
Walks the repository directory tree, automatically filtering noise. Safely ignores node_modules, .git, build directories, and cache folders.
Import Parser
Extracts import relationships using AST/Regex. Auto-detects alias configurations like @/ by reading your tsconfig.json.
Graph Builder
Uses NetworkX to build a directed dependency graph. Computes PageRank (α=0.85) to measure the absolute centrality and structural importance of every file.
4-Signal Query Engine
Dynamic Structural Multipliers
Applies a massive 10x boost to class/interface definitions for short "vibe" queries, or seamlessly defaults to BM25 frequency math for standard LLM prompt lists. Adds a permanent 8x boost for TypeScript exports.
Okapi BM25 Length Normalization
Kills the "God Class" bias by strictly penalizing 5,000-line massive utility files so they don't dominate your search results through raw token counts.
Substring & CamelCase Detection
Identifies exactly when to split variables (e.g. `useAuthToken`) and automatically tests sub-strings so that querying "auth" still returns 100% relevant results.
Centrality & Graph Proximity Boost
Calculates a 0.2x recursive graph boost, meaning if an LLM queries an interface, the actual implementation file gets pulled directly to the top alongside it.
> Ask the repository.
Call the query_repo tool with natural language.
Git-Aware Impact Review.
Instead of manually tracing dependencies for your pull request, let contextl read your git diff. It automatically calculates the precise blast radius of all your staged and unstaged changes, identifying exactly what could break before you commit.
$ contextl review .Blast Radius: 12 files depending on your changes
Suggested tests: test_auth.py, test_api.py
Calculate the blast radius.
This tool performs an upstream BFS traversal. It tells your agent exactly what will break before they write a single line of code.
- Directly affected:3 files
- Transitively affected:12 files
- Suggested tests:4 files
- Total risk:High
Token-efficient API Skeletons.
Don't force your agent to read 5,000 lines of implementation code just to understand a file's API. Skeleton Mode uses Tree-sitter to parse 7+ languages, instantly shrinking massive files down to a clean ~100-line JSON header of classes, methods, docstrings, and return types.
[[src-db.ts.md]]
Materialize the memory graph.
Dump the entire structural intelligence graph physically to disk. It generates a directory of highly interconnected Markdown files that you can open natively in Obsidian.
Imports become bidirectional
[[wikilinks]].Extracted docstrings are written into the body.
The Engine
ContextL builds one structural map of your repo — a dependency graph with PageRank-weighted centrality — once per session. Every tool below is a different lens on that same map, plus one standalone parser for reading code structure directly.
Group 1 — Building & reading the map
scan_repoFirst move, raw file listing, zero computation. (the input stage)
query_repoBM25 text search layered on top of the graph's centrality scores. (search the map)
Group 2 — Reasoning about change, using the map
analyze_impactBFS upstream from one file. (blast radius, on demand)
review_changesSame BFS, but auto-applied to whatever your git diff touched. (blast radius, automatic)
find_dead_filesSame graph, checking in-degree == 0. (the inverse question: what has zero blast radius)
Group 3 — Exporting & inspecting
export_obsidian_vaultDumps the graph to disk as markdown/Mermaid. (visualize the map)
get_skeletonSeparate tree-sitter AST pass, no graph involved. (read one file's structure without the map at all)