KiroGraph’s code-health tools surface structural problems in your codebase that are invisible to linters but detectable in a semantic graph: symbols nobody calls, import cycles, tightly coupled hot zones, surprising long-range connections, and classes that have grown too large. All tools in this group requireDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/davide-desio-eleva/kirograph/llms.txt
Use this file to discover all available pages before exploring further.
enableCodeHealth: true unless noted. Complexity tools require the additional enableComplexity: true flag, branch tools require enableBranch: true, and edit primitives require enableEditPrimitives: true.
Graph Health Tools (require enableCodeHealth: true)
kirograph_dead_code
Find symbols with no incoming references — potential dead code. Only unexported symbols are considered, since exported symbols may be called by external consumers.
Maximum results to return (1–100).
Project root path.
kirograph_circular_deps
Find circular import dependencies using Tarjan’s strongly connected components algorithm. Every reported cycle is a set of modules that cannot be loaded independently.
Project root path.
kirograph_hotspots
Find the most-connected symbols by total edge degree (incoming + outgoing). Excludes structural contains edges so the results reflect genuine coupling, not class membership. Useful for identifying load-bearing abstractions or blast-radius hot zones before refactoring.
Maximum results to return (1–100).
Project root path.
kirograph_surprising
Find non-obvious cross-file connections: direct edges between symbols in structurally distant parts of the codebase. High-scoring pairs indicate unexpected coupling worth investigating.
Maximum results to return (1–100).
Project root path.
contains and import) are scored by path distance between source and target files × edge-kind weight (calls=1.0, references=0.8, type_of=0.7, etc.). The highest-scoring unique symbol pairs are returned.
kirograph_type_hierarchy
Traverse the type hierarchy of a class or interface in either direction: up to base types, down to derived types, or both.
Class or interface name to start from.
Traversal direction. Options:
up (base types only), down (derived types only), both.Project root path.
kirograph_diff
Compare the current graph state against a saved snapshot. Shows added and removed symbols and edges since the snapshot was taken.
Snapshot label. Omit to use the most recently saved snapshot.
Project root path.
kirograph_snapshot_save
Save a snapshot of the current graph state with an optional label. Use before major refactors and compare with kirograph_diff afterward.
Human-readable label for the snapshot. Defaults to a timestamp-based label.
Project root path.
kirograph_snapshot_list
List all saved graph snapshots with their labels, timestamps, symbol counts, and edge counts.
Project root path.
kirograph_path
Find the shortest dependency path between two symbols in the graph. Useful for understanding how two distant parts of the codebase are connected.
Source symbol name.
Target symbol name.
Project root path.
kirograph_rank
Rank symbols by fan-in (number of callers) or fan-out (number of callees) edge count.
Ranking dimension. Options:
fan-in (symbols most called by others), fan-out (symbols that call the most).Maximum results to return.
Project root path.
kirograph_distribution
Show a symbol-kind breakdown (function, class, method, interface, …) for a specific file, directory, or the entire project.
Directory or file path prefix to scope. Omit for whole-project stats.
Project root path.
kirograph_module_api
List all exported symbols in a file or directory — the public API surface. Useful for understanding what a module exposes before writing code that depends on it.
File path (e.g.
"src/auth/service.ts") or directory prefix (e.g. "src/auth/"). Omit for the whole project.Maximum results to return.
Project root path.
kirograph_rename_preview
Show every reference site for a symbol — a blast-radius preview before performing a rename. Returns the file, line, and referencing symbol for each site.
Symbol name to find all references for.
Project root path.
kirograph_doc_coverage
Find exported symbols that are missing docstrings. Only considers functions, methods, classes, interfaces, and type aliases.
Maximum results to return.
Project root path.
kirograph_god_class
List classes ranked by member count to identify god classes — classes that have grown to own too much responsibility.
Member count threshold for flagging. Classes at or above this count are marked with
⚠.Maximum results to return.
Project root path.
kirograph_inheritance_depth
Show the deepest inheritance chains using BFS traversal of extends/implements edges. Deeply nested hierarchies are fragile and often indicate over-engineering.
Maximum results to return.
Project root path.
kirograph_recursion
Find recursive and mutually recursive functions using strongly connected component analysis on the call graph. Reports direct recursion (a function calls itself) and mutual recursion (two-cycle detection).
Maximum results to return.
Project root path.
kirograph_largest
List symbols ranked by lines of code (end_line − start_line + 1). Large functions are candidates for extraction or simplification.
Maximum results to return.
Project root path.
kirograph_annotations
Decorator/annotation histogram for the whole project, or a list of symbols using a specific decorator.
Decorator name to filter (e.g.
"Injectable"). Omit for a full histogram across all decorators.Maximum results to return.
Project root path.
kirograph_unused_imports
Find import nodes with zero resolved downstream edges — nothing in the codebase references the imported symbol. These are safe-to-remove imports that add noise to the graph.
Maximum results to return.
Project root path.
kirograph_gini
Compute the Gini inequality coefficient for a size metric across all function and method nodes. Returns the coefficient (0 = perfect equality, 1 = all value in one node) plus the top 5 and bottom 5 symbols.
Metric to measure. Options:
loc (lines of code), fan-in (incoming calls), fan-out (outgoing calls).Project root path.
kirograph_dependency_depth
Run a Kahn topological sort on the file import graph and report each file’s longest path from a root. Files with high depth are deep in the dependency chain and expensive to change.
Maximum files to show, sorted by depth descending.
Project root path.
kirograph_session_start
Save the current graph metrics as a session baseline. Pair with kirograph_session_end to measure the structural impact of a refactoring session.
Project root path.
kirograph_session_end
Diff current graph metrics against the session baseline saved by kirograph_session_start and report per-dimension deltas (nodes added/removed, edges added/removed, dead code delta, etc.).
Project root path.
Complexity Tools (require enableComplexity: true)
kirograph_complexity
Rank symbols by cyclomatic complexity, cognitive complexity, or maintainability index. Requires enableComplexity: true and a re-index after enabling the flag.
Ranking metric. Options:
cyclomatic (McCabe complexity), cognitive (cognitive load score), maintainability (Microsoft Maintainability Index).Flag symbols above this value for CC/cognitive, or below this value for MI.
Maximum results to return.
Project root path.
kirograph_simplify_scan
Find functions and methods that exceed complexity, size, or maintainability thresholds in a single scan. Returns a prioritized list of simplification candidates.
Cyclomatic complexity threshold.
Maintainability index lower bound. Symbols below this value are flagged.
Lines of code threshold.
Maximum results to return.
Project root path.
kirograph_health
Composite graph health score from 0 to 10,000 — higher is better. Aggregates complexity, dead code ratio, coupling, and circular dependency counts into a single number suitable for tracking over time.
Project root path.
kirograph_dsm
Design Structure Matrix: dependency counts between top-level modules. Reveals architectural coupling and layering violations at a glance.
Maximum module groups to include.
Project root path.
kirograph_test_risk
Risk-ranked list of functions based on complexity × fan-in. Functions with high complexity that are also called from many places are most likely to break when changed and most valuable to test.
Maximum results to return.
Minimum risk score to include.
Project root path.
Branch Tools (require enableBranch: true)
kirograph_branch_diff
Compare symbols added, removed, or changed between two tracked branches. Each branch must have been indexed at least once.
First branch name.
Second branch name.
Project root path.
kirograph_branch_search
Search for symbols within a specific tracked branch’s graph. Useful for checking whether a symbol exists on a feature branch before merging.
Search query (symbol name, partial match).
Branch name to search in.
Maximum results to return.
Project root path.
kirograph_branch_list
List all tracked branches with their database sizes and last sync timestamps.
Project root path.
Edit Primitives (require enableEditPrimitives: true)
kirograph_str_replace
Replace a unique string anchor in a file. Fails if the anchor appears zero or more than one time in the file, preventing ambiguous edits.
File path relative to project root.
Exact string to find (must be unique in the file).
Replacement string.
Project root path.
kirograph_multi_str_replace
Apply N replacements as an all-or-nothing transaction. Aborts if any anchor is ambiguous or missing — no partial edits.
File path relative to project root.
Array of
{ old_str, new_str } replacement pairs applied in order.Project root path.
kirograph_insert_at
Insert content before or after a unique anchor string or a specific line number.
File path relative to project root.
Content to insert (include a trailing newline if needed).
Unique string anchor to insert relative to. Mutually exclusive with
line.1-based line number to insert relative to. Mutually exclusive with
anchor.Whether to insert
"before" or "after" the anchor or line.Project root path.
kirograph_ast_grep_rewrite
Structural AST rewrite via ast-grep. Applies a pattern-based rewrite across the entire file. Skipped silently if ast-grep is not installed on the system.
File path relative to project root.
ast-grep pattern to match (e.g. "console.log($MSG)").ast-grep rewrite template (e.g. "logger.debug($MSG)").Project root path.
kirograph_refactor
Rename preview or refactoring suggestions for a symbol.
Operation mode. Options:
rename (preview all reference sites), suggest (generate refactoring suggestions).Symbol name (required for
rename mode).Maximum results to return.
Project root path.
