pisan-labs

Heap Arena Replay — Development skill for Claude Code

Development community

Replay a malloc/free trace on a word-accurate simulated heap with headers, footers and free-list pointers.

How to install Heap Arena Replay

This entry records only its repository, not the path inside it, so there is no exact command to give. Open pisan-labs/heap-arena-replay and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Heap Arena Replay does

Replay a malloc/free trace on a word-accurate simulated heap with headers, footers and free-list pointers. Compare first, next, best and worst fit on implicit, explicit and segregated lists, and generate quizzes. Built with Claude Code.

Alternatives in Development

  • Clean Worktree (Interactive) — Interactive cleanup of worktrees: lists merged/stale branches and asks confirmation before deleting 25.5k ★
  • Semble — Fast and Accurate Code Search for Agents 6.1k ★
  • Blueprints — Use when you need orientation on active work 60 ★

README

Heap Arena Replay

**A malloc you can watch.** Heap Arena Replay takes an allocation trace (`a 0 24`, `f 0`, `r 1 48`, or `p0 = malloc(24)`) and replays it on a word-accurate simulated heap in the style of the CS:APP allocator: header and footer boundary tags, a prologue block, an epilogue header, alignment padding, and for explicit and segregated free lists the pred and succ pointers stored in the first two payload words of every free block. Each step draws the whole heap as a strip of words, explains in a sentence what the allocator did and why, and keeps utilization, fragmentation and search cost over time. The same trace can be replayed under first-fit, next-fit, best-fit and worst-fit on an implicit list, an explicit list or segregated size classes, with immediate, deferred or no coalescing, and the policy can be switched partway through without disturbing the blocks already placed. A quiz generator reads its answers off the simulator, exports Markdown or a Canvas QTI package, and a diff mode finds the first op where a student allocator's addresses leave the reference. Everything runs in the browser.

Live: [heap-arena-replay.hintwise.org](https://heap-arena-replay.hintwise.org)

![Pressing Play on the textbook walk-through replays its mallocs and frees on a 256-byte heap, with block outlines, the allocator's narration and the utilization tiles updating at each op](demo.gif)

Implements idea #2 ("Heap Arena Replay") from the [2026-10-06 ideas day](https://github.com/pisanuw/daily-project-ideas) of `pisanuw/daily-project-ideas`.

The Replay tab on the external-fragmentation preset: a 384-byte heap strip with five 32-byte holes linked by free-list arcs, the narration explaining why malloc(60) returns NULL after examining six blocks, metric tiles, and the utilization and fragmentation chart

What it does

  • Replay tab. Pick a preset (textbook walk-through, the four coalescing cases, first-fit vs best-fit, the