Skip to content

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.

Every CLDK program follows the same three steps: select a language, analyze a project, and query the resulting typed models.

  1. Call the per-language factory for the target language, for example CLDK.java(...). This selects the analysis backend.

  2. Build the analysis object by pointing it at a project: CLDK.java(project_path="commons-cli"). The backend runs at this step and produces the program model.

  3. 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 CLDK
from cldk.analysis import AnalysisLevel
# 1. select the language 2. analyze the project 3. query
analysis = 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 edges

A 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.

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.

LanguageStatusSymbol tableCall graph / callers / callees
JavaSupportedYesYes
PythonSupportedYesYes
TypeScriptBetaYesYes
GoIn developmentPlannedPlanned
RustIn developmentPlannedPlanned