Install XWatch.
XWatch checks every change on your own machine, or inside your coding agent as an MCP server. One line installs it on macOS or Linux.
curl -fsSL https://xtarwall.com/install.sh | sh
Needs Node.js 22.6 or newer. Runs with your own AI key. Free and open source (AGPL-3.0). Windows: use WSL.
The installer downloads XWatch v0.1.0 from GitHub, checks its SHA-256, and installs into ~/.xtarwall. No sudo, no changes to your shell profile. From the .zip: run npm install in the folder, then use node --experimental-strip-types bin/dh.ts mcp as the command below.
npx @xtarwall/xwatch
The npm package is @xtarwall/xwatch. Its commands are xwatch and the alias xtarwall-watch. Install it for good with npm install -g @xtarwall/xwatch.
Connect it to your coding agent
Replace $HOME/code with the folder that holds your repos. XWatch scans repos inside it and nothing else.
claude mcp add xtarwall-watch --scope user -e DH_MCP_ALLOWED_ROOTS="$HOME/code" -- "$HOME/.xtarwall/bin/xtarwall-watch" mcp
codex mcp add xtarwall-watch --env DH_MCP_ALLOWED_ROOTS="$HOME/code" -- "$HOME/.xtarwall/bin/xtarwall-watch" mcp
{
"mcpServers": {
"xtarwall-watch": {
"command": "/Users/you/.xtarwall/bin/xtarwall-watch",
"args": ["mcp"],
"env": { "DH_MCP_ALLOWED_ROOTS": "/Users/you/code" }
}
}
}
For Cursor, use your real home folder in place of /Users/you; the installer prints this block with your path filled in.
Or add it as an MCP server with npx
Claude Code, Codex, Cursor and any other MCP client that takes a JSON config: command npx, args ["-y", "@xtarwall/xwatch", "mcp"]. Nothing to install first.
{
"mcpServers": {
"xwatch": {
"command": "npx",
"args": ["-y", "@xtarwall/xwatch", "mcp"],
"env": { "DH_MCP_ALLOWED_ROOTS": "/path/to/your/code" }
}
}
}
What a scan does
XWatch gives your coding agent four MCP tools. None of them writes to your repo, and output stays small: paths, ids and short text, capped at 50 items.
| Tool | What it returns |
|---|---|
xtarwall_scan_changes | Lists staged, unstaged and untracked changes in a local git repo, against HEAD or the merge-base of a base ref. Finds which configured candidates the change reaches, assesses them and returns findings in four states, with the result of the signed-ledger check. |
xtarwall_get_findings | The last scan's findings in this session, redacted as for an untrusted reader: no proof-of-concept, no target, no evidence, and the leading 16 hex characters of the SHA-256 proof digest. |
xtarwall_explain_finding | One finding: what its state means, the CWE and what to do next. |
xtarwall_status | Model mode, whether a model key variable is set (names, never a value), the run budget, candidates, grants, whether active tests are allowed, and the ledger. |
Passive by default
Nothing is executed against anything unless all three of these hold:
- the agent calls
xtarwall_scan_changeswithactive: true; - you have set
DH_MCP_ACTIVE_CONSENTto exactly the value ofDH_TARGET, your confirmation that formal authorisation for that target is signed and its owner has a backup; DH_GRANTSholds a live active scope grant for that target.
Otherwise every grant is capped at passive and the capability gate refuses to execute. The result is Suspected, never an alert, or Not assessed when there is no grant at all. Active tests run against an ephemeral copy, and a production-looking target is refused. Tool arguments can narrow a scan and cannot grant scope: the target, grants, candidates and keys come from the environment you set when you add the server. The scope gate
What it will not do
- Open a port. XWatch speaks MCP over stdio: no network listener, nothing hosted.
- Scan a remote. The repo path must be an absolute local path inside a git work tree. URLs and
git@host:addresses are refused. Symlinks are resolved, and a path that resolves outside the repo root is refused or dropped. - Let a repo run code through git. Git runs without a shell, with hooks and fsmonitor off, no system or global config, the repo's
.gitattributesignored, external diff and textconv off, a 15-second timeout and a minimal environment that does not carry your model keys. A repo whose own git config sets keys that can run a program is refused before any diff runs. Git 2.40 or newer is required; an older git fails closed. - Leak detail through errors. An internal error reaches the agent as a code and a fixed sentence. The full message goes to the server's stderr.
Signed record
Every scan seals its start, its finish and each assessment's events onto an Ed25519 hash-chained ledger, and verifies the chain before answering. With DH_KEY_DIR the signing key persists; without it the key lives for the server process. DH_MCP_LEDGER_DIR also writes each run's sealed chain and public key to a file with mode 0600. How the ledger verifies
Limits in v0.1.0
- Candidates are yours to declare. Without
DH_CANDIDATESa scan is a change summary. - Model calls are budgeted. With no model key set, every model call goes to an offline mock and costs nothing. A paid call also needs
DH_RUN_BUDGET_CENTS; without it every paid call is refused. A malformed budget, model name or key file stops the server at start. - Findings live in the server process, for one session. The ledger file is the durable copy.
- The repo-config refusal is a deny list. A git config key added in a future git release that can run a program would need adding to it.
- One runtime dependency: the MCP SDK, pinned to an exact version.
Environment
| Variable | Meaning |
|---|---|
DH_MCP_ALLOWED_ROOTS | Absolute folders, joined by :, that may be scanned. |
DH_CANDIDATES | Absolute path to a module whose default export is your candidate list. Needs DH_TARGET. |
DH_TARGET | The scope target your grants name. Shown as a SHA-256 prefix, never in full. |
DH_GRANTS | Absolute path to a JSON array of scope grants: organisation, target, tier and expiry. |
DH_MCP_ACTIVE_CONSENT | Set to the exact DH_TARGET to allow active tests on it. |
DH_RUN_BUDGET_CENTS | Run budget in whole cents. Unset means no paid model call. |
DH_KEY_DIR | Absolute path of a key directory, for a persistent ledger key. |
DH_MCP_LEDGER_DIR | Absolute path, outside the repo, to also write each run's sealed chain. |
DH_ORG_ID, DH_APPLICATION_ID | Ledger ids. Defaults: local and local-repo. |