Borrowing it
Nothing to install: this file belongs to NaanyaBiz/haggle. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/NaanyaBiz/haggle/main/.claude/agents/async-performance-reviewer.mdgit clone --depth 1 https://github.com/NaanyaBiz/haggleWrote 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/agents/naanyabiz/haggle/async-performance-reviewer)<a href="https://agentmods.dev/agents/naanyabiz/haggle/async-performance-reviewer"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/async-performance-reviewer.svg" alt="Measured on agentmods" 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.00042 | $0.00938 |
| Opus 5 | $0.00021 | $0.00469 |
| Sonnet 5 | $0.00008 | $0.00188 |
| Haiku 4.5 | $0.00004 | $0.00094 |
Grade A, and why
async-performance-reviewer scanned grade A with 2 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 3d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
| `import requests` / `requests.get(...)` | Synchronous HTTP | Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
| `subprocess.run(...)` / `os.system(...)` | Blocking subprocess | How it starts
The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an async performance reviewer for the haggle Home Assistant custom integration.
Your scope
Review async code in custom_components/haggle/ — especially coordinator.py and agl/client.py — for blocking I/O, session misuse, polling cadence regressions, and memory inefficiency. Report violations. Do NOT fix them.
Blocking I/O in the HA event loop freezes the entire HA instance. This is the highest-severity class of bug in any HA integration.
Delegate:
- HA wiring patterns →
ha-integration-architect - AGL API correctness →
agl-api-explorer
Blocking I/O — CRITICAL, must flag immediately
Any of the following in an async def function (without executor offload) is a blocker:
| Pattern | Why it blocks |
|---|---|
import requests / requests.get(...) |
Synchronous HTTP |
import urllib / urllib.request.urlopen(...) |
Synchronous HTTP |
import httpx + httpx.get(...) (sync form) |
Synchronous HTTP |
time.sleep(n) |
Blocks event loop — use await asyncio.sleep(n) |
open(path) / Path(p).read_text() / json.load(f) |
Blocking file I/O |
subprocess.run(...) / os.system(...) |
Blocking subprocess |
| Any CPU-bound loop >1ms (e.g. parsing 10k rows synchronously) | Starves the loop |
Executor offload (await hass.async_add_executor_job(fn)) makes file/CPU work safe. Flag unguarded usage, not offloaded usage.
aiohttp session rules
ClientSessionmust be obtained once and reused. Never createaiohttp.ClientSession()inside a request method.- Prefer
aiohttp_client.async_get_clientsession(hass)(HA-managed, shared). - If using
aiohttp_client.async_create_clientsession(hass), ensure it's closed inasync_unload_entry. - Flag
async with aiohttp.ClientSession() as session:inside any function called more than once — that pattern creates and destroys a session per call.
Polling cadence (from CLAUDE.md)
Any new DataUpdateCoordinator or async_track_time_interval schedule must match these floors:
| Data type | Minimum interval |
|---|---|
| 30-min interval data | 24 h |
| Daily series | 6 h |
| Plan / overview | 7 days |
| Token refresh | Just-in-time only (<2 min to exp) — never scheduled |
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.
- 3d ago First seen · 80 lines · 42 tokens per session scan A 78d10dbb3063
async-performance-reviewer is an agent published in the GitHub repository NaanyaBiz/haggle (13 stars, last pushed 5d ago), licensed Apache-2.0. It adds 42 tokens to every session and 938 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 2 findings (makes network calls, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-04.
Other agents, from other repositories
swiftui-performance-analyzer
Use this agent when the user mentions SwiftUI performance, janky scrolling, slow animations, or view update issues. Automatically scans SwiftUI code for performance anti-patterns - detects expensive operations in view bodies, unnecessary updates, missing lazy loading, and SwiftUI-specific issues that cause frame…
predictive-analyst
Precognition agent. Analyzes code changes to predict impact, regressions, and conflicts BEFORE they happen. Uses dependency graphs and historical data.
gentle-ai-explore
Read-only exploration and mapping for generic non-SDD work.
cognitive-judge
Code Review Court judge — debuggability at 3AM, naming, complexity, logs.
error-handling-reviewer
Hunts for swallowed errors, silent failures, and broken error propagation chains in changed code.
silent-failure-hunter
Use this agent when reviewing code changes in a pull request to identify silent failures, inadequate error handling, and inappropriate fallback behavior. Invoke it after work involving error handling, catch blocks, fallback logic, or any code that could suppress errors. See "When to invoke" in the agent body for…