I can design a useful agent as a scoped product, not a loose prompt with a confident voice.
Cost Specialist
A drop-in Claude project for API cost audits. Locked answer shapes, dated citations, and an eval suite.
Cost tools can hallucinate prices, blur answer shapes, miss cache breakpoints, or drift as provider pricing changes.
Public repository, four locked output shapes, nine dated reference docs, TypeScript evals, Sonnet system-under-test, and Opus judge.
- Verdict
- Edits
- Cost impact
- Confidence
- Verdict
- Per-step routing
- Cache structure
- Observability
- Cost impact + Confidence
- Ask for the three numbers · no $ figure · no confidence line
- Name 'out of scope' · offer one redirect · no code
What the agent returns.
A drop-in folder for Claude API cost and caching audits. Paste a
client.messages.create() call; get the cache breakpoint, the edit,
and the before/after cost per 1,000 calls. The agent is graded against its own
rules, so the personality does not drift quietly.
Why it exists
Every Claude API team I've worked with hits the same three questions:
am I caching this right?, is Opus worth it here?, and
why did spend move? The answers exist, but they are spread across docs,
prices, cache rules, and usage fields.
Cost Specialist puts that into one Claude project. It works inside the user's Claude.ai or Claude Code session, on their code, with their numbers.
What made it hard
The lazy version is "a system prompt that says you are a cost expert." That works for one or two questions before the agent starts hallucinating prices, blending answer shapes, and wandering off-topic.
The discipline is the product. Every cost claim cites a dated reference file. Every reply uses one of four shapes. Out-of-scope topics get a Boundary, not a helpful detour. Sonnet 4.6 is the system under test; Opus 4.7 is the judge.
Three trade-offs worth naming.
The short version: choice, reason, cost.
Distribution as a folder, not a hosted app
The project ships as a folder: identity.md, rules.md, examples.md, and nine dated reference docs. No backend, UI, auth, or SDK.
A reviewer can read the whole agent before running it. A user can drop it into Claude without trusting a hosted app.
No telemetry. The eval suite is the only feedback loop, and adopters have to keep pricing snapshots fresh.
Locked four-shape response grammar
Every reply is Audit, Pipeline, Clarifying, or Boundary. Literal headers, length caps, no preamble, no closing flourish, no blended shapes.
Cost answers need a verdict, the edit, the before/after bill, and a confidence note. Anything else slows the user down.
The voice is terse. The eval also has to check headers, section counts, and length caps on every case.
Eval suite grades the specialist against its own rules
evals/run.ts checks each doc edit against hand-authored cases. Sonnet 4.6 is the system under test; Opus 4.7 judges shape, citations, refusals, and made-up prices.
Without a judge, the agent drifts every time the docs move.
A full run costs about $0.70 and needs an Anthropic key. The cases and judge prompt have to move with rules.md.
The stack.
- Claude project · drop-in
- Claude Code · drop-in
- @anthropic-ai/sdk
- Claude Sonnet 4.6 · SUT
- Claude Opus 4.7 · judge
- TypeScript 5
- Node 20
- JSON schema cases
- Markdown spec
- 9 dated reference docs
- GitHub
- Claude Code