Preview file contents with line numbers and syntax highlighting.
Show focused line ranges during debugging and review.
Improve readability of piped terminal output.
Trusted Commands
bat file.py
bat --plain file.py
bat -r 10:40 file.py
bat -l json file.txt
command | bat -l json
bat --paging=never file.py
Safe Defaults
Use --paging=never in scripts and non-interactive runs.
Use --plain when colored decorations would break parsing.
Fallback to batcat where distro packaging uses that binary name.
Common Pitfalls
Forgetting pager behavior in automation contexts.
Treating bat output as machine-parseable by default.
Assuming bat exists where only batcat is installed.
Output Interpretation
Default output includes line numbers and style metadata.
--plain minimizes formatting for simple text workflows.
Why It Matters For Agents
Rapidly improves human readability of code and config output.
Language forcing (-l) keeps piped content understandable.
Repo Conventions
Use bat for visual inspection, not search operations.
Keep examples aligned with WSL aliasing (bat -> batcat).
Trigger Examples
Should trigger: "Show this config file with line numbers and syntax color."
Should trigger: "Preview a script quickly before editing it."
Should not trigger: "Find every occurrence of ValidationError in the repo."
1---2name: tool-bat-23description: tool-bat4---5# tool-bat67## When To Use89- Preview file contents with line numbers and syntax highlighting.10- Show focused line ranges during debugging and review.11- Improve readability of piped terminal output.1213## Trusted Commands1415```bash16bat file.py17bat --plain file.py18bat -r 10:40 file.py19bat -l json file.txt20command | bat -l json21bat --paging=never file.py22```2324## Safe Defaults2526- Use `--paging=never` in scripts and non-interactive runs.27- Use `--plain` when colored decorations would break parsing.28- Fallback to `batcat` where distro packaging uses that binary name.2930## Common Pitfalls3132- Forgetting pager behavior in automation contexts.33- Treating bat output as machine-parseable by default.34- Assuming `bat` exists where only `batcat` is installed.3536## Output Interpretation3738- Default output includes line numbers and style metadata.39- `--plain` minimizes formatting for simple text workflows.4041## Why It Matters For Agents4243- Rapidly improves human readability of code and config output.44- Language forcing (`-l`) keeps piped content understandable.4546## Repo Conventions4748- Use bat for visual inspection, not search operations.49- Keep examples aligned with WSL aliasing (`bat -> batcat`).5051## Trigger Examples5253- Should trigger: "Show this config file with line numbers and syntax color."54- Should trigger: "Preview a script quickly before editing it."55- Should not trigger: "Find every occurrence of `ValidationError` in the repo."
Run npx skillmds@latest add niksavis/tool-bat-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
tool-bat It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
niksavis (@niksavis) published this skill. Their other Agent Skills are listed on their SkillMD profile.