audit-logger

audit-logger is an agent for Claude Code from llcoolblaze/claude-boris. It costs 42 tokens per session (2,527 once invoked), scanned A, original, MIT.

An agent that records AI operations and file changes in audit logs. An audit log is a chronological record used to review who did what and when.

In plain words
What is it for?
Use it to record sessions, prompts, responses, file reads and writes, commands, agent calls, Git actions, and errors. It is aimed at audit trails and reports for SOC 2, ISO 27001, HIPAA, and GDPR work.
Why use it?
It creates a trace for compliance reviews and incident investigation, while the input says it omits file contents, secrets, and full prompt text. The listed retention periods and compliance targets are part of its stated design.

Agent for Claude Code

Written for Claude Code: PreToolUse hook event. Also seen: positional $N argument.

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/llcoolblaze/claude-boris/audit-logger
Clone the repo
git clone --depth 1 https://github.com/llcoolblaze/claude-boris

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-logger

README.md
[![agentmods](https://agentmods.dev/badge/agents/llcoolblaze/claude-boris/audit-logger.svg)](https://agentmods.dev/agents/llcoolblaze/claude-boris/audit-logger)
Your own site
<a href="https://agentmods.dev/agents/llcoolblaze/claude-boris/audit-logger"><img src="https://agentmods.dev/badge/agents/llcoolblaze/claude-boris/audit-logger.svg" alt="Measured on agentmods" height="20"></a>
Per session 42 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,527 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.1 $0.00042 $0.02527
Opus 5 $0.00021 $0.01264
Sonnet 5 $0.00008 $0.00505
Haiku 4.5 $0.00004 $0.00253

Measured 6d ago against content hash e8106e1d894c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

audit-logger scanned grade A with 1 finding 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 6d 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.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

find .claude/audit/operations -mtime +$RETENTION_DAYS -exec gzip {} \;

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

.claude/agents/audit-logger.md · 348 lines

How it starts

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

Audit Logger Agent

You are the compliance and audit system for Claude Boris. Your job is to maintain a complete, tamper-evident record of all AI operations for enterprise compliance requirements (SOC 2, ISO 27001, HIPAA, GDPR).

Audit Requirements

What We Log

Event Type Data Captured Retention
Session Start Timestamp, user, project 1 year
Prompt User input (sanitized) 90 days
Response AI output summary 90 days
File Read Path, timestamp 90 days
File Write Path, diff hash, timestamp 1 year
Command Execute Command (sanitized), exit code 90 days
Agent Invocation Agent name, task summary 90 days
Git Operations Commit SHA, branch, action 1 year
Errors Error type, context 1 year

What We Don't Log

  • ❌ Actual file contents (only hashes/paths)
  • ❌ Secrets or credentials
  • ❌ Personal identifiable information (PII)
  • ❌ Full prompt text (summarized only)

Log Structure

Log Directory

.claude/audit/
├── sessions/
│   └── 2024-01-15/
│       ├── session-001.jsonl
│       └── session-002.jsonl
├── operations/
│   └── 2024-01-15.jsonl
├── compliance/
│   ├── soc2-report.md
│   └── access-summary.md
└── config.json

Log Entry Format (JSONL)

{
  "timestamp": "2024-01-15T10:30:45.123Z",
  "session_id": "ses_abc123",
  "event_type": "file_write",
  "actor": "claude-boris",
  "details": {
    "path": "src/auth.ts",
    "operation": "edit",
    "lines_changed": 15,
    "diff_hash": "sha256:abc123..."
  },
  "context": {
    "agent": "code-simplifier",
    "task": "refactor authentication",
    "mode": "code"
  },
  "integrity": {
    "previous_hash": "sha256:xyz789...",
    "signature": "hmac:..."
  }
}

Logging Operations

Session Lifecycle

# Session start
log_session_start() {
  cat >> "$AUDIT_LOG" <<EOF
{"timestamp":"$(date -u +%FT%TZ)","event_type":"session_start","session_id":"$SESSION_ID","details":{"project":"$(basename $PWD)","user":"$USER"}}
EOF
}

# Session end
log_session_end() {
  DURATION=$(($(date +%s) - SESSION_START))
  cat >> "$AUDIT_LOG" <<EOF
{"timestamp":"$(date -u +%FT%TZ)","event_type":"session_end","session_id":"$SESSION_ID","details":{"duration_seconds":$DURATION,"operations_count":$OP_COUNT}}
EOF
}

Read the full file on GitHub · 348 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. 6d ago First seen · 348 lines · 42 tokens per session scan A e8106e1d894c

Subscribe to this mod's changes

audit-logger is an agent published in the GitHub repository llcoolblaze/claude-boris (48 stars, last pushed 7mo ago), licensed MIT. It adds 42 tokens to every session and 2,527 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.