Wt-radar: Real-time Git worktree collision radar (Rust, Tree-sitter, MCP) An open-source Rust tool called wt-radar, released by developer rxxusp, detects collisions between parallel AI coding agents and teammates working in linked Git worktrees before a commit lands, flagging overlapping functions, hunks, lockfiles and database migrations across four severity tiers. In a benchmark on a 100,000-file monorepo with 20 active worktrees, wt-radar measured 0.025 ms p50 incremental collision detection latency against a 50 ms budget and 12.28 MB resident memory against a 30 MB budget, using pure-Rust gix, native filesystem watchers and embedded Tree-sitter parsers. The tool ships as a CLI, TUI, daemon and native MCP server, plus an optional coordination hub (wt-radar-hub), and is installable via Homebrew, Cargo, Winget or container images tagged 1.0.0. Stop parallel AI coding agents and teammates in Git worktrees from silently colliding on the same functions, hunks, lockfiles, and database migrations—before anyone hits git commit . wt-radar is a lightweight, open-source Rust daemon, CLI, TUI, Native MCP Server, and optional zero-code coordination Hub wt-radar-hub that monitors all linked Git worktrees locally and across your engineering team in real time. Rendered with VHS https://github.com/charmbracelet/vhs from docs/vhs/mcp-collision-demo.tape https://github.com/rxxusp/wt-radar/blob/main/docs/vhs/mcp-collision-demo.tape against the real wt-radar binary and its stdio MCP server demo repo seeded by docs/vhs/setup-demo-repo.sh https://github.com/rxxusp/wt-radar/blob/main/docs/vhs/setup-demo-repo.sh . bash acme-billing cursor $ wt-radar status wt-radar status | repo: c9abac72d811 | worktrees: 3 | collisions: 3 | scan: 38ms | rss: 15.0 MB COLLISIONS +----------+-------------+-----------------+----------------------------+---------------------------------+ | SEVERITY | TIER | WORKTREES | FILE | LINES / SYMBOLS | +----------+-------------+-----------------+----------------------------+---------------------------------+ | BLOCK | T4:Critical | cursor ↔ claude | db/migrations/001 init.sql | L5 | rule:builtin:migration:dir | | WARN | T3:AST | cursor ↔ claude | src/billing.ts | L12-13 | 2 sym s | | WARN | T2:Hunk | cursor ↔ claude | config/routes.txt | L4-5 | +----------+-------------+-----------------+----------------------------+---------------------------------+ acme-billing cursor $ mcp-call check collision '{"file path":"db/migrations/001 init.sql"}' | jq '{action, critical rule id}' { "action": "block", "critical rule id": "builtin:migration:dir" } Rendered from docs/vhs/tui-demo.tape https://github.com/rxxusp/wt-radar/blob/main/docs/vhs/tui-demo.tape . Pick your preferred one-line installer ships both wt-radar and wt-radar-hub : macOS / Linux Homebrew brew install rxxusp/tap/wt-radar macOS / Linux Shell installer via cargo-dist curl --proto '=https' --tlsv1.2 -LsSf https://github.com/rxxusp/wt-radar/releases/latest/download/wt-radar-cli-installer.sh | sh Cargo Rust 1.96+ cargo install wt-radar-cli wt-radar-hub Windows PowerShell / Winget winget install wt-radar.wt-radar or: irm https://github.com/rxxusp/wt-radar/releases/latest/download/wt-radar-cli-installer.ps1 | iex Container Images multi-arch linux/amd64 & linux/arm64, distroless nonroot docker pull ghcr.io/rxxusp/wt-radar-hub:1.0.0 docker pull ghcr.io/rxxusp/wt-radar:1.0.0 Initialize Policy-as-Code and inspect your repository in seconds: wt-radar init creates .wtradar.toml wt-radar status 4-tier collision scan across all linked worktrees wt-radar watch start background daemon + local IPC socket wt-radar tui open live interactive dashboard wt-radar enforces hard local resource budgets < 30 MB RSS, < 1% CPU, < 50 ms incremental check using pure-Rust gix no git CLI subprocesses , native OS filesystem watchers notify with adaptive burst shedding, and embedded Tree-sitter parsers. | Benchmark Metric 100,000-File Monorepo, 20 Active Worktrees | Engineering Budget | Measured wt-radar-core/FourTierDetector , macOS/aarch64 | Status | |---|---|---|---| | Incremental collision detection latency p50 / p95 / p99 | < 50.0 ms | 0.025 ms / 0.026 ms / 0.026 ms | PASS | | Live process memory footprint 100k index + 20 worktrees RSS | < 30.0 MB | 12.28 MB 3.81 MB compact index heap | PASS | | 100k-file monorepo index build time | — | 29.44 ms | INFO | | 100k-path salted BLAKE3 hashing throughput hex / raw | 250k paths/sec | 3,452,780 paths/s 28.96 ms / 3,396,282 paths/s | PASS | Reproduce locally at any time: cargo run --release -p wt-radar-bench -- --files 100000 --assert-budgets Spin up a zero-code wt-radar-hub coordination server with live Prometheus metrics and a pre-provisioned Grafana dashboard in under a minute—no external database required: docker compose -f deploy/docker-compose.yml up -d Services exposed locally: | Service | Endpoint | Purpose | |---|---|---| | wt-radar-hub gRPC | localhost:50051 | Bidirectional HubSyncService StreamSync , Heartbeat , GetClusterState , CheckHealth | | wt-radar-hub HTTP | http://localhost:9090/metrics | Prometheus metrics, /healthz , /readyz , and /api/v1/cluster | | Prometheus | http://localhost:9091 | Scrapes wt-radar-hub:9090/metrics | | Grafana | http://localhost:3000 | Prebuilt wt-radar Hub dashboard active worktrees, collisions by tier, sync latency, leases | Point any local daemon at the hub with your shared team salt: export WT RADAR SALT="replace-with-team-256bit-secret" wt-radar watch --hub http://localhost:50051 Stop and clean up with docker compose -f deploy/docker-compose.yml down -v . Every edit across local linked worktrees—or synced remote worktrees—is evaluated through four progressively deeper tiers: | Tier | Name | Default Severity | What It Catches | |---|---|---|---| | Tier 1 | tier1 path | info | Same normalized file path path hash modified, renamed, or deleted across two worktrees. | | Tier 2 | tier2 hunk | warn | Overlapping or nearby diff line hunks hunk proximity lines = 5 by default computed against merge-base. | | Tier 3 | tier3 ast semantic | warn | Tree-sitter AST collisions across TypeScript, JavaScript, Python, Rust, Go, Java, and C++—detecting when Worktree A alters a function/class/struct/interface signature or export that Worktree B is editing or calling. | | Tier 4 | tier4 critical asset | block | Concurrent mutations to high-blast-radius assets: 26 built-in rules for lockfiles Cargo.lock , package-lock.json , pnpm-lock.yaml , uv.lock , go.sum , etc. , DB migrations /migrations/ , Prisma, Alembic , IaC .tf , Helm, K8s, Dockerfiles , wire schemas .proto , OpenAPI, GraphQL , plus custom critical assets.protected globs . | wt-radar-hub never receives, inspects, or stores your source code, file paths, branch names, or symbol names . - Before leaving your machine, SaltedHasher derives a 256-bit keyed BLAKE3 key from your organization salt WT RADAR SALT , KDF context "wt-radar v1 salted-hash key derivation" and computes domain-separated 64-char hex digests for repo hash , path hash , branch hash , symbol hash , and signature hash . - Protobuf conversion wt-radar-proto physically strips all plaintext local fields local path , local branch , local root , local name at the type boundary. - Ephemeral worktree leases expire automatically after 60s lease ttl secs without a Heartbeat , ensuring closed laptops and crashed containers never leave ghost conflicts. - Supports mTLS ca cert path , client cert path , client key path , OIDC/JWT Bearer authentication, and Air-Gapped single-VPC deployments. See docs/privacy-and-security.md https://github.com/rxxusp/wt-radar/blob/main/docs/privacy-and-security.md for the full threat model and wire audit. wt-radar ships a native Model Context Protocol server built on the official Rust rmcp SDK, supporting both stdio and Streamable HTTP --transport stdio|http --bind 127.0.0.1:3849 . Exposed MCP tools: - check collision file path, line start?, line end?, worktree id? — returns allow | warn | block with colliding worktrees and actionable agent guidance. - list worktrees — lists all active local and synced peer worktrees. - list collisions min severity? — queries active collisions filtered by severity. - get policy — inspects .wtradar.toml rules and critical asset globs. { "mcpServers": { "wt-radar": { "command": "wt-radar", "args": "mcp", "--transport", "stdio" } } } Or run Streamable HTTP for shared container/remote agent sandboxes: wt-radar mcp --transport http --bind 127.0.0.1:3849 Full agent setup guides and system-prompt guardrails live in docs/mcp-integration.md https://github.com/rxxusp/wt-radar/blob/main/docs/mcp-integration.md . | Profile | Scale | Storage & Pub/Sub | Auth & Network | Deployment Artifact | |---|---|---|---|---| | Solo / Local | 1 dev, N agents | Local in-memory + Unix socket / Named pipe | Local OS permissions 0600 | docs/systemd/wt-radar.service https://github.com/rxxusp/wt-radar/blob/main/docs/systemd/wt-radar.service , docs/launchd/dev.wtradar.daemon.plist https://github.com/rxxusp/wt-radar/blob/main/docs/launchd/dev.wtradar.daemon.plist | | Team Box | 1–50 devs | Embedded SQLite WAL or in-memory | Optional mTLS / OIDC | deploy/docker-compose.yml https://github.com/rxxusp/wt-radar/blob/main/deploy/docker-compose.yml | | Enterprise Fleet | 50–5,000+ devs | PostgreSQL + Valkey/Redis or NATS | mTLS + OIDC/JWKS + Multi-AZ HPA | deploy/helm/wt-radar-hub/ https://github.com/rxxusp/wt-radar/blob/main/deploy/helm/wt-radar-hub & deploy/docker-compose.fleet.yml https://github.com/rxxusp/wt-radar/blob/main/deploy/docker-compose.fleet.yml | | Air-Gapped / Regulated | Any | Private registry + internal Postgres/Valkey | Mandatory internal PKI mTLS + deny-all egress NetworkPolicy | deploy/helm/wt-radar-hub/values-airgapped.yaml https://github.com/rxxusp/wt-radar/blob/main/deploy/helm/wt-radar-hub/values-airgapped.yaml | See docs/deployment.md https://github.com/rxxusp/wt-radar/blob/main/docs/deployment.md for production runbooks, webhooks Slack, Discord, Mattermost , and OpenTelemetry/Prometheus observability. Commit .wtradar.toml to your repository root to standardize severity thresholds, protected globs, watcher burst protection, AST languages, and Hub sync settings across humans, CI, and MCP agents: version = 1 severity tier1 path = "info" tier2 hunk = "warn" tier3 ast semantic = "warn" tier4 critical asset = "block" hunk proximity lines = 5 critical assets enable builtins = true critical assets.protected globs id = "billing-migrations" pattern = "db/migrations/ / .sql" severity = "block" reason = "Database migrations must be sequenced by one worktree at a time." resources max rss mb = 30 max cpu percent = 1.0 hub enabled = false endpoint = "https://wt-radar-hub.internal:50051" lease ttl secs = 60 heartbeat interval secs = 20 salt env var = "WT RADAR SALT" Complete schema documentation: docs/policy-reference.md https://github.com/rxxusp/wt-radar/blob/main/docs/policy-reference.md . custom.wt radar command = "wt-radar prompt --format starship --quiet-clean" when = "git rev-parse --is-inside-work-tree /dev/null 2 &1" format = " $output $style " style = "bold yellow" set -g status-right ' wt-radar prompt --format tmux | %H:%M ' Displays wt:3 ⚡1 when collisions are active or wt:3 ✓ when clean . Both extensions connect directly to the local wt-radar watch daemon over NDJSON Unix domain sockets $XDG RUNTIME DIR/wt-radar.sock / $TMPDIR/wt-radar-