gh-explain

gh-explain is a command for Claude Code from synaptiai/synapti-marketplace. It costs 18 tokens per session (1,858 once invoked), scanned B, original, Apache-2.0.

An interactive explanation tool that loads the code difference, decision log, issue details, and source files behind an AI-built change.

In plain words
What is it for?
Use it to get an initial summary of an issue or pull request and ask follow-up questions about what was built and why.
Why use it?
It lets developers ask questions about a change using the actual code and recorded decisions, while identifying information that is missing instead of guessing.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; names the AskUserQuestion tool.

Part of the gh-workflow plugin — 4 skills, 5 commands shipped together

Good fit Use it to get an initial summary of an issue or pull request and ask follow-up questions about what was built and why.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/synaptiai/synapti-marketplace/gh-explain
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/synaptiai/synapti-marketplace

Made for: Claude Code.

Or install gh-workflow, the plugin that ships this one along with the rest of its 4 skills, 5 commands.

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 gh-explain

README.md
[![agentmods](https://agentmods.dev/badge/commands/synaptiai/synapti-marketplace/gh-explain/github.svg)](https://agentmods.dev/commands/synaptiai/synapti-marketplace/gh-explain)
Your own site
<a href="https://agentmods.dev/commands/synaptiai/synapti-marketplace/gh-explain"><img src="https://agentmods.dev/badge/commands/synaptiai/synapti-marketplace/gh-explain/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 gh-explain

Your own site · 80×15
<a href="https://agentmods.dev/commands/synaptiai/synapti-marketplace/gh-explain"><img src="https://agentmods.dev/badge/commands/synaptiai/synapti-marketplace/gh-explain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 18 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,858 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.00018 $0.01858
Opus 5 $0.00009 $0.00929
Sonnet 5 $0.00004 $0.00372
Haiku 4.5 $0.00002 $0.00186

Measured today against content hash 35a892910d7a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade B, and why

gh-explain 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 today.

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.

' "$HOME/.claude/settings.gh-workflow.json" \
plugins/gh-workflow/commands/gh-explain.md · 197 lines

How it starts

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

Explain: What Did AI Build?

Context loader for interactive Q&A about what AI built on your behalf. Loads the decision journal, diff, issue context, and source files so you can ask questions grounded in evidence.

Tool Usage: This command uses the AskUserQuestion tool for session save decisions.

Contract

GOAL: Load all available context about an issue/PR and present a comprehension brief, then enable conversational Q&A. Testable: user can ask questions and get answers grounded in actual code, decisions, and issue context.

CONSTRAINTS:

  • Never fabricate decisions or rationale not present in the journal or diff
  • Always distinguish between journal-recorded decisions and inferred decisions
  • If context is incomplete, state what's missing rather than guessing

FORMAT: Comprehension brief displayed first, then open-ended conversation.

FAILURE CONDITIONS (output is unacceptable if any apply):

  • Claims about decisions that aren't in the journal or diff
  • Answers not grounded in loaded context
  • Context loading fails silently (must report what's missing)

Phase 1: Context Loading

Step 1.1: Determine Target

If $ARGUMENTS is provided, normalize it to a numeric issue/PR number:

ISSUE_NUM=$(echo "$ARGUMENTS" | grep -oE '[0-9]+$')

If $ARGUMENTS is not provided, detect from current branch:

BRANCH=$(git branch --show-current)
ISSUE_NUM=$(echo "$BRANCH" | grep -oE 'issue-[0-9]+' | grep -oE '[0-9]+')

If no issue number found from branch or arguments, ask via AskUserQuestion tool:

  • "Which issue or PR would you like to explore?"

Step 1.2: Load Context (Parallel)

First, read journal directory and explain config from settings:

# Read explain config from settings (local > project > user > default)
GHW_CONFIG=$(jq -n '
  def defaults: {
    journal: { dir:".decisions" },
    explain: { sessionSave:"ask", includeDiff:true }
  };
  defaults
    * (try input catch {})
    * (try input catch {})
    * (try input catch {})
' "$HOME/.claude/settings.gh-workflow.json" \
  ".claude/settings.gh-workflow.json" \
  ".claude/settings.gh-workflow.local.json" 2>/dev/null)

JOURNAL_DIR=$(echo "$GHW_CONFIG" | jq -r '.journal.dir')
INCLUDE_DIFF=$(echo "$GHW_CONFIG" | jq -r '.explain.includeDiff')
SESSION_SAVE=$(echo "$GHW_CONFIG" | jq -r '.explain.sessionSave')
echo "Journal directory: $JOURNAL_DIR"
echo "Include diff: $INCLUDE_DIFF"
echo "Session save: $SESSION_SAVE"

Read the full file on GitHub · 197 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. today First seen · 197 lines · 18 tokens per session scan B 35a892910d7a

Subscribe to this mod's changes

gh-explain is a command published in the GitHub repository synaptiai/synapti-marketplace (6 stars, last pushed today), licensed Apache-2.0. It adds 18 tokens to every session and 1,858 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-09-10.