DistilCodeAll techniques

Technique 06 / 07

Codebase graphing and traversal

Traverse code relationships through a local CodeGraph MCP index instead of repeatedly rediscovering structure.

Interactive model

See the context change.

Compare broad localisation with a relationship-led traversal.

Graph-assisted4 connected nodes

Follow the relevant path

  1. 01

    Session route

  2. 02

    Session service

  3. 03

    Compaction module

  4. 04

    Message schema

  5. 05

    Verify the target source

Conceptual demonstration. Counts illustrate the flow, not measured production savings.

How it works

Less context. Same thread of work.

Text search is valuable, but it does not directly encode relationships between symbols and files. DistilCode provisions a local CodeGraph command, creates an index when the repository has none, and connects its MCP server in the repository working directory.

Provisioning runs in the background so installation or first indexing does not block startup. CodeGraph tools are intentionally exposed only to the explore and codebase-memory agents; other agents receive an explicit deny rule. The graph guides localisation, while normal reads still verify the code before edits.

In practice

The operating loop

  1. 01

    Index once

    The integration detects the repository’s .codegraph index and initialises one when missing.

  2. 02

    Serve locally

    The CodeGraph binary runs as a local MCP server rooted in the active repository.

  3. 03

    Restrict traversal

    Only repository-memory specialists can access graph tools, keeping unrelated agent toolsets lean.