Skip to content

Commit c6c5f64

Browse files
ithiria894claude
andcommitted
readme: add static scanner + runtime hook setup guides with ASCII diagrams
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 828562c commit c6c5f64

1 file changed

Lines changed: 82 additions & 1 deletion

File tree

README.md

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,88 @@ First scan downloads Qwen2.5-0.5B (~1 GB, once). After that, everything stays lo
184184
└──────────────────────────────────────────────────────────┘
185185
```
186186

187-
For runtime hook integration, see [docs/RUNTIME_HOOKS.md](docs/RUNTIME_HOOKS.md).
187+
## Setup: Static Scanner
188+
189+
Scan MCP servers, packages, and skills **before** you install them.
190+
191+
```bash
192+
# Scan a folder (package.json, MCP configs, SKILL.md, READMEs)
193+
intentprobe scan-path ./some-mcp-server --format summary --fail-on block
194+
195+
# Scan a single tool description
196+
intentprobe scan --format summary \
197+
--text "Reads SSH config and returns host aliases."
198+
199+
# Batch scan a JSON array of descriptions
200+
intentprobe batch --batch-file tools.json --format summary
201+
202+
# CI gate: exit code 2 if any tool is blocked
203+
intentprobe scan-path ./my-mcp-package --fail-on block
204+
```
205+
206+
```
207+
┌─────────────────────────────────────────────────────────────┐
208+
│ Static scan workflow │
209+
│ │
210+
│ You find a new MCP server on GitHub │
211+
│ │ │
212+
│ ▼ │
213+
│ git clone <repo> │
214+
│ │ │
215+
│ ▼ │
216+
│ intentprobe scan-path ./repo --fail-on block │
217+
│ │ │
218+
│ ├──→ allow ──→ safe to install │
219+
│ ├──→ warn ──→ review the flagged descriptions │
220+
│ └──→ block ──→ do NOT install (exit code 2) │
221+
└─────────────────────────────────────────────────────────────┘
222+
```
223+
224+
## Setup: Runtime Hook
225+
226+
Scan tool calls **as they happen** inside Claude Code. The model stays warm in memory for sub-second latency.
227+
228+
**Step 1:** Add to your Claude Code `settings.json` or `.claude/settings.json`:
229+
230+
```json
231+
{
232+
"hooks": {
233+
"PreToolUse": [
234+
{
235+
"command": "intentprobe runtime scan --input-format jsonl --fail-on block",
236+
"timeout": 10000
237+
}
238+
]
239+
}
240+
}
241+
```
242+
243+
**Step 2:** That's it. Every tool call is now scanned before execution.
244+
245+
```
246+
┌─────────────────────────────────────────────────────────────┐
247+
│ Runtime hook workflow │
248+
│ │
249+
│ Claude Code wants to call a tool │
250+
│ │ │
251+
│ ▼ │
252+
│ PreToolUse hook fires ──→ intentprobe runtime scan │
253+
│ │ │
254+
│ ├──→ allow ──→ tool executes normally │
255+
│ ├──→ warn ──→ logged, tool still executes │
256+
│ └──→ block ──→ tool call STOPPED (exit code 2) │
257+
│ │
258+
│ Model stays warm via JSONL protocol. <1s per scan. │
259+
└─────────────────────────────────────────────────────────────┘
260+
```
261+
262+
**Test it safely** (no real tools, everything in memory):
263+
264+
```bash
265+
.venv/bin/python examples/runtime_toy_agent.py --allow-download
266+
```
267+
268+
For the full event schema and JSONL protocol, see [docs/RUNTIME_HOOKS.md](docs/RUNTIME_HOOKS.md).
188269

189270
## What it scans
190271

0 commit comments

Comments
 (0)