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

.claude/commands/ml-fault-detection.md

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

A command for finding possible fault periods in boiler historian data, which is time-stamped data collected from boiler sensors. It also ranks sensors that may give early warning of faults.

In plain words
What is it for?
Use it to check the available data range, detect unusual boiler behaviour, identify likely fault events, and rank the sensors most associated with those events.
Why use it?
It helps turn a large stream of boiler readings into a shorter list of unusual periods and potentially useful warning signals.

Command for Claude Code

Written for Claude Code: installed under .claude/.

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/ml-fault-detection.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 ml-fault-detection

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

Your own site · 80×15
<a href="https://agentmods.dev/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection"><img src="https://agentmods.dev/badge/commands/scottduncanai/industrial-ai-troubleshooting-agent/ml-fault-detection.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 953 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.00953
Opus 5 $0.00000 $0.00477
Sonnet 5 $0.00000 $0.00191
Haiku 4.5 $0.00000 $0.00095

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

Security

Grade A, and why

ml-fault-detection 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/ml-fault-detection.md · 83 lines

How it starts

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

ML Fault Detection

Run Isolation Forest anomaly detection and XGBoost feature importance analysis on the boiler historian data to identify fault periods and rank early-warning sensors.

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. Confirm data range

Call historian_get_data_range to confirm the dataset's time span and report it to the user before running.

2. Run the analysis

Run the ML fault detection script:

<venv-python> ml_fault_detection.py --downsample-minutes 1 --top-n-events 5

Capture the JSON output from stdout. The script prints progress to stderr and the JSON summary to stdout. If xgboost is unavailable for any reason — not installed, or installed but unable to load (e.g. missing libomp on macOS) — the script automatically falls back to GradientBoostingClassifier. Note which model was used from the feature_importance.model field.

If the script fails, diagnose the error from stderr and report it to the user.

3. Open key plots

All outputs are saved to plots/MLFault/MLFault_<date>/. Open the monitoring chart, feature importance chart, and fault report:

<open> <monitoring_plot_path>
<open> <feature_importance_plot_path>
<open> <fault_report_path>

4. Present model summary

Report to the user:

  • Total observations and downsample resolution
  • NOC training set size (rows where TE_8332A is in [530–545°C] vs total rows)
  • Contamination parameter used and resulting anomaly rate
  • Number of fault periods detected

5. Investigate worst fault events

For each of the top fault events in worst_events:

  1. Call alarm_search_context(event.start, window_minutes=30) — what alarms were firing around this event?
  2. Call alarm_get_active_at(event.start) — full list of active alarms at the fault peak
  3. Note whether TE_8332A was outside 530–545°C at that time (cross-reference with monitoring plot)

Read the full file on GitHub · 83 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 · 83 lines · 0 tokens per session scan A cd4fb5b3ec39

Subscribe to this mod's changes

ml-fault-detection 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 953 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.