- Home
- Skills
- Workflow Automation
- codex-longrun-skill
More screenshots
Works with the AI Agents you already use
Codex Longrun Skill
Run long shell commands in sessions with automated agent wake-up on completion.
Free
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
| Field | Value |
|---|---|
| Worker PID | 45892 |
| State Directory | ~/.local/state/codex-longrun/data-audit-20231027-1450/ |
| Command | python3 analysis.py --full |
| Cancellation | ./scripts/run_and_notify.sh --cancel data-audit-20231027-1450 |
Next steps
- I am now entering an idle state for this task.
- Once the
[AUTOMATED_LONGRUN_COMPLETION]signal is received, I will parse the exit code. - If the job fails, I will inspect
job.logto 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
- Launch a command using
run_and_notify.shwith a unique job name and your target arguments. - Detach immediately after receiving the
LONGRUN_STARTEDconfirmation, freeing the agent to handle other tasks or go idle. - Notify via the
codex queuewhen the process terminates, which triggers anAUTOMATED_LONGRUN_COMPLETIONevent. - Resume work by inspecting the persisted
job.jsonand 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
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
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 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
Python
Git