diagnose

diagnose is a skill for Claude Code from yurukusa/claude-code-hooks. It costs 26 tokens per session (435 once invoked), scanned B, original, MIT.

A diagnostic tool for checking a Claude Code hooks setup, including hook files, permissions, dependencies, environment variables, settings, and recent logs. Hooks are automated commands triggered by agent events.

In plain words
What is it for?
Use it to verify hook scripts such as syntax checks, branch protection, activity logging, and proof logging, and to inspect recent activity and configuration problems.
Why use it?
It identifies missing files, incorrect permissions, unavailable tools, unset configuration, and hooks that are not connected to Claude Code.

Skill for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: reads .claude/ paths; mentions Claude Code.

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 claude-code-hooks plugin — 2 skills, 5 hooks shipped together

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 yurukusa/claude-code-hooks
Claude Code
/plugin install claude-code-hooks

Made for: Claude Code.

Or install claude-code-hooks, the plugin that ships this one along with the rest of its 2 skills, 5 hooks.

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 diagnose

README.md
[![agentmods](https://agentmods.dev/badge/skills/yurukusa/claude-code-hooks/diagnose.svg)](https://agentmods.dev/skills/yurukusa/claude-code-hooks/diagnose)
Your own site
<a href="https://agentmods.dev/skills/yurukusa/claude-code-hooks/diagnose"><img src="https://agentmods.dev/badge/skills/yurukusa/claude-code-hooks/diagnose.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 435 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00026 $0.00435
Opus 5 $0.00013 $0.00217
Sonnet 5 $0.00005 $0.00087
Haiku 4.5 $0.00003 $0.00044

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

Security

Grade B, and why

diagnose 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 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 directoriesmediumAgent snooping

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

- Check `~/.claude/settings.json` for hook entries
skills/diagnose/SKILL.md · 57 lines

What it actually says

Diagnose Claude Code Hooks

Run a diagnostic check on the user's Claude Code hooks setup.

Checks to perform

  1. Hook files exist and are executable

    for hook in context-monitor.sh syntax-check.sh activity-logger.sh branch-guard.sh decision-warn.sh cdp-safety-check.sh error-gate.sh no-ask-human.sh proof-log-session.sh session-start-marker.sh; do
      if [ -f "${CLAUDE_PLUGIN_ROOT}/hooks/$hook" ]; then
        if [ -x "${CLAUDE_PLUGIN_ROOT}/hooks/$hook" ]; then
          echo "OK: $hook (executable)"
        else
          echo "WARN: $hook exists but not executable"
        fi
      else
        echo "MISSING: $hook"
      fi
    done
    
  2. Dependencies available

    • jq — required by most hooks
    • python3 — required by activity-logger, proof-log, context-monitor
    • node — optional, for JS syntax checking
  3. Environment variables

    • Check if CC_ACTIVITY_LOG, CC_PROOF_LOG_DIR, CC_CONTEXT_MISSION_FILE are set
    • Report defaults if not set
  4. Settings.json integration

    • Check ~/.claude/settings.json for hook entries
    • Report which hooks are wired and which are missing
  5. Recent activity

    • Check if activity log exists and has recent entries
    • Check if proof-log directory has recent session logs

Output format

Present results as a health report:

=== Claude Code Hooks Health Check ===
Hooks:     8/10 active
Deps:      jq ✓  python3 ✓  node ✓
Env:       3/5 configured
Activity:  Last entry 2h ago
Overall:   HEALTHY (2 warnings)

List any warnings or errors with actionable fix instructions.

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 · 57 lines · 26 tokens per session scan B dae4936547c3

Subscribe to this mod's changes

diagnose is a skill published in the GitHub repository yurukusa/claude-code-hooks (19 stars, last pushed 7d ago), licensed MIT. It adds 26 tokens to every session and 435 once invoked, about $0.0001 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.