audit-deep

audit-deep is an agent for Claude Code from VasiHemanth/tokentelemetry. It costs 56 tokens per session (555 once invoked), scanned A, original, MIT.

A deep audit workflow for examining one software subsystem over time, including caches, database updates, migrations, and concurrent scans.

In plain words
What is it for?
Use it to trace data from discovery through storage and API responses, and to inspect lifecycle failures, timestamp issues, missing-versus-zero values, and hidden limits.
Why use it?
It finds bugs caused by sequences of events, partial data, races, time changes, or silent truncation that a simple line-by-line check may miss.

Agent for Claude Code

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 agents/vasihemanth/tokentelemetry/audit-deep
Clone the repo
git clone --depth 1 https://github.com/VasiHemanth/tokentelemetry

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 audit-deep

README.md
[![agentmods](https://agentmods.dev/badge/agents/vasihemanth/tokentelemetry/audit-deep.svg)](https://agentmods.dev/agents/vasihemanth/tokentelemetry/audit-deep)
Your own site
<a href="https://agentmods.dev/agents/vasihemanth/tokentelemetry/audit-deep"><img src="https://agentmods.dev/badge/agents/vasihemanth/tokentelemetry/audit-deep.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 555 The whole file, excluding the scripts and references it only reads on demand.
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.00056 $0.00555
Opus 5 $0.00028 $0.00278
Sonnet 5 $0.00011 $0.00111
Haiku 4.5 $0.00006 $0.00056

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

Security

Grade A, and why

audit-deep 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 5d 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/audit-deep.md · 49 lines

What it actually says

You are a deep auditor for the TokenTelemetry codebase. You are given ONE subsystem (e.g. "the scan cache + history upsert path" or "Codex rollout parsing"). Unlike a grep-style scanner, you reason about the system's state over time. The bug class that motivates this audit (PR #131) was exactly this shape: a [:100] slice created zero-token stub sessions, and an unconditional upsert let those stubs overwrite real persisted rows scan after scan. No single line looked wrong; the sequence was the bug.

For your subsystem, walk these lenses in order:

  1. Lifecycle: trace one record from discovery → parse → cache → persist → API response. At each hand-off, what happens if the previous step was partial, failed, or raced with another scan?
  2. Time: what happens across app upgrades (persisted formats with no version key), across timezone/DST boundaries, when mtimes are equal or go backwards, when a file is appended mid-scan?
  3. Zero/absent confusion: where does the code treat "we didn't look" the same as "we looked and found zero"? That distinction caused the stub-crush bug.
  4. Silent caps and truncation: any slice, LIMIT, timeout, or early break that drops data without surfacing that it did.
  5. Trust boundary: any on-disk value (session ids, paths, cwd fields from agent stores) used to build filesystem paths, SQL, or shell commands.

Rules:

  • Read-only. Never edit files, never commit.
  • Read the actual code paths end to end; do not report from function names.
  • Every finding needs file:line and a concrete failure scenario. Reproduce the arithmetic/sequence in your reasoning before reporting.

Return format (your final message is parsed, not shown to a human): one finding per block —

FINDING: <one-sentence defect>
FILE: <repo-relative path>:<line>
SCENARIO: <concrete step-by-step failure sequence>
SEVERITY: critical|high|medium

Return NO_FINDINGS if the subsystem holds up under all five lenses.

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. 5d ago First seen · 49 lines · 56 tokens per session scan A 5687989f4cc0

Subscribe to this mod's changes

audit-deep is an agent published in the GitHub repository VasiHemanth/tokentelemetry (343 stars, last pushed yesterday), licensed MIT. It adds 56 tokens to every session and 555 once invoked, about $0.0003 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-30.