jev-logscan
A build just printed 17,000 lines and six of them explain the failure. Reading all of it costs your context; scrolling for the error costs your turn.
Use it
pytest -v 2>&1 | python3 "$CLAUDE_SKILL_DIR/../../scripts/logscan.py" \
--goal "find out which test failed and why"
python3 .../logscan.py --log build.log --goal "find out why the link step failed"
python3 .../logscan.py --log train.log --goal "find where loss became NaN" --budget 60
--goal is the whole interface. The ranking is conditioned on it, so ask
for what you actually want:
"why did this fail"→ errors, tracebacks, the failing assertion"where did it get slow"→ timings and durations, not errors"what configuration was used"→ the settings echoed at startup"what ran out of memory"→ allocation and OOM lines
Same log, different lines out.
Reading the output
Lines come back in their original order, with elided runs marked, because a
log read out of sequence is unusable. Original line numbers are preserved so you
can go back to the source. A ! marks a line that matched an error shape
(traceback, SyntaxError:, FAILED, panic:) and was kept regardless of score.
If nothing in the log addresses your goal, it says so instead of padding the output with the least-bad lines.
How it decides
Logs are templated — a build prints Compiling './x'... seventeen thousand
times — so lines are collapsed to their shape first (paths, numbers and hashes
normalised away), each distinct shape is scored once, then expanded back. On a
17,591-line build log that is 24 distinct shapes, which is why this is fast and
cheap on logs that would otherwise be enormous.
Three signals combine: goal relevance from Jev, rarity (a shape seen once matters more than one seen 17,000 times), and error shape as a floor that catches crashes whatever you asked for.
Flags
--budget N— keep at most N lines, best first. Without it, everything above--keep-floor(default0.10, the measured noul floor) is kept.--no-always— stop force-keeping error-shaped lines.--no-jev— rarity and error shape only, no network, no key.--json— machine-readable, with per-line scores and original line numbers.
Under 40 lines the script just echoes the input; short logs do not need this.
Setup
export TYPESAFE_API_KEY=... # https://typesafe.ai