writ_scan
Scan a local directory for consequential writes without calling the gate or modifying files. Returns per-language counts and capped findings to support commit-time policy review.
Instructions
Scan a local directory for consequential writes (no gate call).
LOCAL-ONLY: this tool never calls the Writ gate, needs no API key, and never rewrites files. It runs the pywrit scanner in-process over the directory: Python (ast, always available), plus TypeScript/JavaScript and Go (tree-sitter, scan-only exactly as the CLI reports them - the scanner never instruments those files).
Prerequisite: the pywrit scanner must be installed in the same Python environment as this server; TS/JS and Go parsing additionally needs the polyglot extra:
pip install "pywrit[polyglot]"Args: path: Directory to scan (test files and vendored trees are skipped). include_non_product: Also report writes under docs/, scripts/, examples/, sandbox/, benchmark/, demo/, and build-tooling files. Default False: they are counted under per-language "suppressed" totals instead of becoming findings (never silently dropped). max_findings: Findings list cap (default 25, minimum 1). When the cap cuts the list, "findingsTruncated" carries the count left out.
Returns a summary: path, per-language files/sites/gated counts, suppressed non-product totals by class, notScanned per language when the polyglot extra is missing (files seen, none scanned), a verdict line, and findings capped at max_findings: [{file (relative to the scanned root), line, kind, function, class, verb, snippet}] sorted by file then line. On error returns {error, status, detail}.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "writ_scan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | ||
| max_findings | No | ||
| include_non_product | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |