enrich-issue

enrich-issue is a command for Claude Code from sjungling/sjungling-claude-plugins. It costs 24 tokens per session (2,762 once invoked), scanned A, original, MIT.

A GitHub issue-enrichment command that explains how a reported problem moves through the code and can add a Mermaid sequence diagram, a text-based interaction diagram.

In plain words
What is it for?
Use it to fetch an issue, trace the relevant code, add links to exact code lines, and optionally validate and include a sequence diagram.
Why use it?
A basic issue often lacks enough code context for someone else to investigate quickly. This adds code references and an optional visual explanation.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions subagents; names the AskUserQuestion tool.

Part of the workflow plugin — 10 commands, 1 agent shipped together

Good fit Use it to fetch an issue, trace the relevant code, add links to exact code lines, and optionally validate and include a sequence diagram.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/sjungling/sjungling-claude-plugins/enrich-issue
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/sjungling/sjungling-claude-plugins

Made for: Claude Code.

Or install workflow, the plugin that ships this one along with the rest of its 10 commands, 1 agent.

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 enrich-issue

README.md
[![agentmods](https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/enrich-issue/github.svg)](https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/enrich-issue)
Your own site
<a href="https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/enrich-issue"><img src="https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/enrich-issue/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 enrich-issue

Your own site · 80×15
<a href="https://agentmods.dev/commands/sjungling/sjungling-claude-plugins/enrich-issue"><img src="https://agentmods.dev/badge/commands/sjungling/sjungling-claude-plugins/enrich-issue.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,762 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.00024 $0.02762
Opus 5 $0.00012 $0.01381
Sonnet 5 $0.00005 $0.00552
Haiku 4.5 $0.00002 $0.00276

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

Security

Grade A, and why

enrich-issue 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 11d 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.

plugins/workflow/commands/enrich-issue.md · 296 lines

How it starts

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

Enrich a GitHub issue with codebase analysis: write narrative prose that traces the problem through the code with inline identifier hyperlinks, and optionally include a Mermaid sequence diagram that is render-validated before posting.

Step 1: Resolve Issue Number

Parse $ARGUMENTS for the issue number. If it is empty, use AskUserQuestion to ask the user for the issue number before proceeding.

ISSUE_NUMBER="$ARGUMENTS"
if [ -z "$ISSUE_NUMBER" ]; then
  # Use AskUserQuestion to collect the issue number, then set ISSUE_NUMBER
  exit 0
fi

Fetch the full issue details:

gh issue view "$ISSUE_NUMBER" --json number,title,body,labels,comments,url

If gh issue view returns a 404, tell the user the issue was not found in the current repository. Suggest they verify the issue number or pass --repo owner/repo to gh issue view manually and retry.

Resolve the permalink base pinned to origin/main HEAD:

REPO=$(gh repo view --json nameWithOwner -q '.nameWithOwner')
SHA=$(git rev-parse origin/main 2>/dev/null || git rev-parse HEAD)
PERMALINK_BASE="https://github.com/$REPO/blob/$SHA"

If git rev-parse origin/main fails (no remote), use HEAD and note the fallback at the end of the triage prose.

Step 3: Dispatch Research Subagent

Dispatch a fresh Agent to search the codebase. Fill in <number>, <title>, <body>, <repo>, <sha>, and <permalink_base> before dispatching.

Agent prompt:

You are analyzing GitHub issue #<number>: "<title>"

Issue body:
<body>

Repository: <repo>
Permalink base (pinned to origin/main HEAD <sha>): <permalink_base>

Map this issue to the codebase. Do NOT prescribe solutions. Do not use language like "should", "fix by", "change X to Y", or "the solution is".

## 1. TRIAGE THE CODEBASE

- Search for relevant symbols, error messages, config keys, or API paths from the issue using Grep, Glob, and Read
- Trace the execution path or data flow from entry point to failure
- Note blast radius: other areas affected even if not the root cause

Write triage prose — 3-6 sentences of narrative that traces the call chain from where the problem enters to where it manifests. Every code identifier you name (class name, method name, field name) must be a markdown hyperlink whose link text IS the identifier itself, not the file path. Build each permalink as:
  <permalink_base>/<file>#L<start>-L<end>

Format: [`ClassName.methodName`](permalink) or [`fieldName`](permalink)
Do NOT show raw file paths as visible link text. Do NOT write a separate table or list of code references.

Verify every file exists with `test -f <path>` before building its permalink. Skip any file that does not exist.

Example (not real — illustrative only):
  The issue originates in [`TokenRefreshFilter.doFilter`](https://github.com/org/repo/blob/SHA/path/Filter.java#L42-L67) where the session is re-issued without copying the expiry timestamp. The new token object is assembled in [`SessionFactory.build`](permalink) and written by [`SessionStore.persist`](permalink), which receives no expiry argument.

## 2. CODE REFS (for verification only — not displayed directly)

Return a separate machine-readable list of the code locations embedded in the prose above. These are used for post-hoc verification only and are NOT rendered in the output.

[
  { "file": "relative/path/from/repo/root.java", "start": 42, "end": 67 }
]

## 3. ASSESS DIAGRAM VALUE

Decide whether a Mermaid sequenceDiagram would materially help a reader understand WHERE the issue occurs:
- Include if: the issue involves interactions across multiple components or services
- Omit if: it is contained within a single function or class

If including, use real component names verified to exist in the code. Show ONLY the actual current flow. Use a `Note` annotation to mark the failure point. Do NOT show a corrected or desired flow.

Critical Mermaid syntax rules — violations will cause the diagram to fail rendering:
- Participant aliases: short identifiers only, NO spaces, parentheses, or special characters
  Good: `participant W as WorkerService`   Bad: `participant WorkerService (recipe-worker)`
- Message labels (arrows): NO semicolons. Semicolons are statement terminators in Mermaid — use a dash or comma instead
  Good: `W->>R: readUpgradesAndMigrations - returns empty`   Bad: `W->>R: reads CSV; returns empty`
- Note text: single line, under 80 characters, no colons or semicolons
- Do not use activate/deactivate blocks

## RETURN

{
  "triage_prose": "narrative with inline [`Identifier`](permalink) links...",
  "code_refs": [{ "file": "...", "start": N, "end": N }],
  "diagram": "sequenceDiagram\n  ..." or null,
  "diagram_rationale": "one sentence"
}

Read the full file on GitHub · 296 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. 11d ago First seen · 296 lines · 24 tokens per session scan A a10c0c69e1ec

Subscribe to this mod's changes

enrich-issue is a command published in the GitHub repository sjungling/sjungling-claude-plugins (13 stars, last pushed 27d ago), licensed MIT. It adds 24 tokens to every session and 2,762 once invoked, about $0.0001 per session on Opus 5. 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.