Harness Code

Harness Code is a local stdio MCP server that indexes a repository with tree-sitter and tells Claude Code, Codex, OMP, PI, OpenCode and any other MCP client where code is defined, who uses it and how one part reaches another.

A code graph for your AI coding agents, in one local binary.

  • GPL-3.0-or-later
  • macOS (Apple Silicon and Intel) · Linux (x86_64) · Windows

Install Harness Code View on GitHub Releases

$ code --about

What is Harness Code?

Harness Code is a local stdio MCP server that indexes a repository with tree-sitter and tells Claude Code, Codex, OMP, PI, OpenCode and any other MCP client where code is defined, who uses it and how one part reaches another.

It includes A map before grep, where it is and who uses it and what a change breaks. It runs on macOS (Apple Silicon and Intel), Linux (x86_64) and Windows, and it is open source under the GPL-3.0-or-later license.

$ code --features

What does Harness Code do?

  • A map before grep

    code_map gives a ranked map of a project’s key files with their signatures, within a token budget, optionally centred on one folder.

  • Where it is and who uses it

    code_symbol tells where a function, type or constant is defined, what it uses and who uses it, with path:line and the line of source that makes each link.

  • What a change breaks

    code_impact lists everything that depends on a symbol or a file, by caller depth, with tests summarised per file. For before a signature changes.

  • How A reaches B

    code_path finds the shortest chain of calls, renders and shared constants between two ends, one hop per line with the call site. An end can even be plain words.

  • Always fresh

    Each call compares file sizes and times with the index and reads only what changed. There is no watcher, no commit hook and nothing to rebuild.

  • Six languages

    Rust, TypeScript and JavaScript, .svelte, .vue and .astro files, Go and Python. Links across languages are marked as found by name.

  • No values in answers

    String literals in signatures are replaced, credential formats and URL passwords are masked, and file names cannot forge a line of an answer.

  • Isolated and bounded

    A repository is untrusted input, so it is indexed in a separate worker with a memory and time limit. Only git repositories are indexed, never your home folder.

$ code --harnesses

Which harnesses does Harness Code support?

  • Claude Code

    Register with claude mcp add --scope user harness-code -- harness-code mcp.

  • Codex

    Register with codex mcp add harness-code -- harness-code mcp.

  • OMP, PI, OpenCode

    Add a harness-code entry that runs harness-code mcp: in mcp.json for OMP and PI, under mcp in opencode.json for OpenCode.

  • Harness Desktop

    Installs it, registers the server for every harness, keeps it up to date and builds the index of a project when you open it.

  • Any other MCP client

    Any MCP client can start the stdio server with harness-code mcp.

$ code --install

How do I install Harness Code?

  1. # macOS and Linux

    curl -fsSL https://raw.githubusercontent.com/MSpiechowicz/harness-useful-code/main/install.sh | sh
  2. # Windows (PowerShell)

    powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/MSpiechowicz/harness-useful-code/main/install.ps1 | iex"

Prefer a download? Every release and its notes are on the Harness Code releases page.

$ code --privacy

Is Harness Code private? Where does my data live?

  • Nothing is sent anywhere. The index is one local SQLite file, code.sqlite3, in the harness-code folder of your user data directory.
  • Nothing is written into your repositories.
  • String values in signatures are hidden, and credential formats and URL passwords are masked in replies.
  • Indexing runs in a separate worker with a time limit, and on Linux a memory limit, so a hostile repository cannot take the server down.
  • Only git repositories are indexed. Your home folder, hidden folders under it and system folders are refused.

$ code --family

How does Harness Code fit the Harness Useful family?

Harness Code is the code graph in Harness Useful, a family of six open-source, local tools for coding-agent harnesses. Harness Desktop is the window, Harness Skills the workflow, Harness Memory the shared project memory, Harness Knowledge the searchable project documentation, Harness Code the code graph and Harness Dashboard the usage and cost meter.

Each tool works on its own. Harness Desktop’s Recommended setup can install the others after you confirm each part and register their MCP servers in each detected harness.

See the Harness Useful home page, every tool side by side or the family FAQ.

$ code --faq

Harness Code FAQ

What is Harness Code?

Harness Code is a stdio MCP server, shipped as one local binary called harness-code. It indexes a repository with tree-sitter and answers where code is defined, who uses it, what breaks when it changes and how one thing reaches another, so an agent reads the answer instead of grepping and opening files.

Which languages does it index?

Rust, TypeScript and JavaScript, .svelte, .vue and .astro files, Go and Python. A link between files in different languages comes only from a string that names a function or component defined elsewhere, and replies mark it as found by name.

Do I have to rebuild the index?

No. Each code_* call compares the size and modification time of the files with the index, reads only the ones that changed and answers from the updated graph. There is no watcher and no commit hook.

How do I install Harness Code?

On macOS and Linux run the curl install script from the README. On Windows run the PowerShell command. Both check the SHA-256 against the release’s checksums before installing anything. Then register harness-code mcp with each harness, or let Harness Desktop do it.

Does Harness Code send my code anywhere?

No. The index is a local SQLite file in your user data directory and nothing is sent over the network. What an agent reads from an answer goes to its model provider like the rest of its context.

Can I turn it off?

Yes. harness-code disable writes a switch file that hides its four code_* tools from every harness and keeps the index. harness-code enable turns it back on, and Harness Desktop has the same switch under Settings → Code.

Did the code graph use to be part of Harness Memory?

Yes. The code_map, code_symbol, code_impact and code_path tools moved from Harness Memory to Harness Code, which works on its own with neither Memory nor Knowledge installed.

Harness Code on GitHub Releases Back to the family