Skip to main content

LCI - Lightning Code Index

Lightning-fast code indexing and search for AI assistants.

CI Go Report Card License: MIT

Features

  • Sub-millisecond search: Trigram-based indexing with <5ms search guarantee
  • Multi-language support: Go, TypeScript, JavaScript, Python, Rust, C#, PHP, and more
  • MCP integration: Model Context Protocol server for AI assistant integration
  • Semantic search: Natural language queries with intelligent matching
  • Call graph analysis: Track function calls, references, and dependencies
  • Semantic annotations: @lci: vocabulary for marking up code with metadata

Installation

npm (recommended)

npm install -g @standardbeagle/lci

pip

pip install lightning-code-index

Homebrew (coming soon)

brew install standardbeagle/tap/lci

From Source

Requires Go 1.24 or later (for go-fast JavaScript parser support).

go install github.com/standardbeagle/lci/cmd/lci@latest

From Releases

Download pre-built binaries from GitHub Releases.

Quick Start

CLI Usage

# Index and search in current directory
lci search "handleRequest"

# Find symbol definitions
lci def UserService

# Find all references to a symbol
lci refs CreateUser

# Display function call hierarchy
lci tree main

# Fast grep-style search
lci grep "TODO|FIXME"

# List files that would be indexed
lci list

MCP Server

Start the MCP server for AI assistant integration:

lci mcp

Claude Code Integration

Add to your .mcp.json:

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

Configuration

Create .lci.kdl in your project root:

project {
    name "my-project"
    root "."
}

index {
    include "**/*.go" "**/*.ts" "**/*.py"
    exclude "**/node_modules/**" "**/vendor/**"
}

search {
    max-results 100
    context-lines 3
}

MCP Tools

When running as an MCP server, LCI exposes these tools:

Tool Description
search Semantic code search with fuzzy matching
get_context Get detailed context for a code symbol
find_files Fast file path search with glob patterns
code_insight Codebase intelligence and analysis
context Save/load code context manifests
semantic_annotations Query @lci: semantic labels
side_effects Analyze function purity and side effects

Semantic Annotations

Mark up your code with @lci: annotations for enhanced AI understanding:

// @lci:risk[high] @lci:public-api
// @lci:requires[env:DATABASE_URL]
func HandleUserLogin(w http.ResponseWriter, r *http.Request) {
    // ...
}

// @lci:purpose[Validate user credentials against database]
// @lci:must[Return error for invalid credentials]
func ValidateCredentials(username, password string) error {
    // ...
}

Annotation Categories

  • Risk & Safety: @lci:risk[low|medium|high|critical], @lci:safe-zone, @lci:stability
  • Dependencies: @lci:requires[env:VAR], @lci:requires[db:table], @lci:requires[service:name]
  • Conventions: @lci:convention[pattern], @lci:idiom[name], @lci:template[name]
  • Contracts: @lci:must[behavior], @lci:must-not[behavior], @lci:invariant[condition]
  • Purpose: @lci:purpose[description], @lci:domain[area], @lci:owner[team]

Architecture

lci/
├── cmd/lci/          # CLI entry point
├── internal/
│   ├── core/         # Trigram index, symbol store, reference tracker
│   ├── parser/       # Tree-sitter based multi-language parsing
│   ├── search/       # Search engine and scoring
│   ├── indexing/     # Master index and pipeline
│   ├── mcp/          # MCP server and tools
│   └── analysis/     # Code analysis and metrics
└── pkg/              # Public API

Performance

LCI is designed for speed:

  • Indexing: <5s for typical projects (<10k files)
  • Search: <5ms for most queries
  • Memory: <100MB for typical web projects
  • Startup: Near-instant with persistent index

Development

# Run tests
go test ./...

# Build
go build ./cmd/lci

# Run with race detector
go test -race ./...

License

MIT License - see LICENSE for details.

Contributing

Contributions are welcome! Please read the contributing guidelines before submitting PRs.

Metadata

Release files for lightning-code-index 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for lightning-code-index 0.4.0
File
lightning_code_index-0.4.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
lightning_code_index-0.4.0-py3-none-manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
lightning_code_index-0.4.0-py3-none-manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
lightning_code_index-0.4.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
lightning_code_index-0.4.0-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details

Total release size: 38.0 MB

Release files / lightning_code_index-0.4.0-py3-none-win_amd64.whl

Download URL lightning_code_index-0.4.0-py3-none-win_amd64.whl
Size 7.9 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
96bff0dae87a7fe8e28041e5fd6f8114ad745c819214ffc3713f72b392010834
BLAKE2b-256 checksum
How to use checksums
d776f2a2a29df7fc208d4649b25adbf10f7a2ffc4368990d599a4599dfd52d32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Release files / lightning_code_index-0.4.0-py3-none-manylinux_2_17_x86_64.whl

Download URL lightning_code_index-0.4.0-py3-none-manylinux_2_17_x86_64.whl
Size 7.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
5252059cc56d75d543f0eb95881c11639ff12e73045034692c29fd562a57bf34
BLAKE2b-256 checksum
How to use checksums
e83d90e815fdef90ffc30b74e8b0e245f1620e62cb76f121ef4dcd31eb357e6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Release files / lightning_code_index-0.4.0-py3-none-manylinux_2_17_aarch64.whl

Download URL lightning_code_index-0.4.0-py3-none-manylinux_2_17_aarch64.whl
Size 7.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
24d537a8e3eff6e8c44f8292258f491398c070fa02a27d9e82bfab72420879a5
BLAKE2b-256 checksum
How to use checksums
a1c4df4e81f449371ce6ac1deb6a1829d592ade78a563d586344774c800de533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Release files / lightning_code_index-0.4.0-py3-none-macosx_11_0_arm64.whl

Download URL lightning_code_index-0.4.0-py3-none-macosx_11_0_arm64.whl
Size 7.4 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
92e2fbea97e392d14632d78e9c9cfc25e72c8f1041526d1afa972d16430cf02a
BLAKE2b-256 checksum
How to use checksums
bf843fdd76782c7c0bcbdec1d8a9c608f0aacbf95f34f8aa1b007148c19b0f12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Release files / lightning_code_index-0.4.0-py3-none-macosx_10_12_x86_64.whl

Download URL lightning_code_index-0.4.0-py3-none-macosx_10_12_x86_64.whl
Size 7.7 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
da356c16cb6b6561776dc054aee80dca665ab015759b781bf63efa9bb88e7277
BLAKE2b-256 checksum
How to use checksums
deb033be0e06c3206d90e6effd2fe09759b9960bb2e3290a991d9a6a1c455005
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 9, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

5 release files

0.1.4

5 release files

0.1.3

4 release files

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page