aimeter: Instructions file for Claude Code

CLAUDE.md

aimeter CLAUDE.md is an instructions file for Claude Code 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 for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

This is saileshr/aimeter's own configuration. It tells Claude Code how to work on aimeter 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 aimeter configures →

Reuse

Borrowing it

Nothing to install: this file belongs to saileshr/aimeter. 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/saileshr/aimeter/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/saileshr/aimeter

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/saileshr/aimeter/claude-md/github.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/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 aimeter CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/saileshr/aimeter/claude-md"><img src="https://agentmods.dev/badge/instructions/saileshr/aimeter/claude-md.svg" alt="Reviewed on agentmods" width="80" 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. 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.01070 $0.01070
Opus 5.5 $0.00428 $0.00428
Sonnet 5.5 $0.00214 $0.00214
Haiku 4.5 $0.00107 $0.00107

Measured 2mo ago against content hash e93221c50ac9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 2mo 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.py — CostRegistry + _BUILTIN_PRICING_RAW dict (prices per 1K tokens). Pricing is inline Python, not YAML — edit the dict directly to update/add models.
  • config.py — configure(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.py — record_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. 2mo 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 6mo ago), licensed Apache-2.0. It adds 1,070 tokens to every session, about $0.0043 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.

Related

aimeter CLAUDE.md compared with instructions from other repositories

aimeter CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
aimeter CLAUDE.mdsaileshr/aimeterInstructions file26mo agoApache-2.0A1,070Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode