"Don't take a fence down until you know the reason it was put up."
— G.K. Chesterton
wisegit is a local MCP server that extracts decision intent from git history and protects intentional code from AI modification.
When Claude Code (or any MCP-compatible agent) is about to edit a file, wisegit injects a decision manifest showing which functions are frozen, stable, or open — so the AI respects what was intentional, not just what compiles.
Zero config. Zero external services. Everything local.
The Problem
LLMs have no concept of intentional code. A manually-tested fix and a broken stub look identical — both are just text. Real scenario:
You fix a Stripe race condition with sleep(350) — manually tested, committed.
Next session: "find bugs." Claude removes sleep(350) — looks like dead code.
Production incident.
Root cause: git history contains proof of intention. Nobody extracts it.
How It Works
Git History → Tree-sitter AST → Intent Extraction → SQLite Event Store → MCP Tools
Indexes your git history — walks every commit, parses diffs at the AST level (function boundaries, not line counts)
FROZEN (score >= 0.80): Do not modify without explicit user approval
STABLE (score 0.50-0.79): Proceed with caution, review intent first
OPEN (score < 0.50): Safe to modify freely
Quick Start
Prerequisites
Node.js >= 20
That's it. No Docker, no PostgreSQL, no external services.
1. Set Up a Repository (one command)
cd /path/to/your/repo
npx @sandip124/wisegit setup
This single command:
Creates a local SQLite database at ~/.wisegit/wisegit.db
Indexes your entire git history (462 commits in ~13 seconds)
Creates .mcp.json for Claude Code auto-discovery
Creates CLAUDE.md rules that instruct AI to check before editing
Adds .mcp.json to .gitignore
2. Enrich with Issue Context (optional)
# Fetch issue/PR details from GitHub/GitLab
GITHUB_TOKEN=ghp_... npx @sandip124/wisegit enrich
This fetches referenced issues (e.g., #134 in commit messages), detects Won't Fix / By Design decisions, and boosts freeze scores for functions linked to those issues.
3. Done
Open the repo in Claude Code. It will automatically:
Start the wisegit MCP server (via .mcp.json)
Read the protection rules (via CLAUDE.md)
Call get_file_decisions before editing any file
MCP Tools
Tool
Description
get_file_decisions
Decision manifest for a file — freeze scores, intent history, recovery levels, override status
get_freeze_score
Score + signal breakdown for a specific function
get_function_history
Full chronological decision timeline for a function
get_theory_gaps
Functions with unrecoverable rationale (inactive authors, timeline gaps)
get_branch_context
Branch merge history — what was migrated and why
search_decisions
Search past decisions by keyword across the entire repo
create_override
Override a frozen function (user approves in Claude Code UI)
extract_intent
Extract intent for NOISE commits using the host LLM — no Ollama needed
MCP Resource:wisegit://manifest/{filePath} — decision manifest as auto-discoverable resource
LLM Intent Extraction Strategy
wisegit uses a smart fallback chain for extracting intent from NOISE commits:
Context
LLM Used
How
Inside Claude Code
Host LLM (Claude)
MCP sampling — asks Claude to analyze the diff. Zero setup.
CLI with Ollama
Ollama (llama3)
wisegit init --ollama — uses local Ollama instance
CLI without Ollama
None
Rule-based extraction only, NOISE commits get no intent
Inside Claude Code, call extract_intent to retroactively recover intent for NOISE commits — uses Claude itself, no Ollama installation needed.
CLI Commands
wisegit setup [--path <dir>] [--global] # One-command repo setup
wisegit init [--full-history] [--path <dir>] # Index git history
wisegit enrich [--path <dir>] # Fetch issue/PR context from GitHub/GitLab
wisegit audit <file> # Show decision manifest
wisegit history <target> [--file <path>] # Show decision timeline
wisegit recompute [--path <dir>] # Recompute scores with PageRank + theory gaps
wisegit override <fn> --file <f> --reason "..."# Override a frozen function
wisegit overrides # List active overrides
wisegit sync# Rebuild local cache from git + .wisegit/
wisegit config list # View team configuration
wisegit config set <key> <value> # Modify team policy
wisegit team-status # Team overview: enrichments, overrides, contributors
wisegit team-health # Theory health: healthy/fragile/critical functions
wisegit branch-capture # Capture branch context from last merge
wisegit branch-list # List all captured branch snapshots
wisegit branch-recover <sha> # Recover context from old merge commit
wisegit serve # Start MCP server (stdio)
wisegit hook install|uninstall # Manage git hooks (post-commit + post-merge)
Configure for Claude Code
Option A: Per-repo (recommended)
Run npx @sandip124/wisegit setup in any repo. It creates .mcp.json automatically.
Option B: Global registration
claude mcp add wisegit -- npx @sandip124/wisegit serve
More languages can be added via Tree-sitter grammar configs in src/ast/languages/.
Issue Enrichment
A commit saying fix: handle null token #134 points to an issue containing reproduction steps, root cause, and explicit decision rationale — everything the commit message never says.
# Fetch issue context from GitHub/GitLab
wisegit enrich --path /path/to/repo
# With auth (5000 req/hr instead of 60)
GITHUB_TOKEN=ghp_... wisegit enrich
Academic grounding: 12 published papers. See REFERENCE.md for full citations.
Legacy Codebase Evolution
wisegit is designed for codebases that have accumulated years of intentional decisions. The freeze score doesn't mean "never change this" — it means "understand these decisions before you change it."
Progressive migration, not shiny rewrites. Per Távora [12]: the business rules in messy code are correct and valuable. The technical debt is in the structure, not the decisions. wisegit protects the decisions while you fix the structure.
Stage
How wisegit helps
Understand AS-IS
wisegit audit shows what's intentional. wisegit team-health shows where institutional knowledge is lost.
Protect during refactoring
Manifests tell developers + AI which behaviors were deliberately chosen
Record rationale
Override reasons persist in .wisegit/overrides.jsonl — not buried in Slack
Preserve migration context
Branch snapshots record what was replaced and what should never return
Track cross-boundary deps
Co-change signals detect coupling between legacy and replacement code
See REFERENCE.md for the full legacy evolution section with academic grounding (12 published papers).
Team Support
wisegit uses a three-layer architecture — no separate "team mode" needed:
MCP server that extracts decision intent from git history and protects intentional code from AI modification
The npm package @sandip124/wisegit receives a total of 40 weekly downloads. As such, @sandip124/wisegit popularity was classified as not popular.
We found that @sandip124/wisegit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 26 Mar 2026
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
NIST disclosed an unreleased AI tool called V-etalon and opened a broad inquiry into NVD modernization after years of automation plans produced no public enrichment system.