Metadata-Version: 2.4
Name: autorun-ai
Version: 1.0.0rc4
Summary: Task lifecycle and safety hooks for AI coding harnesses
Author-email: Andrew Hundt <ATHundt@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/ahundt/autorun
Project-URL: Repository, https://github.com/ahundt/autorun.git
Project-URL: Issues, https://github.com/ahundt/autorun/issues
Keywords: claude,autorun,task-lifecycle,cli,safety-hooks
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: bashlex>=0.18
Requires-Dist: psutil
Requires-Dist: filelock<3.29.5,>=3.12.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: packaging>=23.0
Requires-Dist: tomlkit>=0.12
Provides-Extra: pdf
Requires-Dist: markitdown>=0.1.0; python_version < "3.14" and extra == "pdf"
Requires-Dist: pdfplumber>=0.10.0; extra == "pdf"
Requires-Dist: pillow>=12.3.0; extra == "pdf"
Requires-Dist: pdfminer.six>=20221105; extra == "pdf"
Requires-Dist: pypdf>=6.0.0; extra == "pdf"
Provides-Extra: pdf-gpu
Requires-Dist: docling>=2.94.0; sys_platform != "darwin" and extra == "pdf-gpu"
Provides-Extra: pdf-llm
Requires-Dist: pymupdf4llm>=0.0.1; extra == "pdf-llm"
Provides-Extra: pdf-progress
Requires-Dist: tqdm>=4.60.0; extra == "pdf-progress"
Provides-Extra: pdf-all
Requires-Dist: autorun-ai[pdf,pdf-gpu,pdf-llm,pdf-progress]; extra == "pdf-all"
Dynamic: license-file

# autorun

An AI coding agent left alone stops mid-task, calls a first draft done, and runs
commands such as `rm -rf` or `git reset --hard`. autorun adds hooks that send it
back to work and block those commands. It supports Claude Code, Codex, Qwen
Code, Pi, Prime Agent, ForgeCode, OpenCode, Antigravity and the legacy Gemini CLI.

## Install

```bash
uv tool install autorun-ai   # installs the `autorun` command
autorun --install            # adds hooks, commands and skills to every agent it finds
autorun --status             # checks each install and runs the hook command once
```

Then start a new agent session and type `/ar:help` (`ar:help` in Codex) to
see the command list.
`autorun --install-dry-run` previews the writes. `autorun --uninstall` removes
what autorun installed, including the `autorun-ai` tool, and stops its
background daemon; it keeps `~/.autorun` (session state, task history and logs).

Other routes:

```bash
uv tool install 'git+https://github.com/ahundt/autorun.git#subdirectory=plugins/autorun'   # from GitHub
claude plugin marketplace add https://github.com/ahundt/autorun.git                     # Claude Code only
claude plugin install ar@autorun
uv tool install 'autorun-ai[pdf]'    # adds the PDF backends for `extract-pdfs`
```

The `pdf-extractor` agent plugin's extraction code ships in this package, behind
the `pdf` extra.

## What each agent gets

If the daemon is busy, unreachable, misses a deadline or cannot evaluate state,
`overload_policy=critical-guards` (default) allows ordinary commands and
non-shell tools with a notice and runs the built-in destructive-command guards
locally for shell tools. No session state is read: `/ar:no` rules, `/ar:ok`
grants, the file policy, and task and plan gating are not checked until autorun
answers again. A guarded command stays blocked even with a grant. A cheap screen
lets ordinary commands such as `git status` proceed even with no check budget.
If the full check fails or is late, only a command that names a guarded command
as a whole word, or uses shell syntax that can spell one indirectly, is denied
with wait-and-retry guidance.
Do not restart the daemon under load.

The `overload_policy` key in `~/.autorun/autorun.config.json` accepts
`critical-guards`, `block` (deny every tool-gate call) and `allow` (allow every
call without local guards); `AUTORUN_OVERLOAD_POLICY` overrides the file.
Unknown values use `critical-guards` and appear in `autorun --status`.
If the Python package cannot be imported, the stdlib hook still denies tool
calls with repair guidance because it has no guard code. Stop and other
non-gate events keep their existing behavior.

| Agent | Safety hook | Keeps working past Stop | Commands and skills |
|---|---|---|---|
| Claude Code | native hooks | yes | native |
| Codex | native hooks | yes | Codex plugin and skills |
| Qwen Code | native hooks | yes | native extension |
| Antigravity | native hooks | the events Antigravity offers | native extension |
| OpenCode | in-process tool veto | yes on 0.6.0+, through `session.idle`; older clients only show the reason. Its todo list is mirrored into task status | command files and skills |
| Pi | in-process tool veto | `agent_settled` continuation and task tools | one local package containing the extension and skills |
| Prime Agent | the Pi extension below 0.10.0; none on 0.10+ | as Pi below 0.10.0; no on 0.10+ | below 0.10.0, one local package containing the extension and skills; on 0.10+, guidance and skills |
| ForgeCode | advice only | no | command files and skills |
| Legacy Gemini CLI | native hooks | yes | native extension |

autorun's messages use each agent's spelling: `/ar:` in Claude, Gemini CLI,
Qwen Code and Antigravity, `/ar ` in Pi, `ar:` in Codex, and `/ar-` in ForgeCode and OpenCode.

Documentation: <https://github.com/ahundt/autorun>. Development setup and
tests: [AGENTS.md](https://github.com/ahundt/autorun/blob/main/AGENTS.md).
Licensed under Apache 2.0; see `LICENSE`.
