Agent skill

Understand Diff Analysis

by Egonex-AI in Egonex-AI/Understand-Anything

Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

MITAuto-check passedDevelopment

Install Understand Diff Analysis

skills CLI
$ npx skills add Egonex-AI/Understand-Anything --skill understand-diff -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Egonex-AI/Understand-Anything understand-diff --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Egonex-AI/Understand-Anything.git skills-src && mkdir -p .claude/skills && cp -r skills-src/understand-anything-plugin/skills/understand-diff .claude/skills/understand-diff && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
understand-diff
GitHub stars
85k
Used in
1 other repo
Token cost
~1.4k tokens
SKILL.md length
700 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

  • Works in 4 steps: Use Grep to search within the JSON for… → Only read sections you need — don't dump… → Node names and summaries are the most… → …
  • Reviewing what a pull request touches before merging
  • SKILL.md covers Graph Structure Reference, How to Read Efficiently and Instructions
  • Calls git

What it does

Run as the slash command /understand-diff, the skill works from a knowledge graph the project already has, stored as knowledge-graph.json under a .ua folder or the older .understand-anything folder, and it tells you to run /understand first when the file is missing. The graph holds nodes for files, functions, classes, services, tables and more, plus edges such as imports, calls and depends_on, grouped into layers.

To find what changed, it lists changed files with git diff, either for uncommitted work, for a feature branch compared with its base branch, or from a pull request you name. It then reads the graph's project metadata, including the recorded commit hash, to judge how fresh the graph is, and searches the JSON with grep so the whole file never has to enter the context.

When your agent uses it

  • Reviewing what a pull request touches before merging
  • Checking which components depend on the files you just edited
  • Assessing risk in uncommitted changes on a feature branch

Example prompts

  • “Run /understand-diff on my current branch and tell me which modules it affects.”
  • “What does the open pull request for this branch change, and where is the risk?”
  • “Explain the impact of my uncommitted changes using the project knowledge graph.”

Requirements

  • A knowledge graph built earlier with /understand
  • A git repository

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Use Grep to search within the JSON for relevant entries BEFORE reading the full file
  2. Only read sections you need — don't dump the entire graph into context
  3. Node names and summaries are the most useful fields for understanding
  4. Edges tell you how components connect — follow imports and calls for dependency chains

What it can do on your machine

Read from SKILL.md and the folder at commit 790b157. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Understand Diff Analysis loads about 1.4k tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 700 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Egonex-AI/Understand-Anything at commit 790b157, republished under its MIT licence (© Egonex-AI). 700 words, ~1,439 tokens.

Download SKILL.mdSave it as .claude/skills/understand-diff/SKILL.md (or your agent's skills folder).
name
understand-diff
description
Use when you need to analyze git diffs or pull requests to understand what changed, affected components, and risks

/understand-diff

Analyze the current code changes against the knowledge graph in the project's data directory (.ua/knowledge-graph.json, or the legacy .understand-anything/knowledge-graph.json when that directory is present).

Graph Structure Reference

The knowledge graph JSON has this structure:

  • project — {name, description, languages, frameworks, analyzedAt, gitCommitHash}
  • nodes[] — each has {id, type, name, filePath?, summary, tags[], complexity, languageNotes?}
    • Code node types: file, function, class, module, concept
    • Non-code node types: config, document, service, table, endpoint, pipeline, schema, resource
    • Domain/knowledge node types: domain, flow, step, article, entity, topic, claim, source
    • IDs use the node type as prefix, e.g. file:path, function:path:name, config:path, article:path
  • edges[] — each has {source, target, type, direction, weight}
    • Key types: imports, contains, calls, depends_on, configures, documents, deploys, triggers, contains_flow, flow_step, related, cites
  • layers[] — each has {id, name, description, nodeIds[]}
  • tour[] — each has {order, title, description, nodeIds[]}

How to Read Efficiently

  1. Use Grep to search within the JSON for relevant entries BEFORE reading the full file
  2. Only read sections you need — don't dump the entire graph into context
  3. Node names and summaries are the most useful fields for understanding
  4. Edges tell you how components connect — follow imports and calls for dependency chains

Instructions

  1. Resolve the data directory $UA_DIR. Run UA_DIR=$([ -d .understand-anything ] && echo .understand-anything || echo .ua) — this is the legacy .understand-anything/ when it already exists, otherwise the new .ua/. Check that $UA_DIR/knowledge-graph.json exists. If not, tell the user to run /understand first.

  2. Get the changed files list (do NOT read the graph yet):

    • If on a branch with uncommitted changes: git diff --name-only
    • If on a feature branch: git diff main...HEAD --name-only (or the base branch)
    • If the user specifies a PR number: get the diff from that PR
  3. Read project metadata and check graph freshness — use Grep or Read with a line limit to extract the "project" section, including gitCommitHash as GRAPH_COMMIT_RAW, then:

    • Resolve it as a commit before using it in any Git diff. From the project root, compare the resolved commit with git rev-parse HEAD and inspect project-scoped committed and working-tree changes:
      bash
      GRAPH_COMMIT=$(git rev-parse --verify --end-of-options "${GRAPH_COMMIT_RAW}^{commit}" 2>/dev/null)
      git rev-parse HEAD
      git diff --name-only "$GRAPH_COMMIT" HEAD -- .
      git diff --cached --name-only -- .
      git diff --name-only -- .
      git ls-files --others --exclude-standard -- .
    • The -- . pathspec is required: commits that only touch a sibling monorepo project must not make this graph stale. A hash mismatch alone is not stale when the project diff is empty.
    • Ignore the selected data directory (.ua/ or legacy .understand-anything/) in every command's output because it contains generated graph artifacts, not project source drift.
    • If the committed diff or any working-tree command reports project files, warn before impact analysis that the graph may omit those changes. Suggest: Run /understand to refresh the graph.
    • Run the commit diff only when GRAPH_COMMIT_RAW resolves successfully. If the graph commit or Git metadata is missing, invalid, or unavailable, give a brief best-effort warning and continue instead of blocking.
  4. Find nodes for changed files — for each changed file path, use Grep to search the knowledge graph for:

    • Nodes with matching "filePath" values (e.g., grep "changed/file/path")
    • This finds file-level nodes (including non-code types) AND function/class nodes defined in those files
    • Note the id values of all matched nodes
  5. Find connected edges (1-hop) — for each matched node ID, Grep for that ID in the edges to find:

    • What imports or depends on the changed nodes (upstream callers)
    • What the changed nodes import or call (downstream dependencies)
    • These are the "affected components" — things that might break or need updating
  6. Identify affected layers — Grep for the matched node IDs in the "layers" section to determine which architectural layers are touched.

  7. Provide structured analysis:

    • Changed Components: What was directly modified (with summaries from matched nodes)
    • Affected Components: What might be impacted (from 1-hop edges)
    • Affected Layers: Which architectural layers are touched and cross-layer concerns
    • Risk Assessment: Based on node complexity values, number of cross-layer edges, and blast radius (number of affected components)
    • Suggest what to review carefully and any potential issues
  8. Write diff overlay for dashboard — after producing the analysis, write the diff data to $UA_DIR/diff-overlay.json so the dashboard can visualize changed and affected components. The file contains:

    json
    {
      "version": "1.0.0",
      "baseBranch": "<the base branch used>",
      "generatedAt": "<ISO timestamp>",
      "changedFiles": ["<list of changed file paths>"],
      "changedNodeIds": ["<node IDs from step 4>"],
      "affectedNodeIds": ["<node IDs from step 5, excluding changedNodeIds>"]
    }

    After writing, tell the user they can run /understand-anything:understand-dashboard to see the diff overlay visually.

© Egonex-AI, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in understand-anything-plugin/skills/understand-diff of Egonex-AI/Understand-Anything.

Open the folder on GitHubat commit 790b157

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Egonex-AI/Understand-Anything, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Understand Diff Analysis next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Understand Diff Analysis compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Understand Diff Analysis this skillEgonex-AI/Understand-Anything85k1 repos~1.4kAutomated safety check: PassMIT
Knowledge Graph PR Reviewtirth8205/code-review-graph32k—~452Automated safety check: PassMIT
Open Code Review CLIalibaba/open-code-review44k—~3.1kAutomated safety check: PassApache-2.0
PR Review State Fetchprisma/orm48k—~767Automated safety check: PassApache-2.0
Review Triage Phaseprisma/orm48k—~995Automated safety check: PassApache-2.0
Code Reviewyaklang/yakit7.8k—~1.4kAutomated safety check: NotesAGPL-3.0

Similar skills

  • Knowledge Graph PR Review

    tirth8205/code-review-graph

    Reviews a pull request or branch diff with a code knowledge graph and produces a structured review that includes blast-radius analysis.

    32k GitHub stars~452 tokensUpdated today
    DevelopmentAuto-check passed
  • Open Code Review CLI

    alibaba/open-code-review

    Runs the ocr command-line tool to review Git changes, a commit or a branch comparison with an AI model, returning line-level comments and optionally applying fixes.

    44k GitHub stars~3.1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Official

    Fetches a pull request's canonical review state as JSON, validates it, and renders markdown, a text summary and triage target files from it using bundled scripts.

    48k GitHub stars~767 tokensUpdated today
    DevelopmentAuto-check passed
  • Official

    Runs the triage step of the review-framework loop: reads fetched PR review state, builds `review-actions.json`, validates it and renders `review-actions.md`.

    48k GitHub stars~995 tokensUpdated today
    DevelopmentAuto-check passed
  • Code Review

    yaklang/yakit

    对 Yakit 仓库的代码改动做规范化 code review:按代码逻辑、TS 定义、UI 引用与 Props、CSS 样式、依赖版本、配置项六个维度审查,检查测试用例缺失,强制执行 tsc 类型检查与 vitest 测试验证,输出「结果汇总 / 明细解释 / 合并结论」三块报告,经用户确认后写入文件。当用户要求 review、审查、评审代码改动,或在提交、合并、提 PR…

    7.8k GitHub stars~1.4k tokensUpdated 7 days ago
    DevelopmentAuto-check: notes
  • Greploop Apps

    michaelshimeles/skills

    Loops on a large pull request, merge request or Perforce changelist, fixing Greptile findings until it scores 5/5 with no unresolved comments.

    1.3k GitHub starsUsed in 1 repo~3.6k tokens
    DevelopmentAuto-check passed

More from Egonex-AI/Understand-Anything

  • Codebase Knowledge Graph Q&A

    Egonex-AI/Understand-Anything

    Answers questions about a codebase by searching a prebuilt knowledge graph of its files, functions, classes and dependencies, not by rereading every source file.

    85k GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Understand Explain

    Egonex-AI/Understand-Anything

    Gives an in-depth explanation of one file, function or module by reading the project's knowledge graph and checking that the graph is still fresh.

    85k GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Codebase Domain Flow Extractor

    Egonex-AI/Understand-Anything

    Extracts business domains, flows and process steps from a codebase and produces an interactive horizontal flow graph, reusing an existing knowledge graph when one exists.

    85k GitHub starsUsed in 1 repo~2.4k tokens
    Auto-check passed
  • Writes an onboarding guide for new team members from a project's existing knowledge graph, after checking that the graph still matches the current commit.

    85k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • LLM Wiki Knowledge Graph

    Egonex-AI/Understand-Anything

    Detects a Karpathy-pattern LLM wiki and builds an interactive knowledge graph with entities, implicit relationships and topic clusters.

    85k GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Figma Design Knowledge Graph

    Egonex-AI/Understand-Anything

    Scans a Figma file through the Figma REST API and builds an interactive knowledge graph of its pages, screens, components and tokens for the design dashboard.

    85k GitHub stars~1k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about Understand Diff Analysis

What does Understand Diff Analysis do?

Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky. understand-anything folder, and it tells you to run /understand first when the file is missing. The graph holds nodes for files, functions, classes, services, tables and more, plus edges such as imports, calls and depends_on, grouped into layers.

When should I use Understand Diff Analysis?

Understand Diff Analysis fits situations like: reviewing what a pull request touches before merging; checking which components depend on the files you just edited; assessing risk in uncommitted changes on a feature branch.

How do I install Understand Diff Analysis in Claude Code?

Run `npx skills add Egonex-AI/Understand-Anything --skill understand-diff -a claude-code`. Or copy the skill folder (understand-anything-plugin/skills/understand-diff in Egonex-AI/Understand-Anything) into .claude/skills/understand-diff in your project. Claude Code loads it when a task matches its description.

How do I install Understand Diff Analysis in Codex?

Run `npx skills add Egonex-AI/Understand-Anything --skill understand-diff -a codex`. Or copy the skill folder (understand-anything-plugin/skills/understand-diff in Egonex-AI/Understand-Anything) into .agents/skills/understand-diff in your project. Codex loads it when a task matches its description.

Can I use Understand Diff Analysis in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Egonex-AI/Understand-Anything --skill understand-diff -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/understand-diff, .gemini/skills/understand-diff, .github/skills/understand-diff and .opencode/skills/understand-diff in your project.

What does Understand Diff Analysis need to run?

Going by SKILL.md and its folder, Understand Diff Analysis needs the command-line tools its instructions call (git). Our summary lists: A knowledge graph built earlier with /understand; A git repository.

Does Understand Diff Analysis access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Understand Diff Analysis safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Understand Diff Analysis use?

Understand Diff Analysis is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Understand Diff Analysis use?

About 1.4k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Understand Diff Analysis?

Skills that share tags, products or a category with Understand Diff Analysis: Knowledge Graph PR Review (tirth8205/code-review-graph, 32k stars), Open Code Review CLI (alibaba/open-code-review, 44k stars), PR Review State Fetch (prisma/orm, 48k stars) and Review Triage Phase (prisma/orm, 48k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Understand Diff Analysis?

Egonex-AI (a GitHub organization) maintains it in Egonex-AI/Understand-Anything, which has 85,454 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on October 6, 2026.

Source: Egonex-AI/Understand-Anything on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.