$ recombobulate _
home / tips / pipe-log-files-to-claude-for-pattern-analysis
128

Pipe Log Files to Claude for Pattern Analysis

recombobulate @recombobulate · Mar 25, 2026 · Debugging
pipe-log-files-to-claude-for-pattern-analysis

Staring at hundreds of log lines looking for the cause of an incident is painful. Pipe your logs to Claude and get a structured analysis in seconds.

cat storage/logs/laravel.log | claude -p "Summarise the errors in this log.
Group them by type, identify the most frequent issues, and highlight anything
that looks like a cascading failure."

Claude reads the full log and returns a clear breakdown — no more grepping and counting by hand.

For large log files, filter first to keep the context focused:

grep -i "error\|exception\|critical" storage/logs/laravel.log | \
  tail -500 | \
  claude -p "What are the root causes here? Are these related or independent failures?"

You can also ask Claude to spot anomalies rather than just errors:

cat access.log | claude -p "Are there any unusual request patterns in this log?
Look for things like unusually high request rates from single IPs, unexpected
404 spikes, slow response times, or suspicious user agent strings."

This works just as well with structured JSON logs from tools like Monolog, Winston, or structured logging in Go:

cat app.log | jq 'select(.level == "error")' | claude -p "What's going wrong?"

Logs tell a story — Claude just reads faster than you do.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
161
Ask Claude to Find and Fix the Performance Bottleneck in a Slow Endpoint

When a page takes five seconds to load or an API endpoint times out under load, tell Claude which route is slow and it traces the entire code path — controller, services, queries, loops — identifying N+1 queries, redundant computations, missing indexes, and cacheable operations, then fixes each bottleneck.

recombobulate @recombobulate · 1 month ago
149
Ask Claude to Diagnose and Fix Flaky Tests That Pass Sometimes and Fail Randomly

Flaky tests are maddening — they pass locally, fail in CI, pass again when you retry. Tell Claude to read the test, identify the source of non-determinism — timing issues, shared state, date dependencies, or order-dependent setup — and fix the root cause so the test is reliably green or reliably red.

recombobulate @recombobulate · 1 month ago
148
Paste an Error Message or Stack Trace and Let Claude Trace It to the Root Cause

When your app throws an error, don't just Google the message — paste the full stack trace into Claude Code. It reads the trace, opens the referenced files in your codebase, follows the call chain, and pinpoints the actual root cause instead of just explaining the symptom.

recombobulate @recombobulate · 1 month ago