whatisgithub

What is slicegerp?

haxo98098/slicegerp — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

A search tool that returns only the relevant, ranked pieces of code instead of whole files, built to save tokens for AI coding assistants.

Mindmap

mindmap
  root((slicegrep))
    What it does
      Ranked code slices
      Token budget capping
      Negative evidence
      Dedupe near duplicates
    Tech stack
      Python
      MCP server
      CLI
    Use cases
      AI coding agent context
      Terminal code search
      Custom Python tooling
    Audience
      Developers
      Coding agent builders

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Plug slicegrep into Claude Code, Cursor, or Windsurf via MCP so the AI pulls only relevant code slices instead of full files.

USE CASE 2

Search a codebase from the command line with a regex or plain language question and get ranked, budget-capped results.

USE CASE 3

Import slicegrep as a Python library to build custom code-search tooling with structured output.

What is it built with?

PythonMCPCLI

How does it compare?

haxo98098/slicegerp0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyeasymoderatemoderate
Complexity2/52/54/5
Audiencedevelopergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Zero dependencies for the core install, the MCP server needs Python 3.10 or newer.

So what is it?

slicegrep is a search tool built for AI coding assistants and the humans who work alongside them. Regular grep gives you matching lines with no surrounding context, and reading a whole file gives you context but wastes a lot of space on code that does not matter. slicegrep sits between those two options. It searches a file or folder, pulls out only the relevant pieces of code, ranks them by how useful they are, removes near duplicate results, and keeps the total output under a token limit you set. It also tells you when it did not find something, which is useful information on its own. You can use it three ways: as a command you type in a terminal, as a Python library you import into your own code, or as an MCP server that plugs directly into tools like Claude Desktop, Claude Code, Cursor, and Windsurf so an AI model can pull code context on its own. It accepts either a regex pattern or a plain language question, and longer phrases with several meaningful words are automatically expanded to catch related wording. The project has no required dependencies beyond Python's standard library, and needs Python 3.8 or newer, with 3.10 or newer if you want the optional MCP server. It also ships a shorter alias, fr, so you can type less. Under the hood, results are scored using signals like whether a match sits near other matches, whether it contains distinctive naming rather than generic boilerplate, and whether it is where something is actually defined rather than just referenced. Matches that are only declarations, mostly comments, or from generated or vendored code get pushed down the list. The README includes benchmark tables comparing slicegrep against other retrieval methods such as dense embeddings, BM25, and TF-IDF across several test suites, with slicegrep scoring competitively or best in most of them. This is a developer tool aimed at people building or using AI coding agents who want those agents to read less code while still finding the right answer.

Copy-paste prompts

Prompt 1
Install slicegrep and show me how to add it as an MCP server to Claude Code.
Prompt 2
Write a slicegrep command that finds all functions related to authentication in the src/ folder with a 1000 token budget.
Prompt 3
Explain how slicegrep's ranking signals work and how I could tune them for my own codebase.
Prompt 4
Show me how to use slicegrep as a Python library inside a custom script.

Frequently asked questions

What is slicegerp?

A search tool that returns only the relevant, ranked pieces of code instead of whole files, built to save tokens for AI coding assistants.

What language is slicegerp written in?

Mainly Python. The stack also includes Python, MCP, CLI.

How hard is slicegerp to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is slicegerp for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.