clew

PyPI clew’s own wiki — built by clew from this repository on every green main · clew-trace on PyPI

A clew is the ball of thread Ariadne gave Theseus to find his way out of the labyrinth — the archaic spelling, and the direct ancestor, of the word “clue”.

A symbol graph of your repository, served to Claude over MCP. One lookup returns a function’s body with its callers, its callees, the thread it runs on and the locks it takes — instead of a chain of greps the agent rebuilds every session and loses at every context compaction.

flowchart LR
  repo[your repository] --> index[(clew index)]
  index --> agent([the agent, over MCP:<br/>one call per question])
  index --> wiki([you, in the wiki:<br/>requirements · flows · map])

What you get

  • One call instead of a search chain. dossier answers “who calls this, and what does it touch” in a single reply, including relationships grep cannot see: function-pointer callbacks, thread entry points, the locks held around a call.

  • Answers that say what they do not know. An unresolved call, a layer that failed to build, or a file clew cannot parse is reported as unresolved — never quietly as “none”.

  • An index that keeps itself current. A saved file refreshes its repository’s index within about a second (a file-change event, not a poll); a query against a stale index refreshes it before answering, and only edited files are re-parsed. Separate git worktrees get separate indexes.

  • A wiki generated from the index. Requirements and the tests that verify them, sequence flows, a system map and a page per function, built as a static site, as Markdown for a GitHub or Azure DevOps wiki, or served live by the MCP server (the wiki).

  • What the server serves: three tools — dossier, search and index — plus the propose_declaration prompt and the wiki as MCP resources (clew://wiki/{slug}/llms.txt, clew://wiki/{slug}/flow/{name}).

  • Measured, not asserted. Each release is graded against the same agent working without clew, and published with the defects that move its numbers: acceptance results.

Quick start

curl -LsSf https://astral.sh/uv/install.sh | sh   # the plugin launches clew through uv
sudo apt install doxygen       # only for C and C++ (brew install doxygen on macOS)

Then, in Claude Code:

/plugin marketplace add tvanfossen/clew
/plugin install clew@clew

The plugin runs the clew-trace release it was published with, through uvx; the first launch installs it. To register clew without the plugin, see Install.

Ask Claude to index the repository — it calls index(action='refresh') — then ask about your code. Rust repositories also need cargo +nightly.

What the plugin runs, sends and fetches. An MCP server (clew-mcp) that builds and queries a local SQLite index under ~/.local/state/clew, and one PostToolUse hook (clew-hook) that, after a file read or search, adds a short note naming the index call that would have answered more; CLEW_HOOK_DISABLE=1 turns it off. Its first launch fetches the pinned clew-trace release from PyPI through uv; after that, clew itself sends nothing over the network. Building an index runs the repository’s own tooling — doxygen on C/C++, and cargo on Rust, which can download the crate’s dependencies — so treat indexing a tree like building it. See SECURITY.md.

Language support

Language

Symbols

Call graph

Doc comments

C

✓

✓

✓

C++

✓

✓

✓

Rust

✓

✓

✓

Python

✓

✓

✓

JavaScript

✓

✓

✓

TypeScript

✓

✓

✓

shell

✓

—

✓

CMake

✓

—

✓

YAML, JSON, Perl, Make

name only

—

—

Each language links to what its front end populates and what it cannot. Every cell is re-measured by a test that builds a fixture in that language.

Learn more

MIT licensed.