A Claude Code slash command for analyzing log files for issues and patterns.
# Clone to your preferred location
git clone git@github.com:claude-commands/command-logs.git <clone-path>/command-logs
# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-logs/logs.md ~/.claude/commands/logs.md/logs # Find and summarize all logs
/logs app.log # Analyze specific log file
/logs --errors # Show only errors and warnings
/logs --tail # Watch logs in real-time
/logs docker # Analyze Docker container logs
- Finds log files in the project
- Detects log format (JSON, Apache, Syslog, etc.)
- Parses and categorizes entries
- Identifies errors and patterns
- Generates analysis with recommendations
# Log Analysis: app.log
## Summary
| Level | Count |
| ----- | ----- |
| ERROR | 127 |
| WARN | 892 |
| INFO | 42,156 |
## Top Errors
### 1. Database Connection Failed (45 occurrences)
Likely cause: Database server was down
Suggested fix: Add connection retry logic| Format | Example |
|---|---|
| JSON Lines | {"level":"error","msg":"..."} |
| Apache/Nginx | 192.168.1.1 - - [15/Jan/2025:10:30:00] |
| Syslog | Jan 15 10:30:00 host app[123]: |
| Application | 2025-01-15 10:30:00 ERROR ... |
| Option | Description |
|---|---|
--errors |
Show only errors and warnings |
--tail |
Follow logs in real-time |
--since 1h |
Filter by time |
--json |
Parse as JSON logs |
- Log files or Docker containers
- Claude Code with Opus 4.5 model access
cd <clone-path>/command-logs && git pull