waker-ai
Never let your AI coding agent sleep on the job again.
waker is an independent supervisor for AI coding agents. It watches the disk
(not the agent's words), verifies a frozen contract, and wakes the agent up until
every task has on-disk evidence and every gate is green.
Agent claims. Waker verifies. The disk decides.
$ waker run --tasks .waker/tasks.yaml --adapter opencode --test "pytest -q"
**waker · run cff9c232 · 1/1 — 100%**
`████████████████` ⏱ 00:45 🔁 0/5 🧪 PASS 💰 $0.0016
| | Task | Work | Evidence | Gate |
|---|------|-------------------|---------------|------|
| ✅ | T1 | create live.txt | src/live.txt | pass |
Why
AI agents do four things that ruin unattended runs:
- Stop early — finish 1 of 5 tasks, exit 0, go quiet.
- Lie — print "all tasks completed" while the test suite is red.
- Cheat — edit the tests until they pass.
- Spin — rewrite the same two lines five times with no progress.
Waker handles all four because it never trusts the agent's output. It only
trusts git diff and exit codes.
Feature comparison
| Capability | Manual babysitting | until loop in bash |
Agent built-in "auto" | waker-ai |
|---|---|---|---|---|
| Verifies work on disk (not claims) | ❌ | partial | ❌ | ✅ |
| Session resume across wakes | ❌ | ❌ | partial | ✅ T1 |
| Detects test tampering | ❌ | ❌ | ❌ | ✅ |
| Detects "claimed done, tests red" | ❌ | ❌ | ❌ | ✅ |
| Detects frozen / thrashing agents | ❌ | ❌ | ❌ | ✅ |
| Per-task checklist with evidence | ❌ | ❌ | partial | ✅ |
| Cost guard (USD) | ❌ | ❌ | ❌ | ✅ |
| Works with many CLIs | ❌ | ✅ | ❌ | ✅ T1/T2/T3 |
Survives chatbox close (--detach) |
❌ | ✅ | ❌ | ✅ |
| Live TUI + web dashboard | ❌ | ❌ | ❌ | ✅ |
| Runs 100% offline for parsing/lint | ❌ | ✅ | ❌ | ✅ 0 token |
Install
pip install waker-ai
# one command: detect installed CLIs and install the waker skill
waker setup
# Windows PTY tier-3 (optional)
pip install "waker-ai[pty]"
From source:
git clone https://github.com/khoacat12345/waker-ai
cd waker-ai
python -m venv .venv
.venv\Scripts\activate # Windows
pip install -e ".[dev]"
pytest
Quickstart (60 seconds)
# 0) detect the test runner already used by the repo
waker detect
# 1a) prompt with scope/verify -> contract (0 token, deterministic)
waker plan --prompt "Phase 1: auth, scope: src/auth/**, verify: pytest tests/auth -q"
# 1b) vague prompt -> one OpenCode planning turn writes the contract
waker plan --via opencode --model <provider/model> \
--prompt "build an expense tracker app with login and Excel export"
# 2) validate the contract - fail closed on missing scope/verify
waker lint --tasks .waker/tasks.yaml
# 3) supervise the agent
waker run --tasks .waker/tasks.yaml \
--adapter opencode --model opencode-go/deepseek-v4.1-flash \
--test "pytest tests/ -q" \
--max-kicks 5 --max-cost 0.50
# 4) after a crash/reboot, continue the same run
waker run --resume <run_id> --repo .
Background mode, then watch from anywhere:
waker start --detach --tasks .waker/tasks.yaml \
--adapter opencode --model <provider/model> --test "pytest tests/ -q"
waker status --repo .
waker watch --repo .
waker dashboard --repo . --open
waker stop --repo .
Install the chatbox skill:
waker setup # detects OpenCode/Claude/Gemini, installs globally
# or explicit:
waker install-skill --for opencode --global # ~/.opencode/skills/waker/SKILL.md
waker install-skill --for claude --global # ~/.claude/skills/waker/SKILL.md
waker install-skill --for gemini --global # ~/.gemini/config/skills/waker/SKILL.md
waker install-skill --for generic # AGENTS.md block (idempotent)
Skills are loaded when the chat session starts — restart your CLI after
installing. A pip install cannot write into your agent's config by itself
(that is a security boundary); waker setup is the one-time post-install step.
v2.2 — Chatbox-first and time-aware
Grill-Me only when the prompt is vague
The chatbox follows a conditional Grill-Me Check before planning:
- Prompt already has goal, scope, verify and required inputs: silent-pass, 0 questions.
- Prompt is missing blocking information: ask at most 3 questions, one round.
- Questions are blocking only; preferences/naming/style are never grilled.
- “Tùy bạn” for a preference is recorded as a preference. It is never used to
invent
scopeorverify. - The instruction lives in the
wakerskill; code-enforcedquestions.yamlis deferred to v2.3.
Phase selection
# small task: one implicit phase, no phase question
waker plan --prompt "..." --phases none
# user supplies/edits phases
waker plan --prompt "..." --phases manual
# large project: rule-based proposal + budget, user approves
waker plan --prompt "..." --phases auto --profile large --json
auto groups existing tasks by phase/scope and allocates phase budgets from the
selected profile. It never invents scope or verify. The chatbox prints the plan,
waits for ok / 1 / chạy, and supports natural-language edits such as
“tăng P2 lên 3h, P1 còn 30m” before the contract is frozen. Small clear tasks
use the /waker fast path; non-TTY/chatbox mode never reads raw terminal keys.
Timeout profiles
| Profile | Turn | Run | Verify | Freeze | Kicks |
|---|---|---|---|---|---|
small |
5m | 20m | 2m | 3m | 3 |
medium |
15m | 90m | 5m | 5m | 5 |
large |
30m | 5h | 15m | 10m | 8 |
overnight |
45m | 8h | 30m | 15m | 12 |
waker run --tasks .waker/tasks.yaml --profile large ...
waker start --profile overnight ...
Explicit flags still win over profile values. Wall-clock or turn exhaustion now
returns diagnosis TIMEOUT (exit 7), separate from BREAKER (kick/cost
limits). verify_timeout and freeze_after remain distinct signals.
Phase display
The Cyber-Deck shows the current phase and budget:
PHASE 2/2 Docs 01:12:10 / 02:00:00 [######----]
Colors are green under 80% of phase budget, yellow from 80%, red from 95%. Phase timing comes from the run state, not from a synthetic timer.
Update notifications
waker checks PyPI in the background at most once every 6 hours. On an
interactive terminal it prints a small notice when a newer version is
available:
╭──────────────────────────────────────────────────────╮
│ Update available: 1.2.0 → 1.2.1 │
│ Run: pip install --upgrade waker-ai │
╰──────────────────────────────────────────────────────╯
The check never blocks a command. Disable it with WAKER_UPDATE_CHECK=0 or
NO_UPDATE_NOTIFIER=1; CI is skipped automatically. It sends no telemetry —
it only reads the public PyPI JSON metadata.
Anti-Slop Audit & AST Watchdog (v2.0)
waker audit is a read-only, deterministic AST quality gate. It does not run
the agent, modify source, or depend on an LLM. The same gate runs inside
waker run after every turn: warnings are advisory, while blocking errors
prevent DONE and produce a precise wake prompt.
waker audit --anti-slop # changed files, Markdown + score + badge
waker audit --all # whole tracked tree
waker audit --all-gates # core + tests + types + comments + arch + deps + security
waker audit --arch # circular imports and layer boundaries
waker audit --dead-code # unused private/public symbols and imports
waker audit --deps # allowlist, new dependencies, pinning
waker audit --security # eval/pickle/shell/TLS/secrets/SQL
waker audit --format json # machine-readable findings + score
waker audit --format sarif # SARIF 2.1.0 for GitHub Advanced Security
waker audit --format badge # copy-paste Markdown badge
waker audit --write-baseline # baseline legacy debt (explicit)
The Cleanliness Score is 0–100 (errors cost 10, warnings 3) and the badge is
a static shields.io Markdown snippet:

What the AST Watchdog checks
| Family | Rules | Default |
|---|---|---|
| Core anti-slop | SLOP000–008 |
blocking errors, warning heuristics |
| Test integrity | TEST001–008 |
blocking; mock ratio warning |
| Type evidence | TYPE001–012 |
blocking evidence holes; heuristic casts warning |
| Comments/suppression/stubs | COMMENT/SUPPRESS/STUB |
warnings; placeholders/stubs errors |
| Architecture | ARCH001–004 |
layer/cycle errors; fan-out/dynamic warning |
| Dead code | DEAD001–004 |
private/import errors; public warning |
| Dependencies | PKG001–004 |
allowlist/new-dep errors; pin/mapping warning |
| Security | SEC001–007 |
blocking errors |
Calibration is intentional: TYPE006, TYPE009, TYPE010, TYPE011 and
TYPE012 are warnings because AST-heavy code legitimately uses
isinstance/getattr; the high-confidence TYPE001–005 and TYPE007–008
remain blocking. A finding includes a stable fingerprint, file, line/column,
severity, confidence, message and a repair recipe.
Baseline: legacy debt does not block adoption
Run once on a legacy repository, commit the baseline, and only new findings will block:
waker audit --all --write-baseline
git add .waker/anti-slop-baseline.json
waker audit --all
The engine also snapshots pre-run findings in memory. If an agent touches an
old file, its existing violations are treated as debt; a newly introduced
violation in the same file still blocks. Use
waker audit --baseline-file <path> (or --baseline <path>.json) to select
another baseline. waker run --no-baseline disables baseline suppression for
that run.
Engine enforcement: kick, revert, abort
After every turn, the engine scans changed Python files. A blocking finding
sets Diagnosis.SLOP, denies DONE even when the agent's tests are green, and
puts the following evidence in the next wake prompt:
ERROR SEC001 src/pay.py:42 - Dynamic code execution via `eval()`.
Fix: Parse data or use an explicit dispatch table; never eval untrusted input.
The default policy is kick (keep the file and make the agent fix it).
on_violation="revert" restores only the violating paths from the pre-turn
checkpoint and preserves unrelated work; it never runs git reset --hard.
on_violation="abort" stops immediately with exit code 6.
The Rich TUI quality row shows the score, grade (A+ at 100), error count and
warning count for the latest turn. waker status --format json exposes the
same block as quality.
SARIF for CI
waker audit --all --all-gates --format sarif > waker.sarif
Upload waker.sarif to GitHub Advanced Security or any SARIF 2.1.0 consumer.
The report includes rule IDs, locations, fingerprints and the quality score.
Blind evaluation (v1.1)
The Architect (chatbox) can write hidden tests that the worker never sees:
waker vault init --repo .
# → vault_id: 9f3a2c7d1e4b (the vault lives outside the repo)
waker vault add --vault 9f3a2c7d1e4b --suite auth --task T1 tests/test_auth_hidden.py
waker vault validate --vault 9f3a2c7d1e4b --repo .
# → fails on baseline? good. import error / skip / flaky? reject.
waker run --tasks .waker/tasks.yaml --vault 9f3a2c7d1e4b --adapter opencode ...
- id: T1
verify: "pytest tests/test_auth_smoke.py -q" # public smoke, worker sees
public_api: ["login(name, password) -> token | None"]
blind:
suite: auth
baseline: red # hidden must fail before work
leak: message # minimal | message
DONErequires 100% hidden pass plus public smoke and constraints.- Failures are sanitized:
hidden://auth/test_3: AssertionError: ...; no source, no paths, no locals. VAULT_TAMPERstops the run if the vault hash changes.- Honest scope: v1.1 is blind by construction, not an adversarial sandbox.
The worker runs as the same OS user; real isolation (Docker/Windows Sandbox)
is v1.2. See
docs/BLIND_EVALUATION_SPEC.md.
How done is decided
For every task:
done(T) = (git diff ∩ T.scope ≠ ∅) and (T.verify exits 0)
| Gate | Stops |
|---|---|
scope ∩ diff |
touching an unrelated file to look busy |
verify exit 0 |
claiming success while tests are red |
| test hash | editing the exam (TAMPER → restore + kick) |
| contract hash | moving the goalposts mid-run |
| cost / kicks / wall clock | burning the budget in a retry loop |
Adapters
| Tier | Mechanism | CLIs | Status |
|---|---|---|---|
| T1 | native session resume | OpenCode (run --session --format json) |
✅ live E2E |
| T1 | native session resume | Claude Code (-p --resume --output-format stream-json) |
🧪 beta (unit-tested, no live CI) |
| T2 | fresh process + context digest | any CLI with a non-interactive flag (aider --message, gemini -p, custom commands) |
✅ |
| T3 | PTY keystroke injection (ConPTY + pyte) | any text-mode TUI, even without a headless mode | ✅ Windows only |
waker doctor detects what is installed and prints the tier:
$ waker doctor --inject-test
OK opencode tier T1 (opencode 2.0.32)
OK claude tier T1 (claude 1.x)
-- aider tier -
OK any-text-cli tier T3 (pywinpty)
injector self-test: PASS - marker seen
The injector self-test drives a harmless shell, never an AI session.
Importantly: cost guard is exact only for OpenCode. It reads
opencode session export before/after each turn. For Claude it uses the
total_cost_usd delta from the stream; for generic/PTY it is 0 (no measurement).
Safety on Windows
- Every run is assigned to a Win32 Job Object
(
JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE);taskkill /T /Fis always issued as a fallback, so grandchildren die too. - Live freeze probe: no stdout and no file activity for
--freeze-afterseconds → kill the tree and mark the turnFROZEN; no waiting for a 15-minute timeout. - Prompts are passed as argv, never through a shell (shell quoting corrupts prompts that contain quotes or backslashes).
CLI
waker plan prompt -> contract (0 token; --phases none|manual|auto, --profile)
waker lint contract validation (0 token)
waker detect detect pytest / npm / cargo / go / make test
waker run supervise in the foreground (--resume <id> to continue)
waker start supervise in the background (detached)
waker stop stop a run (tree kill)
waker serve loopback HTTP control plane
waker status markdown/JSON snapshot
waker watch live Rich TUI
waker dashboard static HTML or live web dashboard
waker report print the acceptance report
waker doctor environment + adapter tier + injector test
waker setup detect CLIs and install the skill (one command)
waker install-skill opencode / claude / gemini / generic
Demo
The animated demo at the top is generated by
scripts/make_demo_gif.py. The 45-second recording
script lives in docs/demo-45s.md.
Design
Full design and decision log: plan.md.
Release notes: docs/release-v2.2.0.md.
Phase reports: .waker/runs/phase1_report.md, phase2_report.md, phase3_report.md.
Status
v2.2.0 — Chatbox Grill-Me, timeout profiles, phase budget display — plus the default-on deterministic AST anti-slop watchdog, baseline tracking, selective rollback, SARIF, and the Rich Cyber-Deck.
Maturity:
- Anti-Slop gate — Python stdlib only; 30+ rules; full pytest suite green.
- OpenCode T1 — live E2E verified.
- Claude T1 — beta: command/stream/permission handling unit-tested, no live CI run yet (the CLI is not installed on the build runner).
- PTY T3 — Windows only; POSIX support is planned.
- Cost guard — exact for OpenCode, best-effort for Claude, 0 for generic/PTY.
PyPI: v2.2.0 distributions are built and twine check validated; publish
after release approval. The current stable install remains pip install waker-ai (pin waker-ai==1.2.0 for pre-anti-slop behavior).
License
MIT
Metadata
Release files for waker-ai 2.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| waker_ai-2.3.0.tar.gz | 178.1 kB | With provenance | Details for waker_ai-2.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| waker_ai-2.3.0-py3-none-any.whl | Python 3 | none | any | Details for waker_ai-2.3.0-py3-none-any.whl |
Total release size: 337.6 kB
Release files / waker_ai-2.3.0.tar.gz
| Download URL | waker_ai-2.3.0.tar.gz |
|---|---|
| Size | 178.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bb80007587e409b1968bc733474d9fbbecc6eda038f2a4dd8594ead8affceae
|
|
BLAKE2b-256 checksum How to use checksums |
f583b39afe7a6bf28ee1bb28114e3e2fcb60a1c374f2984daa592c41f2fc2a30
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logRelease files / waker_ai-2.3.0-py3-none-any.whl
| Download URL | waker_ai-2.3.0-py3-none-any.whl |
|---|---|
| Size | 159.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
66c492e468f4b0fa838825f152396de5f7c7b771787c828726c1ac97ffd1d4dc
|
|
BLAKE2b-256 checksum How to use checksums |
9ffc758325ca72578bbc7eda1f4efb2b00ceffdda7e707efa6a2eb26fa0f897f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logSecurity for waker-ai 2.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for waker_ai-2.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.