Sourcebook

io.github.maroondlabsPublished by GitHub account maroondlabsv0.9.5Updated Oct 24, 2026

Live codebase intelligence for AI agents: conventions, blast radius, import graphs, git insights.

VerifiedSTDIODesktop onlyKnowledge & MemoryDeveloper Tools

Overview

AI-generated overview

Local MCP server that gives an AI assistant live codebase intelligence: repo structure, import graphs, blast radius, conventions and git co-change data.

What you can do
  • Query repository structure, conventions and a Repo Truth Map for the project directory
  • Inspect import graphs, hub files and the blast radius of a change
  • Look up git co-change companions and which files historically change together
  • Check a diff for completeness: missing test files, sibling modules and related config
  • Run AI-assisted semantic analysis of a diff when an Anthropic API key is configured
When to use it
Useful when an assistant edits code in a git repository and you want it to know which other files a change probably touches, or to check a diff for missing tests and dependents before committing. Best suited to TypeScript/JavaScript, Python and Go projects.
Requirements
Runs locally over stdio, started with npx sourcebook serve and pointed at a project directory. Needs Node.js and a local git repository with history. The AI semantic layer requires the ANTHROPIC_API_KEY environment variable; the rules-based layer needs no configuration.
Before you install
The AI layer sends the diff plus dependency context to Claude Sonnet, so code leaves your machine and incurs per-run cost (about $0.012 per run per the README). The init command installs Claude Code hooks and generates CLAUDE.md/AGENTS.md files in the repository. Detection rates for test and sibling files are reported as partial, so findings should be reviewed rather than trusted blindly.

Installation

In SourceWeft

  1. Open Sourcebook in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

[sourcebook]

sourcebook

Catches the files your AI agent forgot to change.

A safety layer for code changes. sourcebook analyzes git diffs for completeness — flags files that should've been modified but weren't. Rules-based structural detection plus AI-powered semantic analysis. Zero false positives on clean diffs.

bash
npx sourcebook init          # sets up Claude Code hooks + generates CLAUDE.mdnpx sourcebook check         # check your current diff for missing filesnpx sourcebook scan-history  # see what you've been missing

What It Catches

Your AI agent changed the handler. Did it update the test? The sibling module? The config that references the old value?

sourcebook checks your diff against the repo's actual structure:

  • Missing test files — source file changed, test file didn't
  • Sibling modules — files that import or are imported by what you changed
  • Co-change companions — files that historically change together in git commits
  • Hub file blast radius — you touched something with 50+ dependents

With --ai: cross-module semantic relationships, field renames that need migrations, stale validation logic.

Key Stats

MetricResult
Completeness gate100% accurate (30/30 diffs)
False positive rate0% on clean diffs
Test file detection73%
Sibling detection71%
AI analysis cost~$0.012/run

Four Surfaces

1. CLI

Run it on any diff. No setup required.

bash
npx sourcebook check              # check staged/unstaged changesnpx sourcebook check --ai         # add AI semantic analysis (requires ANTHROPIC_API_KEY)npx sourcebook check --quiet      # exit code only (for CI/scripts)npx sourcebook check --branch main  # compare vs a branch

2. Claude Code Hooks

One command wires up pre-commit hooks. Agent edits a file, sourcebook checks the diff, agent sees what's missing — all before the commit lands.

bash
npx sourcebook init   # generates CLAUDE.md + installs hooks

3. MCP Server

Published on the official MCP registry. Agents can query repo structure, blast radius, conventions, and co-change data on demand.

bash
npx sourcebook serve

Add to your MCP client:

json
{  "mcpServers": {    "sourcebook": {      "command": "npx",      "args": ["-y", "sourcebook", "serve", "--dir", "/path/to/your/project"]    }  }}

4. GitHub App (coming soon)

Automated completeness checks on every pull request. Join the waitlist.

Commands

CommandDescription
sourcebook checkAnalyze current diff for completeness
sourcebook check --aiAdd AI-powered semantic analysis (requires ANTHROPIC_API_KEY)
sourcebook check --quietExit code only — 1 if findings, 0 if clean
sourcebook check --jsonStructured JSON output
sourcebook check --branch mainCompare HEAD against a branch
sourcebook check --threshold 0.9Custom co-change coupling threshold (0-1)
sourcebook initSet up Claude Code hooks + generate CLAUDE.md/AGENTS.md
sourcebook scan-historyRetrospective scan of recent commits
sourcebook hooksInstall or check Claude Code hooks
sourcebook truthGenerate a Repo Truth Map (2.5D visualization)
sourcebook serveStart MCP server
sourcebook updateRe-analyze while preserving manual edits
sourcebook diffShow what would change (exit code 1 if changes found)
sourcebook watchAuto-regenerate context files on source changes
sourcebook ask <query>Query codebase knowledge in natural language

How It Works

Layer A — Rules-based (no LLM, <1 second)

  1. Co-change analysis — mines git history for files that change together. If you touched auth.ts and it changes with session.ts in 88% of commits, sourcebook flags session.ts.
  2. Test file detection — maps source files to test files via naming conventions and co-change history.
  3. Import graph — builds a dependency graph and checks whether files that import (or are imported by) your changed files also need updates.
  4. Hub detection — flags when you've modified a file with high fan-in (many dependents). These changes have blast radius.

Layer B — AI-powered (~$0.012/run)

Sends the diff plus dependency context to Claude Sonnet. Catches semantic relationships Layer A can't see — field renames that need migrations, validation logic that assumes old schemas, cross-module dependencies with no import link.

Every AI suggestion requires a dependency citation. Hallucinated file paths are filtered out. The completeness gate ensures zero false positives: if the diff is actually complete, Layer B stays silent.

Configuration

bash
# Required for --ai flag onlyexport ANTHROPIC_API_KEY=sk-ant-...

No other configuration needed. sourcebook reads your repo's git history and file structure directly.

Language Support

LanguageImport GraphGit AnalysisConvention Detection
TypeScript / JavaScriptFullFullFull
PythonFullFullFull
GoFullFullFull
RustFullFullPartial

Research

Built on real benchmarks, not vibes:

License

BSL-1.1 — source-available, free to use, cannot be offered as a hosted service. Converts to MIT on 2030-03-25. See LICENSE for details.


sourcebook.run · GitHub · npm · @maroond_

Source: README.md at commit d289440

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.9.5LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.