haggle: Agent for Claude Code

.claude/agents/agl-api-explorer.md

agl-api-explorer is an agent for Claude Code from NaanyaBiz/haggle. It costs 86 tokens per session (1,000 once invoked), scanned A, original, Apache-2.0.

A specialist for the AGL Energy Australia mobile app's private web API. It covers login-token renewal, API requests, response parsing, and common HTTP problems.

In plain words
What is it for?
Use it when implementing or debugging AGL authentication, API calls, JSON parsing, 401 errors, rate limits, or response shapes.
Why use it?
It provides the project's source of truth for request details and token handling, including rotated refresh tokens and retry behaviour.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions AGENTS.md.

This is NaanyaBiz/haggle's own configuration. It tells Claude Code how to work on haggle itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything haggle configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/NaanyaBiz/haggle/main/.claude/agents/agl-api-explorer.md
Clone the repo
git clone --depth 1 https://github.com/NaanyaBiz/haggle

Made for: Claude Code.

Wrote 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.

agentmods badge for agl-api-explorer

README.md
[![agentmods](https://agentmods.dev/badge/agents/naanyabiz/haggle/agl-api-explorer/github.svg)](https://agentmods.dev/agents/naanyabiz/haggle/agl-api-explorer)
Your own site
<a href="https://agentmods.dev/agents/naanyabiz/haggle/agl-api-explorer"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/agl-api-explorer/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.

agentmods 80×15 button for agl-api-explorer

Your own site · 80×15
<a href="https://agentmods.dev/agents/naanyabiz/haggle/agl-api-explorer"><img src="https://agentmods.dev/badge/agents/naanyabiz/haggle/agl-api-explorer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 86 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,000 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00086 $0.01000
Opus 5.5 $0.00034 $0.00400
Sonnet 5.5 $0.00017 $0.00200
Haiku 4.5 $0.00009 $0.00100

Measured 1mo ago against content hash 42858d0a56f7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

agl-api-explorer 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.

.claude/agents/agl-api-explorer.md · 81 lines

How it starts

The opening of the file, as written. The whole thing — 81 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert in the AGL Energy Australia mobile app API.

Source of truth

The definitive reference is the AGENTS.md file in the repo root (§ AGL API — Key Facts). Anonymised response shapes are in tests/fixtures/*.json.

API constants

Auth host: https://secure.agl.com.au
Data host: https://api.platform.agl.com.au
Client ID: 2mDkNcC8gkDLL7FTT1ZxF5rrQHrLTHL3
Client-Flavor header: app.iOS.public.8.38.0-531   ← always send
User-Agent: AGL/531 CFNetwork/3860.500.112 Darwin/25.4.0

Auth0 token flow

  1. POST https://secure.agl.com.au/oauth/token with grant_type=refresh_token, client_id, refresh_token.
  2. Response: access_token (15-min JWT, RS256 — expires_in: 900), refresh_token (NEW — rotated), expires_in.
  3. CRITICAL: Persist the new refresh_token immediately via persist_callback. Failure = lockout on next cycle.
  4. Proactive refresh: when now > expires_at - 2 min, exchange before calling data APIs.
  5. On 401 from data API: force a refresh and retry exactly once. If second 401, raise AGLAuthError.

Data API endpoints (all under /mobile/bff)

GET /api/v3/overview
    → accounts[].contracts[].contractNumber, hasSolar, meterType

GET /api/v1/servicehub/energy/{contractNumber}
    → hyperlinks dict (usage, managePlan, usageInsight, ...)

GET /api/v2/usage/smart/Electricity/{contractNumber}/Current/Hourly?period=YYYY-MM-DD_YYYY-MM-DD
    → 30-min intervals. Use the OUTER consumption.quantity for kWh (matches
      the AGL portal CSV export to 0.001 kWh).
      DO NOT use the inner consumption.values.quantity — it's a DPI/chart-scaled
      helper that undercounts kWh by 4-73% with no consistent ratio (confirmed
      root cause of the v0.1.0/v0.2.0-beta meter-undercounting bug).
      dateTime is slot-start in UTC. Filter type='none'.

GET /api/v2/usage/smart/Electricity/{contractNumber}/Current/Daily?period=...
GET /api/v2/usage/smart/Electricity/{contractNumber}/Previous/Hourly?period=...
GET /api/v2/usage/smart/Electricity/{contractNumber}/Previous/Daily?period=...
GET /api/v2/plan/energy/{contractNumber}
    → gstInclusiveRates[]: unit rate (c/kWh) and supply charge (c/day)

Read the full file on GitHub · 81 lines

Changes

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.

  1. 1mo ago Changed · +4 lines 42858d0a56f7
  2. 1mo ago First seen · 77 lines · 86 tokens per session scan A 2f34e73e19f9

Subscribe to this mod's changes

agl-api-explorer is an agent published in the GitHub repository NaanyaBiz/haggle (14 stars, last pushed yesterday), licensed Apache-2.0. It adds 86 tokens to every session and 1,000 once invoked, about $0.0003 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-09-04.