industrial-ai-troubleshooting-agent: Command for Claude Code

.claude/commands/audit-trail.md

audit-trail is a command for Claude Code from ScottDuncanAI/industrial-ai-troubleshooting-agent. It costs 0 tokens per session (824 once invoked), scanned A, original, Apache-2.0.

A command that turns a completed root-cause analysis trace into a formatted audit report. A root-cause analysis trace is the recorded reasoning and actions from an investigation into why something went wrong.

In plain words
What is it for?
Use it after debugging or incident investigations to select the relevant trace, confirm corrective actions, and produce an audit document.
Why use it?
It provides a documented record of the investigation and checks that corrective actions were recorded before the report is finalized.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is ScottDuncanAI/industrial-ai-troubleshooting-agent's own configuration. It tells Claude Code how to work on industrial-ai-troubleshooting-agent 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 industrial-ai-troubleshooting-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to ScottDuncanAI/industrial-ai-troubleshooting-agent. 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/ScottDuncanAI/industrial-ai-troubleshooting-agent/main/.claude/commands/audit-trail.md
Clone the repo
git clone --depth 1 https://github.com/ScottDuncanAI/industrial-ai-troubleshooting-agent

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

README.md
[![agentmods](https://agentmods.dev/badge/commands/scottduncanai/industrial-ai-troubleshooting-agent/audit-trail/github.svg)](https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/audit-trail)
Your own site
<a href="https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/audit-trail"><img src="https://agentmods.dev/badge/commands/scottduncanai/industrial-ai-troubleshooting-agent/audit-trail/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 audit-trail

Your own site · 80×15
<a href="https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/audit-trail"><img src="https://agentmods.dev/badge/commands/scottduncanai/industrial-ai-troubleshooting-agent/audit-trail.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 824 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00824
Opus 5 $0.00000 $0.00412
Sonnet 5 $0.00000 $0.00165
Haiku 4.5 $0.00000 $0.00082

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

Security

Grade A, and why

audit-trail 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 12d 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/commands/audit-trail.md · 81 lines

How it starts

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

Audit Trail Report

Generate a formatted audit report from a completed root cause analysis trace.

ARGUMENTS: $ARGUMENTS

Conventions

  • Python: Always use the project's virtual-environment Python, never bare python (which on macOS may not exist or may point at a dependency-free system Python). Written as <venv-python> below — substitute .venv/bin/python on macOS/Linux or .venv/Scripts/python on Windows.
  • Opening files: Use the command for the user's OS, written as <open> below — open on macOS, xdg-open on Linux, start on Windows.

Steps

1. Identify the trace

If the user provided a run_id as the argument, use that.

If no run_id was provided, list available traces:

<venv-python> -c "import os; dirs = sorted(os.listdir('traces'), reverse=True)[:10]; [print(d) for d in dirs]"

If there is only one trace or the user just completed an investigation, use the most recent one. Otherwise ask which trace to use.

2. Ensure corrective actions are logged

Before finalizing the session, confirm the trace contains at least one corrective_action reasoning entry. If the investigation reached a root-cause conclusion but no corrective action was logged, log one or more now with audit_log_reasoning (reasoning_type="corrective_action") before proceeding — each grounded in the confirmed root cause, citing its evidence_steps and the relevant troubleshooting guide / SOP (use docs_search if needed, and cite the document title and revision). Do this now, while the session is still open, so the entries are captured and the "Recommended Corrective Actions" section of summary.md is never empty.

3. Auto-finalize if needed

Check if the session has a session_meta.json. If not, call audit_end_session to finalize it before rendering.

4. Render the reports

<venv-python> render_audit.py traces/{run_id}

Capture the output. This generates both report.md (detailed) and summary.md (executive summary). If the script fails, diagnose and report the error.

Read the full file on GitHub · 81 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. 12d ago First seen · 81 lines · 0 tokens per session scan A e393ea6a20de

Subscribe to this mod's changes

audit-trail is a command published in the GitHub repository ScottDuncanAI/industrial-ai-troubleshooting-agent (59 stars, last pushed 1mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 824 tokens. 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.