d2r-build

d2r-build is a command for Claude Code from crabsmadethis/d2r-horadric-tools. It costs 16 tokens per session (607 once invoked), scanned A, original, MIT.

A command for safely building Diablo II: Resurrected character saves. Diablo II: Resurrected is a video game, and a character save stores a character's equipment and progress.

In plain words
What is it for?
It helps create or update a D2R character, check save integrity, verify checksums, and detect inconsistent item data before deployment.
Why use it?
It reduces the risk of damaging a save by making a backup, building the character, scanning the result, and stopping when checks find a serious problem.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the d2r plugin — 2 skills, 4 commands shipped together

Good fit It helps create or update a D2R character, check save integrity, verify checksums, and detect inconsistent item data before deployment.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/crabsmadethis/d2r-horadric-tools/d2r-build
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/crabsmadethis/d2r-horadric-tools

Made for: Claude Code.

Or install d2r, the plugin that ships this one along with the rest of its 2 skills, 4 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 d2r-build

README.md
[![agentmods](https://agentmods.dev/badge/commands/crabsmadethis/d2r-horadric-tools/d2r-build/github.svg)](https://agentmods.dev/commands/crabsmadethis/d2r-horadric-tools/d2r-build)
Your own site
<a href="https://agentmods.dev/commands/crabsmadethis/d2r-horadric-tools/d2r-build"><img src="https://agentmods.dev/badge/commands/crabsmadethis/d2r-horadric-tools/d2r-build/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 d2r-build

Your own site · 80×15
<a href="https://agentmods.dev/commands/crabsmadethis/d2r-horadric-tools/d2r-build"><img src="https://agentmods.dev/badge/commands/crabsmadethis/d2r-horadric-tools/d2r-build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 607 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.00016 $0.00607
Opus 5 $0.00008 $0.00303
Sonnet 5 $0.00003 $0.00121
Haiku 4.5 $0.00002 $0.00061

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

Security

Grade A, and why

d2r-build 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.

plugin/commands/d2r-build.md · 78 lines

What it actually says

D2R Safe Build

Build character $ARGUMENTS using the chargen with full safety workflow.

Mandatory Steps

Execute these in order. Do NOT skip or combine steps.

1. Backup existing save

CHAR_NAME="$ARGUMENTS"
# Strip --phase flag if present for backup
CHAR_NAME=$(echo "$CHAR_NAME" | sed 's/ *--phase [0-9]*//')
SAVE_DIR="${D2R_SAVES:-$(python3 - <<'PY'
from d2r_chargen.config import SAVES
print(SAVES)
PY
)}"
D2S="$SAVE_DIR/${CHAR_NAME}.d2s"
if [ -f "$D2S" ]; then
    cp "$D2S" "${D2S}.pre_build_bak"
    echo "Backed up to ${D2S}.pre_build_bak"
else
    echo "No existing save for ${CHAR_NAME} — fresh build"
fi

2. Run chargen build

python3 -m d2r_chargen build $ARGUMENTS

If the build fails, stop and diagnose. Do NOT proceed to scanning.

3. Run d2rdoctor scanner

python3 << 'PYEOF'
import sys
sys.path.insert(0, '<parent-of-d2r-tools>')
from d2r_scanner import run_scanner
run_scanner('$ARGUMENTS'.split()[0].lower())
PYEOF

4. Check scanner output

  • Any hard error (returns False)? → Do NOT deploy. Fix the issue first.
  • Checksum MISMATCH? → Recalculate before writing.
  • LF INCONSISTENT? → Remove merc items or fix lf_count.
  • Encoding issues? → Rebuild with corrected build_item().

Only proceed if scanner reports clean.

5. Verify and report

Tell the user:

  • Build status (success/fail)
  • Scanner results (clean/warnings/errors)
  • Remind them: D2R caches saves at startup. Fully exit and relaunch D2R to see changes (Rule 7).

Rules Enforced

  • Rule 3: Always backup before writing .d2s
  • Rule 4: Always run d2rdoctor after every edit
  • Rule 5: Always verify checksums
  • Rule 10: Write to temp, verify, then overwrite (chargen handles this)
  • Rule 12: Edit incrementally, test after each change
  • Rule 17: Scanner hard errors are deployment blockers
  • Rule 19: Investigate every remaining scanner error before closing
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 · 78 lines · 16 tokens per session scan A 57eff8a01985

Subscribe to this mod's changes

d2r-build is a command published in the GitHub repository crabsmadethis/d2r-horadric-tools (4 stars, last pushed 1mo ago), licensed MIT. It adds 16 tokens to every session and 607 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-31.