Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/andr-ca/agentharnessWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/andr-ca/agentharness/agentic-loops)<a href="https://agentmods.dev/rules/andr-ca/agentharness/agentic-loops"><img src="https://agentmods.dev/badge/rules/andr-ca/agentharness/agentic-loops/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/andr-ca/agentharness/agentic-loops"><img src="https://agentmods.dev/badge/rules/andr-ca/agentharness/agentic-loops.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00031 | $0.01913 |
| Opus 5.5 | $0.00012 | $0.00765 |
| Sonnet 5.5 | $0.00006 | $0.00383 |
| Haiku 4.5 | $0.00003 | $0.00191 |
Grade A, and why
agentic-loops scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 247 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Agentic Loops: Agents, Tools, Workflows
Structured patterns for building multi-turn agents that reason, act, and observe.
An agentic loop is:
- Think: Agent reasons about task → decides action
- Act: Call tools / take action
- Observe: Get result, update state
- Repeat: Loop until task complete
Minimal Loop — use the tested implementation, don't hand-roll this
Don't write a bespoke think/act/observe loop from scratch — it's easy to
get the tool-result protocol wrong (feeding a tool's result back as a
plain "user" message loses the call binding and looks like human input
to the model, instead of {"role": "tool", "tool_call_id": ..., ...}),
easy to leave out a budget (infinite loop if the model never stops
calling tools), and easy to skip argument validation (a malformed tool
call reaches your tool function instead of being rejected).
agent_loop.py, bundled alongside this file (a symlink back to
patterns/agentic-loops/agent_loop.py, so it resolves whether you
installed the whole harness or only this one skill), is a minimal, tested
(100% coverage), provider-neutral implementation that gets these right:
JSON-Schema-validated arguments, provider-correct tool-result messages, an
iteration + wall-clock budget, an optional approval hook, and an auditable
trace that never logs raw tool output. See
patterns/agentic-loops/README.md in the full harness checkout for the
complete usage example and what it does not cover (sandboxing,
prompt-injection handling, real cost accounting, cancellation,
retries/idempotency, persistence, evals) — that guide isn't bundled with
this skill since it's documentation, not something the skill needs to
function.
# Run from this skill's own directory, or add it to sys.path — see
# test_agent_loop.py (also bundled here) for a runnable example.
from agent_loop import Budget, ToolSpec, run_agent_loop
tool = ToolSpec(name="add", fn=add, parameters_schema={...}) # JSON Schema
result = run_agent_loop(
model_fn=my_provider_adapter, # translates to/from your provider's native shape
tools={"add": tool},
messages=[{"role": "user", "content": "What is 2 + 3?"}],
budget=Budget(max_iterations=5, max_seconds=30),
)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 247 lines · 31 tokens per session scan A 0f3823977cf8
agentic-loops is a cursor rule published in the GitHub repository andr-ca/agentharness (1 stars, last pushed today), licensed MIT. It adds 31 tokens to every session and 1,913 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
handoff
Export a Waybill Bundle by default, or import one when explicitly requested.
dreamd-recall
Recall lessons, decisions, and prior context from the .agent/ memory daemon. Use when starting work in a project that has a .agent/ folder, when the user references a past decision, or when you are about to make a choice that has a documented prior.
lemoncrow.execute
LemonCrow execute mode reference for Cursor.
ui-motion-workflow
Orchestrate motion-aware UI work by sequencing direction, provider choice, implementation, and browser validation.
prompt-routing
Route tasks to the correct Universal AI Engineering Prompt.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.