🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

lightning-code-index

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightning-code-index

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

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

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

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

  • Check Claude Desktop config file syntax
  • Verify LCI_ROOT points to valid directory
  • Check logs: View → Developer → Logs
  • 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.

Acknowledgments

Keywords

code-index

FAQs

Package last updated on 04 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts