npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lightning-code-index

v0.3.0

Published

Lightning fast code indexing for AI assistants - Cross-platform distribution via npm

Readme

Lightning Code Index (LCI)

Lightning fast code indexing for AI assistants

Lightning Code Index is a high-performance code search and indexing tool designed for AI assistants like Claude Desktop. It provides sub-millisecond search across your codebase using advanced indexing techniques including trigram indexing and tree-sitter AST parsing.

Features

  • 🚀 Sub-millisecond search - Find code in <5ms
  • 🌲 Tree-sitter AST parsing - Understand code structure for 10+ languages
  • 🎯 Symbol resolution - Jump to definitions and references
  • 🔍 Multi-modal search - Name, content, and structural search
  • 📦 Multiple distribution methods - Go binaries, npm package, GitHub releases
  • 🔌 MCP Server - Seamless integration with Claude Desktop

Quick Start

Option 1: NPX (Recommended, Cross-Platform)

Run without installation:

npx lightning-code-index version
npx lightning-code-index search "func" --root ./my-project

Option 2: npm (Global Install)

Install globally:

npm install -g lightning-code-index
lci version

Option 3: GitHub Releases

Download pre-built binaries from Releases:

  • Linux (amd64, arm64)
  • macOS (Intel, Apple Silicon universal)
  • Windows (amd64)
# Linux
curl -L https://github.com/standardbeagle/lightning-code-index/releases/latest/download/lci-linux-amd64 -o lci
chmod +x lci

# macOS
curl -L https://github.com/standardbeagle/lightning-code-index/releases/latest/download/lci-darwin-universal -o lci
chmod +x lci

# Windows (PowerShell)
Invoke-WebRequest -Uri "https://github.com/standardbeagle/lightning-code-index/releases/latest/download/lci-windows-amd64.exe" -OutFile "lci.exe"

Option 4: Build from Source

Requires Go 1.21+:

git clone https://github.com/standardbeagle/lightning-code-index.git
cd lightning-code-index
make build
./lci version

Usage Examples

Command Line Interface

# Check version
lci version

# Index a project
lci index ./my-project

# Search for code
lci search "func" --root ./my-project

# Get symbol definition
lci definition "MyFunction" --root ./my-project

# Find references
lci references "MyFunction" --root ./my-project

# Help
lci --help

As MCP Server

LCI can run as an MCP (Model Context Protocol) server for integration with Claude Desktop:

Installation

Option 1: NPX (Simplest)

npm install -g @modelcontextprotocol/cli

Option 2: Build from Source

git clone https://github.com/standardbeagle/lightning-code-index.git
cd lightning-code-index
go install ./cmd/lci

Claude Desktop Configuration

Add to your Claude Desktop config file:

macOS/Linux:

{
  "mcpServers": {
    "lci": {
      "command": "npx",
      "args": ["lightning-code-index", "mcp"]
    }
  }
}

Windows:

{
  "mcpServers": {
    "lci": {
      "command": "cmd",
      "args": ["/c", "npx", "lightning-code-index", "mcp"]
    }
  }
}

Alternatively, if installed globally:

{
  "mcpServers": {
    "lci": {
      "command": "lci",
      "args": ["mcp"]
    }
  }
}

Configuration File Locations

Claude Desktop:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/claude/claude_desktop_config.json

VS Code/Cursor:

  • Settings → Extensions → Claude → Configure Servers

MCP Configuration Example

Here's a simple configuration for indexing a project:

{
  "mcpServers": {
    "lci": {
      "command": "lci",
      "args": ["mcp"]
    }
  }
}

Auto-Detection: LCI automatically detects your project root by searching for common config files (.lci.kdl, package.json, go.mod, Cargo.toml, etc.) in the current directory and parent directories.

Project-Level Config: To customize indexing for a specific project, create a .lci.kdl file in your project root. If no config is found, LCI uses sensible defaults.

Example Workflow with Claude

Once configured, you can interact with Claude:

You: Can you search for all React components in my project?

Claude: I'll search for React components using LCI.

[Uses lci search "React" --root ./src to find components]

Found 15 React components in your project:
- src/components/Button.tsx
- src/components/Modal.tsx
- ...

Would you like me to analyze any specific component?

Supported Languages

LCI supports semantic parsing and indexing for:

  • Go - Full AST support
  • Python - Full AST support
  • JavaScript/TypeScript - Full AST support
  • Rust - Full AST support
  • C/C++ - Full AST support
  • C# - Full AST support
  • Java - Full AST support
  • PHP - Full AST support
  • Zig - Full AST support

Build Targets

For building from source:

# Current platform
make build

# Cross-platform builds
make build-linux-amd64      # Linux x64
make build-linux-arm64      # Linux ARM64
make build-windows          # Windows x64
make build-darwin-universal # macOS (Intel + Apple Silicon)

# Build all
make build-release

See BUILD.md for detailed build instructions.

Development

Running Tests

make test           # All tests
make test-unit      # Unit tests only
make test-integration # Integration tests only
make test-race      # Race detector
make test-coverage  # Coverage report

Architecture

  • Core Indexing: Go-based with tree-sitter for AST parsing
  • Search Engine: Trigram index + symbol index for <5ms searches
  • MCP Integration: Native MCP server implementation
  • CLI Tool: Full-featured command-line interface

Performance

  • Search latency: <5ms for typical projects
  • Indexing speed: ~1000 files/second
  • Memory usage: ~50MB for medium projects (<10k files)
  • Binary size: ~30MB (includes all language parsers)

Troubleshooting

Binary not found

# If using npx
npx lightning-code-index <command>

# If installed globally but binary not in PATH
npm rebuild -g lightning-code-index

# Build from source
cd lightning-code-index
make build

MCP Server not connecting

  1. Check Claude Desktop config file syntax
  2. Verify LCI_ROOT points to valid directory
  3. Check logs: View → Developer → Logs
  4. Try running manually: npx lightning-code-index daemon

Search returns no results

# Verify index exists
lci stats --root ./project

# Rebuild index
lci index --rebuild ./project

# Check file inclusion
lci index --dry-run ./project --verbose

License

MIT License - see LICENSE file for details.

Contributing

Contributions welcome! Please read CONTRIBUTING.md for guidelines.

Links

  • GitHub: https://github.com/standardbeagle/lightning-code-index
  • Documentation: https://github.com/standardbeagle/lightning-code-index/wiki
  • Issues: https://github.com/standardbeagle/lightning-code-index/issues
  • Discussions: https://github.com/standardbeagle/lightning-code-index/discussions

Acknowledgments