rex-hunk-diff

rex-hunk-diff is a skill for Claude Code, Codex from dimetron/pi-go. It costs 101 tokens per session (1,898 once invoked), scanned A, original, MIT.

A workflow for showing the current Git working-tree diff in a live terminal pane beside the coding agent. It uses rex to manage the terminal layout and hunk to draw the changing diff.

In plain words
What is it for?
It helps open the live diff, choose the correct rex session and pane, place it on the requested side, and confirm which branch and file changes are being shown.
Why use it?
It lets a developer inspect edits while work continues and avoids misplaced or duplicated panes by checking the session, worktree, branch, and split direction first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps open the live diff, choose the correct rex session and pane, place it on the requested side, and confirm which branch and file changes are being shown.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dimetron/pi-go/rex-hunk-diff
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.

Any agent
npx skills add dimetron/pi-go --skill rex-hunk-diff
Clone the repo
git clone --depth 1 https://github.com/dimetron/pi-go

Made for: Claude Code, Codex.

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 rex-hunk-diff

README.md
[![agentmods](https://agentmods.dev/badge/skills/dimetron/pi-go/rex-hunk-diff/github.svg)](https://agentmods.dev/skills/dimetron/pi-go/rex-hunk-diff)
Your own site
<a href="https://agentmods.dev/skills/dimetron/pi-go/rex-hunk-diff"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/rex-hunk-diff/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 rex-hunk-diff

Your own site · 80×15
<a href="https://agentmods.dev/skills/dimetron/pi-go/rex-hunk-diff"><img src="https://agentmods.dev/badge/skills/dimetron/pi-go/rex-hunk-diff.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 101 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,898 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.00101 $0.01898
Opus 5.5 $0.00040 $0.00759
Sonnet 5.5 $0.00020 $0.00380
Haiku 4.5 $0.00010 $0.00190

Measured 12d ago against content hash 8e2605607a26, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

rex-hunk-diff 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 12d 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.

internal/extension/bundled_skills/rex-hunk-diff/SKILL.md · 148 lines

How it starts

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

Live diff beside the agent

Two CLIs, one job: rex splits the terminal and owns the layout, hunk draws the diff inside a block. Neither calls the other.

The failure mode this skill exists to prevent: splitting with the default direction and then discovering the diff landed on the side you did not want, or re-running the whole sequence and ending up with duplicate panes. Placement is two commands — split, then move — and move is what makes the direction reliable.

1. Confirm both tools and the location

rex whoami --json | jq -r '.rex_version'    # also proves the server is up
echo "REX_SESSION=$REX_SESSION REX_BLOCK=$REX_BLOCK"
hunk --version

REX_SESSION and REX_BLOCK are set by rex in the terminal it opened. They identify your session and pane — pass them as -s and -b. If REX_SESSION is empty, run rex whoami --json then rex ls --json and ask the user which session to use; do not guess between sessions.

2. Know what hunk will be looking at

Run from the tree under review — a worktree, not the primary checkout:

cd <worktree>
hunk status --json | jq -r '.head.name, .paths[] | .path'   # sanity: right branch
git --no-pager diff --stat

A hunk status that shows no paths means the diff is empty and the pane will open on nothing. Say so instead of opening it.

3. Split, then move into place

Open the pane, then place it. Do not try to get the direction right in the first command:

# 1. Open hunk in a new pane beside $REX_BLOCK (block id captured for later).
created=$(rex split -s "$REX_SESSION" -b "$REX_BLOCK" --ratio 50 \
  --label "hunk diff" -c "$PWD" --keep-open --focus=false --json -- hunk diff) || exit
hunk_block=$(printf '%s' "$created" | jq -er '.block_ids[0]') || exit

# 2. Place it. DIRECTION is relative to the anchor: right|left|above|below.
rex move -s "$REX_SESSION" "$hunk_block" right "$REX_BLOCK" --ratio 50

Why the second command earns its place: rex split --split=left is relative to the anchor block's position in its window, so the result depends on where that block already sits, and a re-split can nest the new pane inside the old split rather than beside it. rex move BLOCK DIRECTION ANCHOR states the final relationship directly, which is the thing the user actually asked for.

Read the full file on GitHub · 148 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. 12d ago First seen · 148 lines · 101 tokens per session scan A 8e2605607a26

Subscribe to this mod's changes

rex-hunk-diff is a skill published in the GitHub repository dimetron/pi-go (232 stars, last pushed 6d ago), licensed MIT. It adds 101 tokens to every session and 1,898 once invoked, about $0.0004 per session on Opus 5.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-11-18.

Related

rex-hunk-diff compared with skills from other repositories

rex-hunk-diff next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
rex-hunk-diffdimetron/pi-goSkill2326d agoMITA101Claude Code, Codex
autofix-prQwenLM/qwen-codeSkill31ktodayApache-2.0A142Claude Code
babysit-propeninterpreter/openinterpreterSkill69kyesterdayApache-2.0A114Codex
gh-find-prsHmbown/CodeWhaleSkill41kyesterdayMITA27Claude Code, Codex
triageQwenLM/qwen-codeSkill31ktodayApache-2.0B50Claude Code
githubHmbown/CodewhaleSkill41k1mo agoMITA0Claude Code, Codex
code-reviewpatriceckhart/zotSkill372todayMITA15Claude Code