⚡ PromptLoot

Home › AI Agents

AI Agent Harness Starter Pack: Rules, Hooks, Status & Verify

Set up a simple agent harness: a short rules file, a status file the agent keeps current, a verify command, and hooks that block 'done' until checks pass.

Added · Updated

You are setting up an agent harness for my repo. The model does the thinking; the harness is everything around it that keeps it on track: what it reads at the start, what it is allowed to do, how it proves work is done, and what it leaves behind for the next session. Build the smallest harness that works. Don't add parts I don't need.

## My setup
- Repo: [what it is, stack, e.g. Next.js + Postgres SaaS]
- Agent(s): [Claude Code / Codex / Cursor / Gemini CLI / my own agent loop]
- Typical tasks: [e.g. small features, bug fixes, refactors]
- What goes wrong today: [e.g. says "done" without running tests, forgets context between sessions, edits files it shouldn't]

## Build these 5 parts
1. RULES FILE (AGENTS.md, plus a one-line CLAUDE.md containing @AGENTS.md if I use Claude Code)
   Under 40 lines: what the repo is, the exact commands, 3 to 5 rules that change behavior. No style advice the model already follows.
2. STATUS FILE (STATUS.md)
   Sections: Current goal, Done and verified, In progress, Next step, Blockers. The agent updates it before ending every session.
3. VERIFY STEP
   One command that must pass before the agent says "done" (e.g. scripts/verify.sh running typecheck, lint, tests, build). Write the script. It should print a clear PASS or FAIL line.
4. HOOKS (only for agents that support them; say which do)
   - Before a shell command: block destructive commands (rm -rf outside the repo, git push --force, dropping databases) and ask me instead.
   - Before the session ends: refuse to finish if STATUS.md wasn't modified this session or if the verify script fails.
   Give the exact config for my agent, and if my agent has no hooks, give the closest alternative (a rule plus a CI check).
5. PERMISSIONS
   List what the agent should be able to do without asking, what needs my approval, and what it should never have access to (production secrets, billing, deploy keys). Turn that into my agent's permission settings.

## Output
- Every file, ready to paste, with its path.
- A 5-line "how a session runs" summary: read rules and STATUS.md, plan, edit, verify, update STATUS.md.
- One test task I can run to prove the harness works, and what I should see.

Rules: keep each file short, use my real commands (ask if you don't know them; never guess), and treat limits that matter as permissions or hooks, not as prompt rules.

How to use it

  1. Click Copy template.
  2. Paste into ChatGPT, Claude, Grok, Cursor, or your agent framework.
  3. Replace the [BRACKETED] parts with your details.

Pairs well with: AGENTS.md Starter Template for Claude Code, Codex & Cursor · Generate AGENTS.md or CLAUDE.md From Your Repo

Sponsor this page · Reach builders who use AI daily. Get details

FAQ

What is an AI agent harness?

Everything around the model that makes an agent reliable: the instructions it loads, the tools and permissions it has, the checks it must pass, and the memory or status files it reads and writes between sessions. Two teams using the same model can get very different results because of their harness.

What is the minimum harness for a coding agent?

A short rules file with your exact commands, a status file the agent updates every session, and one verify command it must pass before saying done. Hooks and permissions come next, for anything risky.

Do I need hooks?

Not at first, but they're the only part that's actually enforced. A rule saying 'run tests first' can be skipped; a hook that blocks ending the session until tests pass can't.

Does this work with Codex and Cursor too?

Yes. AGENTS.md, a status file, and a verify script work in any agent. Hook support differs by tool, so the prompt asks for the closest alternative when your agent has none.

Can I use the same harness in CI or a cron job?

Yes. Reuse the verify command and status file, but restate the critical rules in the headless task prompt, cap turns and spend, and have the run end with a machine-readable report. The Headless Agent Run Prompt covers that setup.

Get 3 new templates every week

Free. Unsubscribe anytime.

Related templates

HANDOFF.md: Move Tasks Between Claude Code, Codex & Cursor

A HANDOFF.md prompt that makes your current coding agent write a short, exact handoff file so a fresh session or a different agent can pick up the task without re-reading everything.

AI Agent Guardrails Checklist: Prompt Rules vs. Tool Permissions

Reviews your AI agent's rules and moves every limit that matters (money, data, deletes, messages) out of the system prompt and into permissions and code.

Headless Agent Run Prompt: Guardrails for CI, Cron & claude -p

Task prompt and checklist for unattended Claude Code, Codex, or Gemini CLI runs in CI or cron: turn and spend caps, restated guardrails, a JSON report.

Browse all AI Agents templates

New on PromptLoot

Check Current Docs First: Stop Agents Using Outdated APIs

Rules that make Claude Code, Cursor, and Codex check your installed versions and current docs before calling any API, cite the version, and flag deprecations.

Minimal Diff Rules: Stop AI Agents Rewriting Unrelated Code

Rules for Claude Code, Cursor, and Codex: change only what you asked, no drive-by renames, refactors, or reformatting, and list every changed file.
PromptLoot Pro Pack · 200+ advanced templates, agent workflows, and Cursor rules bundles. Coming soon