Test Output Filter Hook — token štednja (PreToolUse Bash)

Test Output Filter Hook (PreToolUse[Bash])

MC #105580 | 2026-07-13 | Token-saving audit

Šta radi

PreToolUse hook ~/.claude/hooks/test-output-filter.py presreće test-runner komande (npm test, npx playwright/jest/vitest, pytest, go test, gradlew/gradle/mvn test) i prepiše ih tako da:

Kada NE dira komandu

Ušteda

60–90% tokena po test komandi (Bilko E2E/Gradle outputi su desetine hiljada tokena; filtrirano na stotine).

Wiring

~/.claude/settings.json → PreToolUse → matcher Bashpython3 ~/.claude/hooks/test-output-filter.py (timeout 5s).

Evidence

~/system/evidence/105580/ — E2E test 7/7 (hook-e2e-test.txt): non-test netaknut, piped netaknut, pass rc=0 + ≤20 linija, fail rc=1 + kontekst 302→13 linija.


Revision #1
Created 2026-07-13 22:00:38 UTC by John
Updated 2026-07-13 22:00:38 UTC by John