More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Codex Longrun Skill

    1

    Run long shell commands in sessions with automated agent wake-up on completion.

    Free

    Security scanned
    codex-longrun-skill

    codex-longrun-skill

    Example session with this skill installed

    Run the heavy data analysis script analysis.py with the --full flag. It usually takes 20 minutes. Give it the job name 'data-audit'.

    • Read your context and instructions
    • Compiled the codex-longrun-

    The long-running job has been successfully launched in a detached session. I will wait for a completion notification before proceeding with the results.

    Job Details:

    • Job ID: data-audit-20231027-1450
    • Log Path: /home/user/.local/state/codex-longrun/data-audit-20231027-1450/job.log
    • Status: LONGRUN_STARTED

    Process Metadata

    FieldValue
    Worker PID45892
    State Directory~/.local/state/codex-longrun/data-audit-20231027-1450/
    Commandpython3 analysis.py --full
    Cancellation./scripts/run_and_notify.sh --cancel data-audit-20231027-1450

    Next steps

    1. I am now entering an idle state for this task.
    2. Once the [AUTOMATED_LONGRUN_COMPLETION] signal is received, I will parse the exit code.
    3. If the job fails, I will inspect job.log to diagnose the error.

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

    About this skill

    LLMs often waste tokens and money by polling long-running terminal tasks. This skill provides a specialized launcher that executes deterministic shell commands in a detached session, allowing the agent to exit and only resume once the task finishes.

    Source code: https://github.com/JFF1594032292/codex-longrun-skill

    What it does

    • Detached Execution launches processes in a separate session so they continue even if the agent thread disconnects.
    • Automated Wake-up uses a queueing mechanism to notify the agent precisely when a job completes, failed, or was cancelled.
    • Process Group Management ensures that children and pipelines are cleaned up together during cancellation, preventing zombie processes.
    • State Persistence tracks metadata, logs, and exit codes in a dedicated directory for auditability and recovery.
    • Smart Cancellation handles SIGTERM with a configurable grace period before escalating to SIGKILL.

    How it works

    1. Launch a command using run_and_notify.sh with a unique job name and your target arguments.
    2. Detach immediately after receiving the LONGRUN_STARTED confirmation, freeing the agent to handle other tasks or go idle.
    3. Notify via the codex queue when the process terminates, which triggers an AUTOMATED_LONGRUN_COMPLETION event.
    4. Resume work by inspecting the persisted job.json and exit codes to determine the next logical step.

    Frameworks & tools

    The skill utilizes a Bash wrapper and a Python worker to manage subprocess.Popen with start_new_session=True. It is designed for POSIX-compliant environments where bash and python3 are available.

    Why this beats prompting it yourself

    Standard agents frequently enter "busy-waiting" loops using ps or tail, consuming massive context and tokens. This skill shifts the waiting logic to the OS level, making long-running tasks cheaper and more reliable.

    Use cases

    • Running bioinformatics pipelines or large-scale data processing jobs.
    • Compiling large software projects or running extensive test suites.
    • Training machine learning models that require hours of uninterrupted execution.
    • Handling large file downloads, decompressions, or batch media rendering.

    Known limitations

    Does not support interactive commands requiring STDIN after launch. Notification delivery is best-effort and requires idempotency handling for duplicate or missed events.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Workflow Automation.

    No support for interactive STDIN. Best-effort notification delivery may require manual state inspection if the wake-up signal is missed. Requires POSIX environment.

    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

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 1 day ago

    • Free with an Agensi account

    Software
    PythonGit

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Environment Variables
    Listed1 day ago

    What's inside

    Frequently Asked Questions

    This skill eliminates the "busy-waiting" problem where agents repeatedly poll for updates, saving significant token costs by allowing the agent to go idle until the exact moment the shell script finishes.

    No, this skill is designed for deterministic background tasks; it does not support interactive prompts or commands that require manual user input via STDIN after the initial launch.

    The skill is compatible with any POSIX-compliant environment (Linux/macOS) that has Python 3 and Bash installed, and it integrates with agents capable of processing external event notifications.

    Your purchase includes the `run_and_notify.sh` launcher script, a Python-based process manager, the automated queueing system for notifications, and detailed integration documentation.

    If the agent or session disconnects, the task continues running in a detached OS process; once finished, the supervisor records the exit code and logs, then signals the agent to resume upon its next wake-up.

    The skill uses process groups to ensure that when a job is cancelled, all child processes and pipelines are terminated cleanly, preventing "zombie" processes from consuming system resources.

    New in Workflow Automation

    Free