investigate

investigate is a skill for Claude Code from Borda/AI-Rig. It costs 191 tokens per session (6,609 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: reads .claude/ paths; mentions CLAUDE.md; 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 6,609 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.06609
Opus 5.5 $0.00076 $0.02644
Sonnet 5.5 $0.00038 $0.01322
Haiku 4.5 $0.00019 $0.00661

Measured 18d ago against content hash 98be82475444, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 18d 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.

Print environment variable names only, never their values. Inspect configuration through the projection below rather than raw Read or dumps: it retains permission and hook structure, enabled plugins, and environment key
plugins/cc_foundry/skills/investigate/SKILL.md · 319 lines

How it starts

The opening of the file, as written. The whole thing — 319 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"
    • "/foundry: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.

$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 — task tools may be deferred; load before first use: ToolSearch(query="select:TaskList,TaskCreate,TaskUpdate,TaskGet", max_results=4). Call TaskList first and triage each task it returns: completed if work clearly done, deleted if orphaned, keep in_progress only if genuinely continuing. Never spend a turn on bookkeeping alone — every TaskCreate/TaskUpdate ships in the same response as the next substantive tool call; one exception, TaskUpdate(completed) immediately before a long output block (rules/task-lifecycle.md).

Task tracking: TaskCreate tasks for Gather, Hypothesise, Probe, Report in the same response as the Step 1 block; each later TaskUpdate rides with that step's first real tool call — zero bookkeeping-only turns (measured: ~7 per run before this rule).

Turn budget — the profiled runs were 94% single-call turns, and every turn re-reads the whole live context. Each step below is one bash block plus the Read/Grep/Write calls it needs, all issued together in one response; independent probes go in one response too. Never split a block to look at half its output.

Step 1: Parse symptom and scope

One block: flag parsing, stale-ledger clear, and the run directory Step 2 needs. Run-dir creation has no dependency on the scoping below, and a second bash block would cost a whole turn — a turn re-reads the entire live context (claude-config.md §Turn Batching).

PLUGIN_ROOT=$(python "${CLAUDE_PLUGIN_ROOT}/bin/resolve_plugin_root.py" --plugin-name foundry) || exit $?; export PLUGIN_ROOT
export CSID="${CLAUDE_CODE_SESSION_ID:-$PPID}"
python "$PLUGIN_ROOT/bin/parse-skill-flags.py" --flags fast --keep-state investigate -- "$ARGUMENTS" >/dev/null  # timeout: 5000 — no eval; investigate-{fast,clean-args,keep-items}-${CSID}, clears stale contract
IFS= read -r ARGUMENTS < "${TMPDIR:-/tmp}/investigate-clean-args-${CSID}" 2>/dev/null || ARGUMENTS=""
rm -f "${TMPDIR:-/tmp}/investigate-verdicts-${CSID}"  # stale probe ledger  # timeout: 3000
INVESTIGATE_RUN=".temp/investigate/$(date -u +%Y-%m-%dT%H-%M-%SZ)"
mkdir -p "$INVESTIGATE_RUN"
echo "$INVESTIGATE_RUN" > "${TMPDIR:-/tmp}/investigate-run-path-${CSID}"  # persist; re-read in later steps
echo "INVESTIGATE_RUN=$INVESTIGATE_RUN"  # bash vars don't persist; read from stdout
printf '%s\n' "$ARGUMENTS" | tr ' ' '\n' | grep -E '^--' | sed 's/^/UNKNOWN_FLAG=/'  # feeds unsupported-flag check

Read the full file on GitHub · 319 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. 18d ago Changed · +10 lines 98be82475444
  2. 1mo ago Changed · -9 lines e88032d28163
  3. 1mo ago Changed ff6ac13f888d
  4. 1mo ago Changed d603dfcce0b8
  5. 1mo ago Changed · +3 lines f617060b2803
  6. 2mo ago Changed · +2 lines 32fc52f23263
  7. 2mo ago Changed · -9 lines fd671c991c21
  8. 2mo ago Changed · +2 lines f4ca802c30e1
  9. 2mo ago Changed aa7aefbc7e69
  10. 2mo ago First seen · 320 lines · 191 tokens per session scan B 2bfc79e74938

Subscribe to this mod's changes

investigate is a skill published in the GitHub repository Borda/AI-Rig (31 stars, last pushed yesterday), licensed Apache-2.0. It adds 191 tokens to every session and 6,609 once invoked, about $0.0008 per session on Opus 5.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

investigate compared with skills from other repositories

investigate next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
investigateBorda/AI-RigSkill31yesterdayApache-2.0B191Claude Code
anomaly-alerthoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA86Claude Code, Codex
transcript-grephoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA73Claude Code, Codex
regression-watchhoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA82Claude Code, Codex
hook-inventoryhoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA71Claude Code, Codex
event-tracehoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA73Claude Code, Codex
api-error-reporthoangsonww/Claude-Code-Agent-MonitorSkill1.2kyesterdayMITA72Claude Code, Codex