What is CLDK?
CLDK (CodeLLM-DevKit) is a Python library that loads a codebase and exposes typed models of its classes, methods, fields, and call graph. All queries are issued through a single analysis object, which answers structural questions (such as which methods call a given method, or which methods it invokes) without manual file parsing or ad hoc composition of external tools.
The programming model
Section titled “The programming model”Every CLDK program follows the same three steps: select a language, analyze a project, and query the resulting typed models.
-
Call the per-language factory for the target language, for example
CLDK.java(...). This selects the analysis backend. -
Build the
analysisobject by pointing it at a project:CLDK.java(project_path="commons-cli"). The backend runs at this step and produces the program model. -
Query the typed models with
get_classes(),get_method(...),get_call_graph(), and related methods. The returned objects can be read, traversed, serialized, or passed to other tools.
from cldk import CLDKfrom cldk.analysis import AnalysisLevel
# 1. select the language 2. analyze the project 3. queryanalysis = CLDK.java( project_path="commons-cli", analysis_level=AnalysisLevel.call_graph,)
print(len(analysis.get_classes()), "classes")print(analysis.get_call_graph()) # -> networkx.DiGraph# 23 classes# DiGraph with caller -> callee edgesfrom cldk import CLDKfrom cldk.analysis import AnalysisLevel
# Python requires a project_path (no single-file mode)analysis = CLDK.python( project_path="my_pkg", analysis_level=AnalysisLevel.call_graph,)
print(len(analysis.get_classes()), "classes")print(analysis.get_call_graph()) # -> networkx.DiGraphA language-specific backend sits behind the same API:
flowchart LR
A["CLDK.<lang>(project_path)"] --> B["analysis object"]
B --> C["Typed program model"]
C --> D["Symbol table"]
C --> E["Call graph"]
C --> F["Class structure / CRUD"]
The backend is selected by language: Java uses CodeAnalyzer over WALA, and Python uses its own static-analysis engine. The query code is largely identical across languages; only the backend differs.
Language coverage
Section titled “Language coverage”Every supported language is queried through the same analysis API, backed by a language-specific engine. Java and Python are supported today, with Java offering the deepest analysis, including class-hierarchy and CRUD extraction. TypeScript is available in beta: its symbol table and call graph are solid and queryable through CLDK.typescript(...), while framework entrypoint detection is still in progress. Go and Rust are under active development.
| Language | Status | Symbol table | Call graph / callers / callees |
|---|---|---|---|
| Java | Supported | Yes | Yes |
| Python | Supported | Yes | Yes |
| TypeScript | Beta | Yes | Yes |
| Go | In development | Planned | Planned |
| Rust | In development | Planned | Planned |