investigate

investigate is a skill for Claude Code from Borda/AI-Rig. It costs 191 tokens per session (5,515 once invoked), scanned B, original, Apache-2.0.

A structured diagnosis workflow for unknown failures in local setups, tools, continuous integration, hooks, permissions, and runtime behaviour.

In plain words
What is it for?
Use it when a command fails without a clear cause, hooks do not run, local and CI results differ, tools are unavailable, or the environment behaves unexpectedly.
Why use it?
It gathers evidence and tests competing explanations so you can identify the root cause before changing anything.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the foundry plugin — 10 skills, 10 agents shipped together

Good fit Use it when a command fails without a clear cause, hooks do not run, local and CI results differ, tools are unavailable, or the environment behaves unexpectedly.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add Borda/AI-Rig
Claude Code
/plugin install foundry

Made for: Claude Code.

Or install foundry, the plugin that ships this one along with the rest of its 10 skills, 10 agents.

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 investigate

README.md
[![agentmods](https://agentmods.dev/badge/skills/borda/ai-rig/investigate/github.svg)](https://agentmods.dev/skills/borda/ai-rig/investigate)
Your own site
<a href="https://agentmods.dev/skills/borda/ai-rig/investigate"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/investigate/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 investigate

Your own site · 80×15
<a href="https://agentmods.dev/skills/borda/ai-rig/investigate"><img src="https://agentmods.dev/badge/skills/borda/ai-rig/investigate.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 191 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,515 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00191 $0.05515
Opus 5 $0.00096 $0.02757
Sonnet 5 $0.00038 $0.01103
Haiku 4.5 $0.00019 $0.00551

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

Security

Grade B, and why

investigate scanned grade B 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 9d 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 directoriesmediumAgent snooping

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

Use Read to check `.claude/settings.json` — look for hook registrations, allow entries relevant to failing command, and `enabledMcpjsonServers`. For `~/.claude/settings.json` (outside allowed Read paths), use Bash:
plugins/cc_foundry/skills/investigate/SKILL.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.

Diagnose unknown failures: broken local setup, environment mismatch, tool misbehavior, hook problems, CI vs local divergence, permission errors, runtime anomalies. Gather signals broadly, eliminate hypotheses systematically, report confirmed root cause + recommended next skill. No fixes — diagnosis only. NOT for: known Python test failures with traceback (use /develop:debug (requires develop plugin)); .claude/ config quality sweep (use /foundry:audit).

  • $ARGUMENTS: required — symptom, question, or failing command, e.g.:

    • "hooks not firing on Save"
    • "bridge review is unavailable on this machine"
    • "/calibrate times out every run"
    • "CI fails but passes locally"
    • "uv run pytest can't find conftest.py"
  • --fast: optional flag — skip Step 4 adversarial Codex review; use when speed matters more than thoroughness or Codex unavailable.

If $ARGUMENTS empty or too vague, use AskUserQuestion: "What exactly is failing or behaving unexpectedly? Include the command and any error output you can share."

Task hygiene: load and follow the protocol below.

# loads: compaction-contract.md
# audit-skip: resilience-replication
python "${CLAUDE_PLUGIN_ROOT:-plugins/cc_foundry}/bin/load_shared_doc.py" foundry skills/_shared task-hygiene.md  # timeout: 5000

Task tracking: TaskCreate tasks for Gather, Hypothesise, Probe, Report; mark in_progress/completed as you go.

Step 1: Parse symptom and scope

export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}"
KEEP_ITEMS=""
if [[ "$ARGUMENTS" =~ --keep[[:space:]]\"([^\"]+)\" ]]; then
    KEEP_ITEMS="${BASH_REMATCH[1]}"
fi
ARGUMENTS=$(echo "$ARGUMENTS" | sed 's/--keep "[^"]*"//g')
rm -f .temp/state/skill-contract.md ${TMPDIR:-/tmp}/investigate-verdicts-${CSID}  # clear stale contract + probe ledger (compaction-contract.md §Lifecycle)  # timeout: 5000
echo "$KEEP_ITEMS" > "${TMPDIR:-/tmp}/investigate-keep-items-${CSID}"

From $ARGUMENTS extract:

  • What: specific failure or anomaly
  • Where: local / CI / both; which tool or command; which skill or hook if applicable
  • When: started recently (after change) or always broken; intermittent or consistent

Unsupported flag check — after all supported flags extracted (--fast, --keep), scan $ARGUMENTS for remaining --<token> tokens. If found: print ! Unknown flag(s): `--<token>`. Supported: `--fast`, `--keep`. then invoke AskUserQuestion — (a) Abort (stop, re-invoke with correct flags) · (b) Continue ignoring (skip unknown flags, proceed). On Abort: stop.

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. 9d ago First seen · 348 lines · 191 tokens per session scan B d2ca7d0d5ed4

Subscribe to this mod's changes

investigate is a skill published in the GitHub repository Borda/AI-Rig (27 stars, last pushed today), licensed Apache-2.0. It adds 191 tokens to every session and 5,515 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it B 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.

Related

Other skills, from other repositories

anomaly-alert

Identify anomalous sessions using Agent Monitor data — cost outliers from the pricing engine, token anomalies (cache miss spikes, compaction baseline surges), unusual event type ratios (PreToolUse/PostToolUse gaps, APIError clusters), behavioral deviations from workflow intelligence (complexity score outliers, error…

hoangsonww/Claude-Code-Agent-Monitor · 86 tokens

transcript-grep

Search a Claude Code session transcript for a string or regex pattern and show every matching message with surrounding context. Reads /api/sessions/:id/transcript and resolves sessions via /api/sessions?limit= from the Agent Monitor dashboard. Use when hunting for a specific message, prompt, tool call, or error inside…

hoangsonww/Claude-Code-Agent-Monitor · 73 tokens

regression-watch

Detect quality and efficiency regressions over time using Agent Monitor data — rising error rate (APIError events), falling cache hit rate, growing compaction frequency, and climbing cost-per-session. Splits history into an earlier baseline window and a recent window and reports which metrics are getting worse, by how…

hoangsonww/Claude-Code-Agent-Monitor · 82 tokens

hook-inventory

Inventory hooks across the user, project, and project-local settings plus the /.claude/hooks scripts directory — read through the Agent Monitor Config Explorer API — and flag hooks that POST to the network or run arbitrary commands. Reads /api/cc-config/hooks and /api/cc-config/hook-scripts. Use when auditing hook…

hoangsonww/Claude-Code-Agent-Monitor · 71 tokens

event-trace

Trace the full event chain for one Claude Code session into an ordered timeline of every event type with toolname and summary, highlighting gaps, out-of-order events, and failures. Reads /api/events?sessionid= and /api/sessions/:id from the Agent Monitor dashboard. Use when debugging what a session actually did, step…

hoangsonww/Claude-Code-Agent-Monitor · 73 tokens

error-scan

Scan recent Claude Code activity for errors and failure signals across all sessions using Agent Monitor data — APIError events and PreToolUse→PostToolUse gaps (tools that started but never completed) — then group failures by tool and model and rank them by frequency. Use when checking for errors or asking "what's…

hoangsonww/Claude-Code-Agent-Monitor · 70 tokens