weave cite ai:rag -f src/search.ts
Modern code is woven from many sources — patterns, papers, libraries, prior work, ideas an AI suggested. weave records where each one came from as a thread. git tracks lineage · weave tracks influence
A thread is a typed, weighted link from a region of your code to the canonical idea it came from — kept in .weave/ next to the code and committed with it.
weavehub is the shared catalog of those ideas. Your threads stay in your repo; weavehub is the index — the way npmjs.com is to npm.
# install once — gives you the `weave` and `weave-mcp` commands
npm install -g weavehub
weave init # create .weave/ (layers on git), no signup, works offlineweave discover # e.g. detects ai:rag, cloud:retry-backoff, agentic:mcp…// @weave derived-from ai:rag@2 :: hybrid retrieval + rerank
weave scanweave blame src/search.ts · weave status · weave attributionai:rag v1→v2), weave flags the code that used the old version and can hand an agent a build brief to update it.weave outdated · weave update --allweave ships an MCP server, so a coding agent records and queries threads as it builds — provenance captured at authoring time, not reconstructed later. Threads the agent records are tagged with its model id, so they're distinct from your own.
Add the MCP server, then the /weave command.
# 1 · register the MCP server — .mcp.json (or claude mcp add)
{ "mcpServers": { "weave": { "command": "weave-mcp" } } }
# 2 · add the slash command
cp weave.md ~/.claude/commands/Then /weave ai:rag scaffolds the pattern and records the thread — one command brings in the code and its citation.
Same server, standard MCP config — no lock-in.
{ "mcpServers": { "weave": { "command": "weave-mcp" } } }Tools the agent gets: