Symbol Extraction
Fast, cached extraction of functions, classes, and other code symbols
Overview
Symbol extraction is one of Kit's most powerful features. It identifies and extracts functions, classes, methods, interfaces, and other code constructs from your repository. With incremental caching, subsequent extractions are lightning fast.
extract_symbols
Extract symbols from files or directories with intelligent caching
extract_symbols(repo_id="...", file_path="main.py")
find_symbol_usages
Find where a symbol is used throughout the codebase
find_symbol_usages(repo_id="...", symbol_name="MyClass")
Incremental Caching
Lightning Fast Performance
Kit's incremental caching system makes symbol extraction incredibly fast
Processing 150 files... (3.2s)
Cache hit 95%! (124ms)
How it works: Kit tracks file modifications and only re-processes changed files. The cache automatically invalidates when you switch branches, commit, or modify files.
Extracted Symbol Types
Extracted:
- Classes
- Functions
- Methods
- Decorators
Example:
{
"name": "MyClass",
"type": "class",
"line": 15,
"file": "main.py"
}
Usage Examples
# Ask your AI:
"Extract all symbols from the repository"
# AI executes:
extract_symbols(repo_id="...")
# Ask your AI:
"What functions are in main.py?"
# AI executes:
extract_symbols(
repo_id="...",
file_path="main.py"
)
# Ask your AI:
"Where is the Database class used?"
# AI executes:
find_symbol_usages(
repo_id="...",
symbol_name="Database"
)
Performance Tips
extract_symbols automatically uses intelligent caching for speed
The cache persists across operations in the same session