agentleFS
camilo-acevedocamilo-acevedo/claude-skills/run-quiet/SKILL.md

run-quiet

Skill0 starsChanged 7 months agoMITView on GitHub

Wrap a verbose command (pytest, npm run build, terraform plan, etc.). The full output is saved to a log file; only the exit code, the matched error/warning lines, and the last few lines are returned. Read the log on demand if more context is needed. Use instead of running verbose commands directly when their output is large or noisy.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do NOT invoke when:

    line 26
  2. Very specific:

    If you can't find a repo root (.git not in any parent), use the current working directory.

    line 42
  3. Distinctive:

    Use this single Bash call (works in Git Bash on Windows and any POSIX shell):

    line 56
  4. Very specific:

    Read the exit code from the output.

    line 75
  5. Distinctive:

    Run these in a single parallel Bash batch against the log file:

    line 82
  6. Distinctive:

    Use this extended-regex (POSIX ERE) that matches both generic patterns and framework-specific signals:

    line 93
  7. Very specific:

    If the user passes no_trim=true (or the digest looks suspiciously empty for a non-zero exit), print the entire log contents instead of the …

    line 148

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

run-quiet

A Markdown-only skill — no Python, no scripts. You (Claude) run the verbose command directly via the Bash tool with output redirected to a log file, then use grep/head/tail against the log to build a short digest.

When to invoke

Invoke run-quiet when ANY of these apply:

  • The command's output is likely to be over ~200 lines (build tools, test suites, terraform plan, infrastructure scans, package install logs, etc.).
  • You only need to know whether the command succeeded and, if not, why.
  • The command is verbose by design (-v, --verbose) but you want a digest.

Do NOT invoke when:

  • The command is interactive (asks for input).
  • The output IS the answer the user wants (e.g. cat, git show, jq).
  • The command is short and you need every line (e.g. git status --porcelain).

Defaults

SettingDefaultOverride with
Log directory<repo-root>/.claude/run-logs/--root <path> argument
Max error lines shown30max=N argument
Tail lines shown10tail=N argument
Head lines shown0head=N argument
Timeoutnonetimeout=Ns argument

If you can't find a repo root (.git not in any parent), use the current working directory.

How to run

Step 1 — pick a log path

mkdir -p .claude/run-logs
LOG=".claude/run-logs/$(date -u +%Y%m%d-%H%M%S)-$$.log"

Step 2 — run the command, redirect everything to the log, capture exit code

Use this single Bash call (works in Git Bash on Windows and any POSIX shell):

{ <COMMAND> ; echo "__RUN_QUIET_EXIT__=$?"; } >"$LOG" 2>&1

Or, if you prefer the value in a variable (still one Bash call):

<COMMAND> >"$LOG" 2>&1; echo "exit=$?"

For PowerShell users:

& <COMMAND> *>&1 | Tee-Object -FilePath $LOG | Out-Null
$exit = $LASTEXITCODE

Read the exit code from the output. If the user passed timeout=Ns, wrap the command with timeout Ns <COMMAND> (Unix) or use Start-Process -Wait -TimeoutSec N (PowerShell). On timeout, append a literal line run-quiet: killed after Ns timeout to the log.

Step 3 — gather the digest pieces in parallel

Run these in a single parallel Bash batch against the log file:

CommandYields
wc -l "$LOG"Total line count.
head -n <head_n> "$LOG"Head lines (skip if head_n is 0).
tail -n <tail_n> "$LOG"Tail lines.
grep -nE '<error-regex>' "$LOG" | head -n <max+20>Candidate error/warning lines.

Error regex

Use this extended-regex (POSIX ERE) that matches both generic patterns and framework-specific signals:

\b(error|errno|exception|traceback|failed|failure|panic|fatal)\b|\bWARN(ING)?\b|^FAILED |^ERROR |^FAIL |^---[[:space:]]+FAIL:|^[[:space:]]*●[[:space:]]|^E[[:space:]]{2}

It's case-insensitive — pass -i to grep.

Strip ANSI escape codes from the error lines before printing:

sed 's/\x1B\[[0-9;]*[a-zA-Z]//g'

Drop any candidate line that also appears in the head/tail slices (to avoid duplication). Cap the list at max (default 30); if there are more, append … (+N more — see log).

Output format

Clean run (exit 0 and no error lines matched)

$ <command>
exit: 0 (in <secs>s)  •  log: .claude/run-logs/<file> (<N> lines)
clean — last line: "<last non-empty line of log>"

Failing run (or non-zero exit, or matched errors)

$ <command>
exit: <code> (in <secs>s)
log:  .claude/run-logs/<file> (<N> lines)

head (<N>):
  <line>
  …

errors (<count>[, truncated]):
  <line>
  <line>
  … (+<extra> more — see log)

tail (<N>):
  <line>
  …

Omit the head section if head_n is 0 or empty. Omit the errors section if no errors matched.

When to fall back to no-trim mode

If the user passes no_trim=true (or the digest looks suspiciously empty for a non-zero exit), print the entire log contents instead of the digest, followed by the standard exit: ... log: ... line.

Notes

  • Logs accumulate in .claude/run-logs/. Add that directory (or just .claude/) to the project's .gitignore.
  • The error regex catches generic patterns + a few framework-specific ones (pytest FAILED, jest FAIL / ●, Go --- FAIL:). False negatives are possible — if the digest looks too clean for a failing exit code, re-run with no_trim=true or grep the log yourself.
  • On Windows + PowerShell-only environments, prefer the PowerShell snippet above. On Windows + Git Bash (Claude Code's default), the Bash recipe works as-is.
  • The full log path is shown — if you need more context, read the log with the Read tool.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.