aimeter CLAUDE.md

aimeter CLAUDE.md is an instructions file for coding agents from saileshr/aimeter. It costs 1,070 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for AIMeter, a Python software library that records the cost, token use, response time, and tool names of calls made through large-language-model services.

In plain words
What is it for?
Use it to develop, test, lint, format, and release the library, including its adapters for services such as OpenAI and Anthropic.
Why use it?
It provides a consistent way to inspect model usage across supported services while keeping the core library free of required external packages.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/saileshr/aimeter/claude-md
Clone the repo
git clone --depth 1 https://github.com/saileshr/aimeter

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 aimeter CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/saileshr/aimeter/claude-md.svg)](https://agentmods.dev/instructions/saileshr/aimeter/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/saileshr/aimeter/claude-md"><img src="https://agentmods.dev/badge/instructions/saileshr/aimeter/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,070 This file is loaded in full into every session.
When invoked 1,070 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.01070 $0.01070
Opus 5 $0.00535 $0.00535
Sonnet 5 $0.00214 $0.00214
Haiku 4.5 $0.00107 $0.00107

Measured 3d ago against content hash e93221c50ac9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

aimeter CLAUDE.md 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 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.

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.md · 62 lines

How it starts

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

What AIMeter is

A Python SDK that wraps LLM SDK clients (OpenAI, Anthropic, …) to record every call's cost, tokens, latency, and tool-call names into a process-wide tracker, then fan them out to exporters. Zero dependencies in the core; framework SDKs are optional extras.

See README.md for the user-facing pitch and CONTRIBUTING.md for contributor workflow — don't duplicate them here.

Commands

pip install -e ".[dev]"         # dev install (src layout — editable required for imports to work)
pytest                          # full suite
pytest tests/test_cost.py -v    # single file
pytest -k "test_openai"         # by name pattern
ruff check src/ tests/          # lint
ruff format src/ tests/         # format

All tests mock the underlying SDKs — no API keys required, no network.

Architecture

Layout is src-style: package is src/aimeter/, tests import as from aimeter import ....

Event flow for every tracked LLM call:

user code → adapter (wraps SDK client)
          → builds LLMEvent (model, tokens, tool_call names, latency)
          → tracker.record(event)
              → CostRegistry enriches with USD cost
              → fans out to each configured Exporter

Key modules and their single responsibility:

  • types.py — core dataclasses: LLMEvent, TokenUsage, ToolCall, Outcome. Everything else flows through these. Use slots=True and from __future__ import annotations.
  • cost.pyCostRegistry + _BUILTIN_PRICING_RAW dict (prices per 1K tokens). Pricing is inline Python, not YAML — edit the dict directly to update/add models.
  • config.pyconfigure(project=..., exporters=[...], tags=...) sets process-wide state. Also reads AIMETER_* env vars.
  • tracker.py — global singleton tracker. record() enriches with cost and dispatches to exporters. reset() is the test hook — call it in teardown_method to clear state between tests.
  • outcome.pyrecord_outcome(run_id=..., outcome=..., value_usd=..., metadata=...) links a prior event to a business outcome.
  • report.py — terminal summary formatter. Reads events, delegates perf aggregation to performance.compute_performance.
  • performance.py — pure aggregator over a list of events: latency percentiles (nearest-rank), throughput over first→last timestamp span, error rate; broken down by model/provider/project/tag key. Stdlib-only. Consumed by MemoryExporter.summary() (which returns the dict under a "performance" key) and by report.py.
  • adapters/ — one file per upstream SDK. Each is a thin (~20 line) extraction wrapper: wrap the client's entry point, call through, extract model / token counts / tool-call names, build LLMEvent, pass to tracker. No proxying, no feature recreation. openai.py is the reference pattern; generic.py provides the track_llm_call context manager for SDKs without a dedicated adapter.
  • exporters/ — implement export(events: list[LLMEvent]) and shutdown(). _base.py has the protocol; console.py writes to stderr, memory.py keeps events in a list for tests and local reports.

Read the full file on GitHub · 62 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. 3d ago First seen · 62 lines · 1,070 tokens per session scan A e93221c50ac9

Subscribe to this mod's changes

aimeter CLAUDE.md is an instructions file published in the GitHub repository saileshr/aimeter (2 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 1,070 tokens to every session, about $0.0053 per session on Opus 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.