Command Output Size Limiter — Bounded CLI Output

    1

    Bound a trusted local CLI command by display bytes, preview leading and trailing lines, optionally archive its full output, and preserve the command return code.

    $12

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Command Output Size Limiter — Bounded CLI Output

    Example session with this skill installed

    Run examples/sample_command.py through the output limiter with a 200-byte display limit and show me what it prints.

    • Read your context and instructions
    • Compiled the command output size

    Command

    python3 scripts/command_output_size_limiter.py --limit 200 -- python3 examples/sample_command.py
    

    Output (actual, from examples/actual-output.txt)

    build started
    compiled 14 modules
    build finished
    

    The sample output is under the 200-byte limit, so it is shown in full and no archive is written. The limiter returns the child command's exit code (0 here).

    For larger output

    Add a preview window and an archive folder:

    python3 scripts/command_output_size_limiter.py --limit 4000 --head-lines 8 --tail-lines 4 --archive-dir ./output-archive -- python3 your_script.py
    

    When the output exceeds the limit, the preview shows the leading and trailing lines plus the full output path and SHA-256 digest. Add --json for machine-readable metadata (byte count, digest, archive path).

    Next steps

    • Choose a byte budget that fits your terminal or log viewer.
    • Point --archive-dir at a folder with enough storage and appropriate access controls, because archives contain the complete output.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Command Output Size Limiter keeps noisy local command results readable. Set a byte budget, select head and tail lines, and optionally archive the complete output when the preview is truncated. The helper reports the original output size and SHA-256 digest and preserves the command's exit code.

    Controls

    ControlExampleResult
    Byte budget--limit 4000Keep displayed output under the selected byte count
    Preview window--head-lines 8 --tail-lines 4Select leading and trailing lines
    Full output archive--archive-dir ./logsSave full bytes only when truncation occurs
    Execution time--timeout 15Stop waiting after the time budget
    Working directory--cwd ./projectRun the command from a chosen folder
    JSON metadata--jsonInclude byte count, digest, and archive path
    Exit statusreturn codeReturn the child's code; timeout is 124, missing command 127

    How it runs

    Commands are passed as individual arguments to Python's subprocess API with shell parsing disabled; shell operators are not interpreted. Archive files are written atomically. Helper functions limit_file, verify_archive and format_summary are included for output already saved to disk.

    Known limitations

    • Run only commands you trust; the wrapper does not judge whether a command is safe.
    • Output is captured in memory before truncation, so the limit controls displayed output, not peak process memory.
    • Timeout stops the direct child process; it does not promise to stop grandchildren.
    • The display limit must be 1 byte through 64 MiB.

    Python 3.10+, standard library only. No network access. Includes 27 unit tests (python3 -m unittest discover -s tests -v).

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for DevOps & Cloud.

    Does not bound child process memory usage. Timeout only applies to direct child processes, not background workers. Requires Python 3.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    Software
    Python 3.10+

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed1 day ago

    What's inside

    Frequently Asked Questions

    It runs a trusted local command, shows output up to the byte limit you set (with optional head/tail line preview), reports the original byte count and SHA-256 digest, and returns the command's own exit code.

    Yes. Pass --archive-dir PATH and, when the preview is truncated, the complete output is written atomically to that folder. The preview shows the archive path and SHA-256 digest.

    Python 3.10+ and the standard library only. It works from any agent or terminal that can run a Python script, and it does not contact a network.

    The ZIP contains SKILL.md, README.md, the script scripts/command_output_size_limiter.py, 27 unit tests, an example command with its actual output, and listing images.

    A prompt asks the agent to be brief; this wrapper caps the displayed text itself, so the preview stays within the byte limit regardless of how much the command prints.

    No. Output is captured in memory before truncation, so the limit controls displayed output, not peak process memory. Timeout stops the direct child process and does not promise to stop grandchildren.

    New in DevOps & Cloud