> For the complete documentation index, see [llms.txt](https://kerno.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kerno.gitbook.io/docs/code-intelligence-tools-kit/kit-tools-reference.md).

# KIT Tools Reference

These tools give your agent structured access to your codebase without reading files broadly.

### Getting started with the tools

Run the tools in this order on first use:

1. `scan_workspace` — discover modules in your repository
2. `index_module` — index a module to make it queryable
3. Everything else — navigate, search, and explore

***

### Workspace

| Tool                   | Description                                                                                      |
| ---------------------- | ------------------------------------------------------------------------------------------------ |
| `scan_workspace`       | Scan the repository and list modules and their roots. Required before indexing.                  |
| `kerno_sync_workspace` | Sync Kerno's view of the workspace with the current state of your code.                          |
| `kerno_list_endpoints` | List HTTP routes discovered in your code, with flags showing which routes already have coverage. |

**scan\_workspace**

Run this first. Kerno scans your repository and lists all detected modules and their root paths. Required before you can index or query any module.

> "Use Kerno to scan my workspace and show me the detected modules."

**kerno\_sync\_workspace**

Keeps Kerno's view of your codebase in sync with your latest committed changes. Call this after committing code changes before running navigation queries.

> "Sync the Kerno workspace."

**kerno\_list\_endpoints**

Lists all HTTP routes Kerno discovered in your code, grouped by the file they are implemented in. Useful for understanding the surface area of your API before scoping a query.

> "Use Kerno to list all endpoints in my app."

***

### Indexing

| Tool           | Description                                                                                                                  |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `index_module` | Index a module so navigation tools can query it. First run can take a few minutes; subsequent runs reuse the existing index. |

**index\_module**

Builds the SCIP index for a module. Must be run before you can use `find_definition`, `find_references`, `find_usages`, or `call_hierarchy` on that module. The index is cached and updated incrementally on subsequent runs.

> "Use Kerno to index the main module."

***

### Navigation

| Tool              | Description                                                                                     |
| ----------------- | ----------------------------------------------------------------------------------------------- |
| `find_definition` | Find the definition of a symbol at a specific file location. Requires the module to be indexed. |
| `find_references` | Find all references to a symbol across the codebase.                                            |
| `find_usages`     | Find all usages of a symbol across the codebase.                                                |
| `call_hierarchy`  | Walk downstream call chains from a piece of code.                                               |

**find\_definition**

Resolves the definition of a symbol with compiler-level accuracy. Use when your agent needs to know exactly where something is defined before reasoning about it.

> "Find the definition of the processPayment function."

**find\_references**

Returns all locations in the codebase that reference a symbol. Useful for understanding the full scope of impact before making a change.

> "Show me everywhere UserService is referenced."

**find\_usages**

Finds all usages of a symbol across modules. Use the exact symbol names returned by `symbol_heatmap` for accurate results.

> "Find all usages of the AuthMiddleware class."

**call\_hierarchy**

Walks the downstream call chain from a function or method. Gives your agent a complete picture of what a piece of code triggers across the codebase.

> "Show me the full call chain from the handleOrder method." "What does calling this function affect across the codebase?"

***

### Heatmaps

| Tool              | Description                                                                 |
| ----------------- | --------------------------------------------------------------------------- |
| `package_heatmap` | Show where packages and external dependencies are used across the codebase. |
| `symbol_heatmap`  | Show where specific symbols are concentrated across folders.                |

**package\_heatmap**

Surfaces which packages and external dependencies are most heavily used and where they appear in the codebase. Useful for understanding coupling and identifying areas affected by a dependency change.

> "Show me which packages are most used across the codebase."

**symbol\_heatmap**

Shows where specific symbols concentrate across folders. Use this to discover symbol names before passing them to `find_usages` or `call_hierarchy`.

> "Show me where the payment-related symbols are concentrated."

***

### Build

| Tool               | Description                                     |
| ------------------ | ----------------------------------------------- |
| `list_build_files` | List the build configuration files in a module. |

**list\_build\_files**

Returns the build configuration files (package.json, pyproject.toml, build.gradle, etc.) for a module. Useful for understanding the module's dependencies and build setup.

> "List the build files for the main module."


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://kerno.gitbook.io/docs/code-intelligence-tools-kit/kit-tools-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
