bounded-command-output

Bound command scope, runtime, and retained output for long-running or high-output shell commands.

Updated May 18, 2026
One-click install
npx skills add https://github.com/Joey-Tools/codex-private-workflows --skill bounded-command-output-joey-tools
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bounded-command-output
Source: https://github.com/Joey-Tools/codex-private-workflows/tree/main/personal_codex/skills/bounded-command-output
Command: npx skills add https://github.com/Joey-Tools/codex-private-workflows --skill bounded-command-output-joey-tools

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Broad searches, large log reads, database aggregates, filesystem walks, and verbose builds can flood the conversation with output, hang indefinitely, or fill the disk with unbounded logs. This Skill shapes those commands so the producer scope, wall-clock deadline, retained-byte ceiling, polling path, and visible evidence all have deliberate limits while a domain skill owns the substantive task. ## Core Features & Use Cases - Scoped Producers: Narrow directories, time windows, predicates, and exclude generated trees before running searches, inventories, or diffs, starting with counts and bounded samples instead of full output. - Enforced Deadlines and Byte Ceilings: Run broad SQLite aggregates, macOS du walks, and other uncertain-runtime commands behind a POSIX process-group deadline wrapper, and cap retained logs with quotas, bounded rotation, or supervisor termination. - Pollable Long-Running Commands: Start verbose xcodebuild, container builds, and spinner-heavy tools with a task-scoped log file and poll compact state such as elapsed time, byte counts, and a byte-bounded tail. - Use Case: When investigating a CI failure, save the full GitHub Actions log to a task-scoped file, extract only targeted error lines and a short tail, and report the exit status without replaying thousands of lines into the conversation. ## Quick Start Use the bounded-command-output skill to run this broad repository search with a deadline and show me only a count plus a small sample of matching files.

Frequently Asked Questions about bounded-command-output

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I keep long-running shell commands from flooding output?

Redirect stdout and stderr to a task-scoped log file before starting the command, then poll compact state such as process liveness, elapsed time, byte counts, and a byte-bounded tail. Extract only decisive counts, key lines, or short snippets when the command finishes.

How do I add a timeout to a command on macOS without GNU timeout?

Use the included run_process_group_deadline.py wrapper, which runs one command in a POSIX process group with a monotonic deadline. On timeout it sends TERM, waits a grace period, then sends KILL, returning exit code 124 for deadlines.

Does the process-group deadline wrapper work on Windows?

No. The wrapper requires POSIX APIs such as fork, setpgid, killpg, and pthread_sigmask, and it exits with code 125 on non-POSIX hosts without starting the command. WSL qualifies only when its Python runtime exposes the required POSIX APIs.

Why is rg --max-count not enough to bound search output?

The --max-count flag limits matches per file, so a search across many files can still produce unbounded total output. Bound the candidate file set first, or stream results through a total counter with an explicit N-item sampler.

When should I skip output bounding for a command?

Skip bounding only for exact commands whose scope, output size, and runtime are all known to be small and fast, such as narrow metadata queries or focused tests. Small expected output does not imply bounded runtime, so broad database aggregates and filesystem walks still need deadlines.