More screenshots

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Stop AI Agents Hanging or Orphaning Windows Processes

    1

    Windows only. This skill gives coding agents short safety rules plus a standard-library Job Object wrapper that stops the whole process tree when a command ends or exceeds its budget.

    $7.99

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Stop AI Agents Hanging or Orphaning Windows Processes

    Stop AI Agents Hanging or Orphaning Windows Processes

    Example session with this skill installed

    Example request

    On my Windows laptop, run the unit tests for the Python project in C:\work\shop-api and also start its dev server so I can check the health page. Do not leave anything running afterwards. The tests sometimes spawn helper processes.

    (The project is fictional. The wrapper command below was run for real on a stand-in command that starts a detached helper, Python 3.12, Windows 11.)

    • Read your context and instructions
    • Compiled the stop ai agents

    Example output

    Guardrail report

    Working folder: C:\work\shop-api (temp files in C:\work\shop-api\_tmp_agent, which I created)
    Disk free before/after: checked with Get-PSDrive C before starting; stop below 20 GB.
    Heavy jobs run, one at a time: (1) unit tests, then (2) the dev server check. The server was not started until the tests had finished.

    StepCommandWhy this way
    1where python, then use the installed interpreter by full pathA WindowsApps result would be the Store stub
    2python scripts/ticket_run.py --log _tmp_agent/runs.jsonl unit-tests 10 -- <full path to python.exe> -m pytest -qJob Object: helpers started by the tests die with the run; a 10 minute budget stops it at 15 minutes
    3Dev server: python serve.py --port 0 through subprocess with CREATE_NO_WINDOW; PID recorded as 18420, port read back from the server's first output lineFree port, hidden window, PID known
    4curl http://127.0.0.1:<port>/health, then taskkill /PID 18420 /T /FStopped by PID, never by name
    5Get-CimInstance Win32_Process | Where-Object CommandLine -like '*shop-api*'Leftover check

    What the wrapper prints for a command that starts a detached helper (real run of ticket_run.py on a stand-in script, helper still sleeping for 60 s when the parent exits):

    ticket_run: demo-build exit=0 killed_by_budget=False processes=3 survivors_killed=1
    

    and the log line in runs.jsonl records "exit": 0, "processes_started": 3, "survivors_killed": 1. The one survivor was the detached helper; the job killed it when the command ended. scripts/test_ticket_run.py confirms the same on any machine:

    RED    unwrapped grandchild survives: True (expected True)
    GREEN  wrapped grandchild is dead: True (expected True)
    BUDGET stopped after 4.7 s, exit 1 (expected about 4.5 s, exit 1): True
    LOG    2 lines written (expected 2): True
    ALL PASS
    

    The PIDs and the port in steps 3 to 5 are illustrative values for the fictional project; the two blocks of program output above are real.

    Leftover check: no process mentions the project folder. Destructive actions: none. Git: nothing committed (not asked).

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

    About this skill

    Windows only. This skill gives coding agents short safety rules plus a standard-library Job Object wrapper that stops the whole process tree when a command ends or exceeds its budget.

    The proof

    These are real lines saved in example-output.md.

    From a wrapped command that left a helper sleeping:

    ticket_run: demo-build exit=0 killed_by_budget=False processes=3 survivors_killed=1
    

    From scripts/test_ticket_run.py:

    RED    unwrapped grandchild survives: True (expected True)
    GREEN  wrapped grandchild is dead: True (expected True)
    BUDGET stopped after 4.7 s, exit 1 (expected about 4.5 s, exit 1): True
    LOG    2 lines written (expected 2): True
    ALL PASS
    

    What you get

    • SKILL.md: Windows command, process, file and git guardrails for Claude Code and OpenAI Codex.
    • scripts/ticket_run.py: the standard-library Job Object wrapper.
    • scripts/test_ticket_run.py: the real Windows platform check.
    • example-task.md and example-output.md: a worked guardrail report with saved output.
    • TESTING.md and CHANGELOG.md: tested platform, scope and release notes.

    How to use

    1. Install the skill before an agent starts a Windows ticket.
    2. Run scripts/test_ticket_run.py once on the machine.
    3. Put long or risky commands behind scripts/ticket_run.py with a task name and budget.
    4. Record every PID you start and stop only that PID.
    5. Run the leftover-process check before reporting done.

    Known limitations

    • The scripts are Windows only.
    • Rules guide an agent; they cannot undo a command that was already allowed to run.
    • The wrapper writes a JSON log and kills processes in its own Job Object. It does not judge whether a command is safe.
    • A budget is enforced at one and a half times the supplied minutes, not at an exact wall-clock deadline.

    FAQ

    Does it kill every Python or Node process? No. It kills only the process tree assigned to its Job Object.

    Does it need extra packages? No. The wrapper and platform test use the Python standard library.

    Which agents does it work with? It is a SKILL.md skill for Claude Code and OpenAI Codex.

    Does it write files? Yes. The wrapper appends a JSON line to the log path you choose.

    Can I use the wrapper on macOS or Linux? No. It uses Windows Job Objects.

    Requires Windows and Python 3.8+. Not compatible with macOS or Linux. Wrapped commands cannot leave persistent processes running after completion.

    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 any payment.

    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 4 days ago

    Requires

    macOS
    Windows
    Python
    Git
    Windows only

    Permissions

    Terminal / Shell
    Read Files
    Write Files
    Listed4 days ago

    What's inside

    Frequently Asked Questions

    It gives the agent short rules (stop only the PIDs it started, keep a free-disk floor, one heavy job at a time, no destructive command without your yes, git adds by file name) and a wrapper that runs a command inside a Windows Job Object, so helper processes it leaves behind are stopped when it ends or passes its budget.

    It is a SKILL.md for Claude Code and OpenAI Codex. The scripts were tested with Python 3.12 on Windows 11 and use only the Python standard library. They do not run on macOS or Linux.

    SKILL.md (the rules), scripts/ticket_run.py (the Job Object wrapper), scripts/test_ticket_run.py (a four-check platform test), a worked example request and its output, TESTING.md and CHANGELOG.md.

    A prompt asks; the wrapper enforces. Processes started inside the Job Object are stopped when the wrapped command ends. The included test shows an unwrapped helper surviving and the same helper stopped when wrapped.

    Copy the folder to ~/.claude/skills/ (Claude Code) or ~/.codex/skills/ (Codex), start a new session, and run scripts/test_ticket_run.py once to confirm Job Objects work on your machine.

    Yes. Start the server outside the wrapper, record its PID as the worked example shows, and stop that PID when you are done. Anything started inside the wrapper is stopped when the wrapped command ends.

    New in Agents & Orchestration