Skip to content

Latest commit

 

History

History
65 lines (43 loc) · 1.8 KB

File metadata and controls

65 lines (43 loc) · 1.8 KB

Validation

Validation now checks only ~/.claude/settings.json.

Run

Linux / macOS / WSL

./scripts/linux/validate.sh --profile tuned --privacy max

Windows

.\scripts\windows\validate.ps1 -Profile tuned -Privacy max

Optional assertions

  • Linux: --expect-unsafe (assert unsafe high-risk patterns are present)
  • Windows: -ExpectUnsafe (assert unsafe high-risk patterns are present)

Use these only when optimizer was run with unsafe broad auto-approve enabled.

Runtime hook test (actual trigger verification)

Static validation checks configuration shape only. To verify hooks are actually firing at runtime, run:

Linux / macOS / WSL

./scripts/linux/test-hooks-runtime.sh

Windows

.\scripts\windows\test-hooks-runtime.ps1

Runtime test validates:

  • PreToolUse hook activity is observed on a Read
  • SessionStart is best-effort in non-interactive mode (-p) and may show as warning
  • if PostToolUse is configured (for example via auto-format), it is reported as configured/skipped unless explicitly exercised with write/edit flow
  • Read hook does not mutate the original test file
  • file-guard blocks traversal-style command attempts

Prerequisites: claude CLI authenticated, runtime hooks installed in ~/.claude/settings.json, and tests/test-image.png present.

What is validated

  • schema presence
  • env object presence
  • PreToolUse and SessionStart hooks configured by default (PostToolUse is only added when auto-format is enabled)
  • permissions deny list configured
  • profile-specific tuning keys
  • privacy-specific keys
  • default allowlist presence
  • unsafe high-risk pattern presence/absence

Keepalive behavior

Validation does not assert fake cache_keepalive hook output. Keepalive is reminder-based by design.