Core Feature

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.

Available Tools

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

First extraction:
Processing 150 files... (3.2s)
Subsequent extractions:
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

Extract symbols from entire repository
# Ask your AI:
"Extract all symbols from the repository"

# AI executes:
extract_symbols(repo_id="...")
Extract from specific file
# Ask your AI:
"What functions are in main.py?"

# AI executes:
extract_symbols(
  repo_id="...",
  file_path="main.py"
)
Find symbol usage
# Ask your AI:
"Where is the Database class used?"

# AI executes:
find_symbol_usages(
  repo_id="...",
  symbol_name="Database"
)

Performance Tips

Caching is automatic

extract_symbols automatically uses intelligent caching for speed

Extract once, use many times

The cache persists across operations in the same session