run-with-timeout

Run shell commands with timeout protection and report timeout status.

3|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/ManuelKugelmann/BitBot --skill run-with-timeout
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: run-with-timeout
Source: https://github.com/ManuelKugelmann/BitBot/tree/main/.bitbot/internal/container/templates/bitbot-dev/.claude/skills/run-with-timeout
Command: npx skills add https://github.com/ManuelKugelmann/BitBot --skill run-with-timeout

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prevents scripts, tests, or operations from running indefinitely, which can waste resources, block pipelines, or cause system instability. It ensures tasks complete within expected timeframes.

Core Features & Use Cases

  • Timeout Enforcement: Automatically terminates commands that exceed a specified duration.
  • Reliable Execution: Guarantees that long-running or potentially hanging processes won't block your workflow.
  • Use Case: Run a suite of integration tests, setting a 5-minute timeout for each to catch any tests that might get stuck in an infinite loop.

Quick Start

Run 'my-long-script.sh' with a 300-second timeout. .claude/skills/run-with-timeout/scripts/run-with-timeout.sh 300 ./my-long-script.sh

Frequently Asked Questions about run-with-timeout

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

FAQPage Schema
How do I prevent shell scripts or commands from hanging indefinitely?

Use timeout protection to automatically terminate commands that exceed a specified duration. This Skill runs commands with a timeout wrapper, halting processes that hang and returning a clear timeout status (exit code 124) so pipelines don't get blocked by stuck tasks.

Can I set timeouts on long-running tests to catch infinite loops?

Yes. Run test scripts with a timeout duration specified in seconds—for example, a 5-minute timeout on integration tests. The Skill enforces the limit and reports which tests exceeded their expected timeframe while preserving original exit codes for successful runs.

What's the best way to ensure automation workflows don't get stuck on slow operations?

Apply timeout protection to any potentially hanging operation in your automation pipeline. This Skill wraps shell commands with automatic duration limits, catching resource-wasting processes early and returning the original exit code on success or a timeout signal on failure.

Does timeout protection work with any shell script or command?

Yes. The Skill invokes a timeout utility via shell script, making it compatible with any executable or command-line operation. It handles exit code interpretation transparently, so you get reliable reporting whether the command completes successfully or exceeds the timeout threshold.

Why would I use automatic timeouts instead of letting scripts run as long as needed?

Timeouts prevent resource exhaustion, pipeline blockage, and system instability from indefinitely running processes. They're essential for CI/CD environments, test suites, and automation where runaway tasks can cascade failures or waste infrastructure without a safety limit.