Code Search
Local hybrid keyword + semantic code search for agents: SQLite FTS5 BM25 plus optional embeddings, as a CLI and an MCP server.
$5
Works with the AI Agents you already use
Code Search
Example session with this skill installed
python3 code_search.py search . "sprint cadence gate"
- Read your context and instructions
- Compiled the code search
tests/test_sprint_gate.py:1-60 followed by a short snippet of the matching chunk, then the next best file:line range.
Connects securely to your tools. The creator never sees your data.
About this skill
grep finds strings. Agents often need code by meaning: "where do we retry failed payments". Code Search indexes a repo locally and ranks results by keyword and, optionally, semantic similarity.
What you get
code_search.py, a single Python file using only the standard library (embeddings optional).- CLI:
index <root> [--reindex]andsearch <root> <query> [--limit N]. - MCP stdio server with
search_codeandindex_repotools. Works with mcp 1.x and 2.x. - SQLite FTS5 BM25 keyword ranking over 60-line chunks. Query words are quoted, so punctuation and FTS operators cannot break a search.
- Optional semantic ranking with sentence-transformers (all-MiniLM-L6-v2), fused with BM25 using Reciprocal Rank Fusion. Without it, runs BM25 only.
- Incremental indexing: files are hashed, unchanged files skipped, deleted files removed.
- Index lives at
<repo>/.claude/code-index.db.
Everything runs locally. No accounts, no network calls (the embedding model downloads once if you opt in).
Tested on an 89-file repo: indexing, re-index (0 changed), edit plus delete (1 changed, 1 removed), search, and the MCP server over stdio on mcp 1.30 and 2.3.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Chunking is by line count, not syntax tree, so a function can span two chunks. Semantic search scans all vectors in Python: fine for tens of thousands of chunks, slow beyond that. Initial embedding of a large repo is slow on CPU; index with CODE_SEARCH_EMBED=0 first for keyword-only search. Chunks indexed without embeddings need index --reindex to gain vectors. Files over 400 KB and common vendor/build directories are skipped.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 13 days ago
- Software
Python 3.9+SQLite FTS5
- Optional
- mcp Python packagesentence-transformers
FTS5 is standard in most Python builds. The mcp package enables MCP mode; sentence-transformers adds semantic search.
Permissions
File Scopes
No network access. Optional embedding model download from Hugging Face if sentence-transformers is installed.