Codebase Index for Openclaw

A repository scanning and symbol mapping tool that builds a fast, searchable JSON index of classes, functions, and variables using Python AST and ripgrep.

lxr-666
v1.0.0
Jun 22, 2026
0
628
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install codebase-index

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install codebase-index using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Codebase Index?

Codebase Index is a system designed to help AI agents understand entire code repositories at depth, inspired by the advanced codebase indexing capabilities found in Claude Code. While tools like codebytelens focus purely on single-file analysis, Codebase Index provides a full-repository overview by scanning project directories to build a searchable database of symbols.

The system is built from scratch utilizing the Python Abstract Syntax Tree (ast) module alongside ripgrep for lightning-fast scanning. It accurately extracts code structural definitions such as classes, functions, variables, and code imports. This structure enables developer agents to gain instant repository intelligence without wasting LLM context windows on unnecessary code reading.

Codebase Index Use Cases

  • Building a map of a large code repository for an AI agent to locate relevant functions or modules.
  • Accelerating symbol searches across multiple directories without manual grep searching.
  • Filtering repository code structures by specific definitions like classes or function declarations.
  • Gathering comprehensive docstrings and codebase statistics to auto-generate technical overviews.

How Codebase Index Works

  1. Directory Scanning: The tool scans the target project directory, ignoring irrelevant files and prioritizing readable source files.
  2. Symbol Extraction: It uses Python's ast module and ripgrep to extract comprehensive definitions including class names, functions, variables, lines, docstrings, and imports.
  3. Index Generation: Collected metadata is compiled into a structured, highly optimized index.json file.
  4. Query Interface Execution: The system opens CLI workflows allowing developers or Openclaw Skills agents to query the structured map by name, filter by code type, or match patterns via fuzzy searching.

Codebase Index Setup

Ensure you have python3 installed on your system as it is a required dependency for running the indexer.

# Clone or locate the skill in your environment
# Run a repository scan to generate your first index
python3 indexer.py scan /path/to/project --output project-index.json

Codebase Index Data Schema & Taxonomy

The output schema generated by this Openclaw Skills module is a clean JSON structure containing an array of extracted symbols. Below is an overview of the fields generated:

Field Type Description
symbols Array A collection of all extracted structural components from the codebase
symbols[].name String The exact identifier name of the class, function, or variable
symbols[].type String Structural classification (e.g., class, function)
symbols[].file String Relative filepath location within the repository
symbols[].line Integer Exact line number where the definition begins
symbols[].docstring String Extracted inline developer documentation or string comments
symbols[].methods Array (Optional) List of method names contained within a class definition

Codebase Index Advanced Features

  • Granular Type Filtering: Easily query codebases specifically for function names, variables, or class implementations using target query filters.
  • Full Repository Statistics: Generate structural summaries and metrics about files and definitions across the workspace using the built-in stats command.
  • Fuzzy Matching Capabilities: Leverage powerful regex and query logic to lookup components even when only partial names are known.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*