Skip to main content

A codebase search engine for LLM coding agents

Project description

CodeXLR8

PyPI version Python 3.10+ License CI

A codebase search engine for LLM coding agents. One query, precise results, no noise.

Setup

pip install codexlr8
codexlr8 setup

setup auto-detects MCP clients (Claude Code, Cursor) and injects the server config, then walks you through project configuration. After setup, build the search index:

codexlr8 index .

Your agents now have codebase_search and codebase_index tools. Search from the CLI yourself:

codexlr8 search . "login auth"
# 1. auth/session.py:14-27  [score: 1.60]
#    meta: User authentication — login, logout, session management
#    tags: auth, login, session, security

How It Works

CodeXLR8 indexes your codebase into an SQLite FTS5 database alongside optional .meta.yaml sidecar files that boost ranking precision:

Layer Source Boost
1 Raw file content 0.3× per token
2a File path (filename, directory) 0.5× – 0.8×
2b .meta.yaml summary + tags 0.6× – 0.8×
3 .meta.yaml public_api 1.0× (strongest)

Search uses OR semantics with token-coverage scoring: more matching tokens = higher score. A ≥50% post-filter eliminates single-token noise for multi-word queries. Path weighting (Layer 2a) provides differentiation even without metadata — a file whose name IS the query token ranks above one that merely mentions it.

Scoped search and clustering

# Narrow to a specific directory (like grep -rn "pattern" dir/)
codexlr8 search . "get_visible" --scope lib/mpl_toolkits/

# Cluster results by directory to see where matches concentrate
codexlr8 search . "get_visible" --grouped
# 12 results in 3 directories (8 files) across project:
#   lib/mpl_toolkits/mplot3d/  (5 files)
#     ─ axes3d.py:388  [score: 0.90]
#     ...

# Diagnose your query — see which terms hit, which don't
codexlr8 search . "axes not hiding" --explain
# Query analysis:
#   "axes"    212 matches  — broad term (212/212 results)
#   "not"     77 matches
#   "hiding"  0 matches    — consider dropping or replacing
#   Top score: 1.20 (strong match)

# Combine both — group, then scope to drill down

.meta.yaml Sidecars

Optional YAML files next to source files, created by codexlr8 init:

public_api: [login, logout, reset_password]
summary: "User auth: login, session, password reset"
tags: [auth, security, session]
invariants:
  - "db.connect() must be called first"

Files without .meta.yaml still get indexed — metadata just produces higher ranking scores.

Configuration

Optional .codexlr8.yaml at the project root:

root: "."
include: []                     # scope: only scan these
exclude:                        # skip these
  - tests/*
  - test_*
extensions:                     # file types to index
  - .py
  - .js
ignore_dirs:                    # skip entirely
  - .git
  - __pycache__

All fields have defaults. Use codexlr8 setup to create one interactively, or edit by hand.

Agent Integration

Works with Claude Code, Cursor, Windsurf, Continue.dev and any MCP-compatible client.

codexlr8 setup auto-detects installed clients and offers to inject the MCP server config. For manual setup, add this to your client's config:

{
  "mcpServers": {
    "codexlr8": {
      "command": "uvx",
      "args": ["codexlr8", "mcp-server"]
    }
  }
}

Tools available to agents:

Tool Description
codebase_search(query, path?, limit?, exclude?) Search the codebase, return ranked results
codebase_index(path?, incremental?, exclude?) Build or update the search index

The included agent skill (SKILL.md) teaches agents to search before reading files, maintain .meta.yaml sidecars, and keep the index fresh.

Commands

codexlr8 setup            Interactive project + MCP config
codexlr8 scan <path>      List source files and line counts
codexlr8 init <path>      Bootstrap .meta.yaml sidecars
codexlr8 index <path>     Build the search index
codexlr8 search <path> <q> Search the codebase
codexlr8 status <path>    Show index coverage and age
codexlr8 install-skill    Install agent skill for Claude Code
codexlr8 mcp-config       Print MCP client config JSON

Contributing

See AGENTS.md for principles and development guidelines.

License

Apache 2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codexlr8-0.0.2.tar.gz (31.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codexlr8-0.0.2-py3-none-any.whl (27.5 kB view details)

Uploaded Python 3

File details

Details for the file codexlr8-0.0.2.tar.gz.

File metadata

  • Download URL: codexlr8-0.0.2.tar.gz
  • Upload date:
  • Size: 31.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codexlr8-0.0.2.tar.gz
Algorithm Hash digest
SHA256 4635f59e319fef41ab94683efeafe6b208d3c0ae003d37e16a93652243152585
MD5 4ab4b838a2e8c826c57ee5f1083aed94
BLAKE2b-256 3ba5728639f436518a7b08bd77aac62c0888eb854ad78049ff11baa6daf719b3

See more details on using hashes here.

File details

Details for the file codexlr8-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: codexlr8-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 27.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codexlr8-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 695a18ed00dd414d3b8f893ad065b557b58d4afe246bf69d139b719430bc2353
MD5 dae33513c78d15f567e0dc18f6c6a2a8
BLAKE2b-256 da68956d0b3f0dabd3dd60ab55fba6954d4451f1d3d491eb1c5c145a69586bbc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page