explaingit

masihmoloodian/sema

Analysis updated 2026-05-18

14PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A local code search index and MCP server that helps AI coding assistants like Claude Code and Codex find relevant code without reading whole files.

Mindmap

mindmap
  root((sema))
    What it does
      Indexes functions and classes locally
      Exposes search via MCP server
      Cuts AI token usage
    Tech stack
      Python
      Tree sitter parsing
      SBERT embeddings and ChromaDB
    Use cases
      Speed up Claude Code sessions
      Speed up OpenAI Codex sessions
      Search large codebases fast
    Audience
      Developers using AI assistants
    Editors supported
      Claude Code CLI and VS Code
      Codex CLI and VS Code

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

Cut token usage when Claude Code or Codex explores a large, unfamiliar codebase.

USE CASE 2

Search a codebase by describing what a function does instead of grepping for exact text.

USE CASE 3

Jump straight to a function's full source instead of reading entire files to find it.

USE CASE 4

Set up a local, offline code search index that needs no external API key.

What is it built with?

PythonTree-sitterSBERTChromaDBMCP

How does it compare?

masihmoloodian/sema0c33/agentic-aiadennng/stock_strategy_lab
Stars141414
LanguagePythonPythonPython
Setup difficultymoderatehardhard
Complexity3/54/54/5
Audiencedeveloperdeveloperresearcher

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

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires running a local indexing step and connecting an MCP server to Claude Code or Codex.

The README mentions a License section but does not state the specific terms in the visible text.

In plain English

Sema is a tool that helps AI coding assistants like Claude Code and OpenAI Codex work faster and cheaper on large codebases. Normally, when one of these assistants starts a new session, it has no memory of the project, so it explores by running commands like find and reading whole files one at a time just to understand what exists. That process burns a large number of tokens before the assistant can even start helping with the actual task. Sema fixes this by building a local search index of the entire codebase ahead of time. It scans every function, class, method, and interface, breaks them into chunks, and stores each one alongside a numerical representation of its meaning, created locally on the user's own machine without needing an API key. This index is then exposed to Claude Code or Codex through something called an MCP server, which lets the assistant search for relevant code by describing what it needs in plain language, then pull the full body of just the matching function, instead of reading entire files. The README backs this up with side by side comparisons on real open source projects. In one example, answering a question about how a login feature works took six tool calls and about 6,475 tokens without sema, versus three tool calls and 837 tokens with it, roughly an eight times reduction. A second example on a Python project shows a similar drop, again because the assistant can jump straight to the relevant function instead of reading a large file in full to find it. The project works with Claude Code on the command line and in VS Code, and with OpenAI Codex in the same two forms. It is explicitly labeled as experimental, meaning its APIs and the format of its index may still change between versions. It stores the index locally in a hidden folder that is meant to be excluded from version control. This tool is aimed at developers who already use AI coding assistants on medium to large codebases and want to cut down the setup cost of every new session. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Help me install sema and set it up as an MCP server for Claude Code.
Prompt 2
Explain how sema indexes a codebase using tree-sitter and SBERT embeddings.
Prompt 3
Show me how to use search_code and get_code once sema is indexed and connected.
Prompt 4
Help me configure sema for a VS Code workspace using Codex.
Prompt 5
Explain when I should re-index my codebase with sema after making changes.

Frequently asked questions

What is sema?

A local code search index and MCP server that helps AI coding assistants like Claude Code and Codex find relevant code without reading whole files.

What language is sema written in?

Mainly Python. The stack also includes Python, Tree-sitter, SBERT.

What license does sema use?

The README mentions a License section but does not state the specific terms in the visible text.

How hard is sema to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is sema for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.