long-command-check

Audit agent shell command handling for foreground limits, background transitions, timeouts, and cache expiration.

554|41|Updated Oct 28, 2026
Ready to run
npx skills add https://github.com/MiniMax-AI/mcode-stack --skill long-command-check-minimax-ai
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: long-command-check
Source: https://github.com/MiniMax-AI/mcode-stack/tree/main/stacks/ronny/skills/long-command-check
Command: npx skills add https://github.com/MiniMax-AI/mcode-stack --skill long-command-check-minimax-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? When agents run long shell commands, design decisions about foreground waiting, background transitions, and timeout handling directly impact user experience and model cache efficiency. This Skill provides a systematic audit to identify gaps in command lifecycle management. ## Core Features & Use Cases - Foreground Wait Analysis: Verify command wait times stay below model cache lifetime to prevent cache expiration and re-processing costs. - Background Task Lifecycle: Check that long commands transition to background without re-execution, properly track timeouts, and recover after compaction. - Output and Notification Handling: Audit output size limits, completion notifications, and polling strategies to prevent context bloat. - Use Case: You've built an agent that hangs on long-running dev server startup or build processes. Use this Skill to audit your shell tool's foreground limit, background task queuing, and how unread task results survive conversation compaction. ## Quick Start Review your agent's shell and background-task tool code against the ten-item audit table, recording whether each design pattern is implemented, then run the provided behavioural tests to validate actual runtime behavior.

Frequently Asked Questions about long-command-check

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

FAQPage Schema
How long should an agent wait for a foreground shell command?▼

Wait time should be comfortably below your model provider's prompt cache lifetime, leaving room for generation time. For example, if cache lifetime is 5 minutes, cap foreground waits at 2-3 minutes to avoid cache expiration and re-processing costs during generation.

What happens when a shell command moves from foreground to background?▼

The command should continue as the same process without being killed and restarted. If it restarts, the agent wastes resources and may see duplicate side effects. After moving to background, timeout deadlines should not reset—the original deadline persists to prevent stuck commands running indefinitely.

How should agents notify the model when a background task completes?▼

Active notification is preferable to polling. Notifications should be appended at the end of context rather than modifying cached prefixes, and repeated polling with no change should trigger a hint to stop checking, preventing wasted requests.

What happens to unread background task results after conversation compaction?▼

Unread results must be tracked outside conversation history (e.g., in a persistent task table) so they survive compaction and can still be surfaced. Without this, completed tasks become invisible after history consolidation.

How should large command output be handled in agent context?▼

Output should be truncated or written to a file and read incrementally rather than pasted whole into context. Incomplete output must be labelled as incomplete so the agent knows more data exists and can request the next chunk.

Who stops background tasks when an agent session ends?▼

The agent harness must stop background tasks when the user stops the agent, when a headless run exits, or when the process restarts. Orphaned tasks should be marked with their final status rather than showing "running" forever.