Analyze log files by stripping ANSI escape sequences first. Use when asked to process, handle, read, or analyze log files that may contain terminal escape codes.
.log or log-related files that may contain ANSI escape sequencesLog files captured from terminal sessions often contain ANSI escape sequences for:
\x1b[31m for red)These sequences make logs difficult to:
Before analyzing any log file, first strip the ANSI sequences using ansifilter:
ansifilter -i log.txt -o /tmp/clean_log.txt
For other log file names, adjust accordingly:
ansifilter -i <input_file> -o /tmp/clean_log.txt
Read and analyze /tmp/clean_log.txt instead of the original file:
# Use the Read tool on /tmp/clean_log.txt
When reporting findings to the user:
log.txt - General purpose log in project roottarget/ - Cargo build logs/tmp/*.log - Temporary logsUser: "Can you analyze log.txt and tell me what's wrong?"
ansifilter -i log.txt -o /tmp/clean_log.txt/tmp/clean_log.txtIf ansifilter is not installed:
# Ubuntu/Debian
sudo apt-get install ansifilter
# macOS
brew install ansifilter
# Or run bootstrap.sh to install all dependencies
./bootstrap.sh
check-code-quality - For checking Rust code quality (may generate logs)analyze-performance - For performance analysis (generates flamegraph data)/analyze-logs - Explicitly invokes this skill