Pituitary: AI Spec Drift Detection

pituitary peet

Human+AI continuously produce records of intent, decisions, and documentation. Specs, architecture docs, CLAUDE.md files, AGENTS.md, API contracts, runbooks, roadmaps. They accumulate, overlap, contradict each other, and drift from the code. Nobody’s watching the whole corpus.

You find out in a PR review that the doc you’re referencing was outdated two sprints ago. Or you spend an hour writing a decision only to discover someone already wrote one covering the same ground. Or worse, you don’t find out, and it ships.

We hit this problem ourselves so we built Pituitary, and today we're releasing it as open source.

What it does

Point Pituitary at your repo. It indexes your specs, docs, and decision records, then catches what you can’t track by hand:

  • Overlapping decisions. A new spec covers ground an existing one already handles.
  • Stale docs. A spec changed, but the docs that reference it weren’t updated.
  • Code that contradicts specs. Flag diffs that conflict with accepted decisions before merge.
  • Terminology drift. The team adopted new language but old terms persist.
  • Impact chains. Trace which specs, docs, and code paths are affected when a decision changes.

What you wrote down should still be true. Pituitary makes sure it is.

How to try it

Single binary. No Docker. No API keys required. One SQLite file.

# Download from GitHub Releases (Linux, macOS, Windows)
# https://github.com/dusk-network/pituitary/releases

pituitary init --path .
pituitary check-doc-drift --scope all
pituitary review-spec --path specs/your-spec
git diff origin/main...HEAD | pituitary check-compliance --diff-file -

Deterministic by default. Evaluate it on your repo in 30 seconds.

For AI-native workflows

Pituitary ships an MCP server so your AI coding agent gets spec awareness mid-session. Add it to Claude Code, Cursor, or Windsurf:

{
  "mcpServers": {
  "pituitary": {
   "command": "pituitary",
   "args": ["serve", "--config", ".pituitary/pituitary.toml"]
  }
  }
}

Your agent gets six tools: search specs, check for overlap, compare two specs side by side, trace impact when a spec changes, find stale docs, and run a full composite review. It uses them when reviewing PRs, checking whether a change contradicts an accepted decision, or planning changes that touch governed code.

Why we built it

We hit this problem ourselves. Tens of markdown files, specs drifting from each other, GitHub issues replacing specs as source of truth. Nothing we found watched the whole corpus, so we built it.

Code review tools watch code. Documentation tools watch docs. Pituitary catches the drift across both.

What’s next

Pituitary is open source under MIT. The core analysis surface is functional end-to-end. We’re working on broader source coverage (PDFs, JSON configs, GitHub issues) and tighter CI integration patterns.

If your repo has more than a handful of specs and docs, give it a try.

GitHub: https://github.com/dusk-network/pituitary