CORE//DUMP

// session transcript · Claude Code

How CoreDump was built

Every prompt, every decision and every screenshot from a single Claude Code session: from a pasted spec to a deployed game with a global leaderboard on coredump.rgztechservices.com.

23prompts
12phases
~7.8klines of code
23JS modules
42tests passing
0dependencies
▶ PLAY COREDUMP
CoreDump mid-game: a four-line CORE DUMP clear bursting into particles, HOT ×1.25 bonus, Overclock ready
A CORE DUMP (4-line clear) while running HOT: particles, shockwave and the ×1.25 bonus.
0x00

The brief

USER · pasted spec

A full spec for a "production-grade, guideline-compliant Tetris engine": 10×20 matrix with 20 hidden rows, ghost piece, 7-bag, hold and next queue, SRS rotation with wall kicks, DAS/ARR/SDF, lock delay with 15 resets, T-spin detection, back-to-back, combos, perfect clears, Marathon / Sprint / Ultra / 20G / Dig modes, remapping, juice, audio and PPS/KPP/APM stats.

Show the full prompt
You are an expert full-stack game developer and systems architect building a feature-complete, modern web-based Tetris game from scratch. Your goal is to implement a production-grade, highly polished, guideline-compliant Tetris engine with zero input lag, smooth rendering, and deep customization.

Please build or implement the architecture based on the comprehensive feature specification outlined below.

## 1. Core Engine & Board Mechanics
- Standard Playfield: 10 columns wide by 20 visible rows high, supplemented by 20 hidden buffer rows above the ceiling for piece spawning and rotation maneuvers.
- Ghost Piece (Shadow Drop): A real-time, semi-transparent projection at the bottom of the matrix showing exact landing coordinates.
- 7-Bag Randomizer: Strict 7-piece bag shuffler ensuring all standard tetrominoes (O, I, T, L, J, S, Z) appear in every cycle, preventing piece starvation.
- Hold Queue & Next Queue: Fully functional hold box allowing one-piece storage/swapping, alongside a customizable Next Queue preview showing the upcoming 1 to 6 pieces.
- Garbage Line Support: Logic for clean garbage (aligned vertical holes) and messy garbage (randomized holes) for hazard modes.

## 2. Movement, Input Handling & Rotation (SRS)
- Super Rotation System (SRS): Full rotation rulebook supporting clockwise, counter-clockwise, and 180° rotations, complete with standard wall-kick and floor-kick lookup tables for all pieces.
- Advanced Handling (DAS / ARR / SDF): Delayed Auto-Shift, Auto-Repeat Rate, Soft Drop Factor.
- Hard Drop & Soft Drop: Dedicated bindings for instant drop-and-lock vs. rapid manual descent.
- Extended Lock Delay: A 0.5-second lock-in window that resets on movement or rotation (capped at a maximum of 15 resets to prevent infinite stalling).

## 3. Scoring, Offense & Detection Systems
- Line Clears, T-Spin Detection (3-corner check), Back-to-Back, Combo Counter, Perfect Clear.

## 4. Game Modes
- Marathon, Sprint (40 Lines), Ultra (Time Attack), Master Mode (20G Survival), Dig / Cheese Race.

## 5. UI, Juice & Statistics
- Custom Keybinding System, Visual Polish (screen shake, particles, tweens), Audio Integration, Real-Time Stats Tracker (PPS, KPP, APM, T-Spins).

## Execution Instructions
Start by establishing the core canvas/DOM rendering loop, the 10x20 matrix state array, and the input/SRS framework. Implement the game step-by-step with clean, modular, well-commented code.
CLAUDE

Declined to build it as written: a guideline-compliant engine with the official SRS kick tables and the named Marathon / Sprint / Ultra modes is a recreation of one specific existing game. Instead it offered an original falling-block game with the same depth: its own rotation system, its own names, an original look and sound, and one or two signature mechanics.

USER
Yes, absolutely go ahead with that!
Theme & Name: Let's call it CoreDump (or CircuitStack). The aesthetic should be a sleek, dark-mode terminal/cyberpunk interface with neon neon-blue and amber status readouts, glowing grid lines, and subtle CRT scanline effects. Pieces can look like stylized circuit blocks or data packets.
Signature Mechanics:

1. Overclock Meter: Clearing lines charges an "Overclock" energy gauge. When activated, it slows down gravity temporarily and converts cleared lines into "Data Purges" that clear surrounding garbage or boost score multipliers.
2. Thermal Throttle (Risk/Reward): The faster you drop and clear pieces, the higher your "Heat" level rises. If your heat maxes out, your input handling stutters briefly, forcing you to balance speed with careful cooldown placement.

Let's build it as modular plain HTML/CSS/JS files so it's instantly runnable. Let's start with the core engine and grid matrix module!
0x01

Core engine & matrix

14 tests
CLAUDE
  • Matrix: 40×10 grid (20 hidden buffer rows), collision, line clears, clean and messy garbage.
  • Data packets + Vector Kick: the seven shapes with an original kick table (in place → lateral → downward tuck → upward climb → wide reach).
  • Engine: seeded 7-bag, gravity curve up to 20G, 500 ms lock delay capped at 15 resets, hold, 1–6 queue, event bus for later systems.
  • CoreDump vocabulary: BIT / BYTE / WORD / CORE DUMP for 1–4 lines, EXPLOIT spins, SYNC ×1.5 back-to-back, CHAIN combos, SYSTEM WIPE board clears.
  • Input with DAS/ARR/SDF acting on keydown (no frame wait), circuit-chip block sprites, smooth piece tweening.
  • Classic <script> files on a shared namespace so it runs from file://, and loads headless in Node for tests.

First browser check came out unstyled: the preview pane serves file:// pages as static snapshots. A tiny local Node server fixed the preview.

0x02

Overclock & Thermal Throttle

20 tests
USER

Yes, build the Overclock meter and Thermal Throttle heat system next.

CLAUDE
  • Overclock: clears charge a meter; at 50%+ press Q to engage. Gravity drops to 0.35× and every clear becomes a Data Purge that deletes one garbage row per line, or doubles the score when there's no garbage.
  • Thermal Throttle: fast locks, hard drops and clears add heat; letting a packet lock on its own vents it. At 70+ you're HOT (×1.25 score, faster charging). At 100 the core throttles: inputs lag 110 ms and auto-repeat slows 3× for 2 s.
  • Gauges, callouts, an amber scan sweep while overclocked and a red glitch/tear effect while throttled.
0x03

Game modes

26 tests
USER

Yes, build the game modes next: endurance, line sprint, timed score attack, 20G survival, and garbage dig race, with a mode select screen.

CLAUDE
ModeGoalRecord
ENDURANCESurvive; gravity climbs every 10 linesScore
LINE SPRINT40 linesFastest time
SCORE ATTACK2:00 on the clockScore
20G SURVIVAL200 lines; lock delay shrinks 400 → 180 msLines
DIG RACEClear 10 rows of messy garbageFastest time

Mode select, live goal readout, results screen with 12 stats and per-mode personal bests. Overclock purges count toward Dig Race.

0x04

Juice & audio

USER

Yes, build the juice and audio next: particles, screen shake, synthesized SFX and intensity-scaling music.

CLAUDE
  • FX layer drawn past the board edges: rows shatter into coloured data bits, hard-drop light streaks, shockwave rings and trauma-based screen shake (off under reduced-motion).
  • Synthesized SFX with Web Audio, no sample files: every move, lock, clear, exploit, purge, overheat alarm, win and loss.
  • Adaptive music: an original 16-step track in A minor. Layers (hats → snare → arp → lead) and tempo (96 → 140 BPM) follow speed, stack height and heat. Overclock muffles it and slows it to 0.75×; Thermal Throttle chops it into stutters.
0x05

Settings, remapping & gamepad

28 tests
USER

Yes, build the settings screen next: key remapping, gamepad support, DAS/ARR/SDF and queue-length sliders, and volume controls.

CLAUDE
  • SYSTEM CONFIG (O): DAS, ARR, SDF (up to ∞), queue 1–6, master/SFX/music volume, screen-shake toggle.
  • Two keyboard and two gamepad slots for each of 13 actions; a binding moves rather than duplicates; Enter stays reserved.
  • Gamepad on the standard mapping, with the left stick as a D-pad. It goes through the same input pipeline, so DAS and throttle apply equally.
  • Footer key hints follow your bindings. Everything persists.
0x06

Global leaderboard

Firebase
USER

Leaderboard?

CLAUDE

Asked which kind: local top 10, online via Firebase, or a shared artifact.

USER · picked

Online via Firebase

The setup saga, in order

USER

Tool loaded.

→Not signed in to Firebase; started a login link.
USER

Do I need to do all firebase login --no-localhost of that

→No: npx firebase-tools login opens the browser and finishes on its own.
USER

logged in

→That account had no projects. Chose to create one; Firebase refused with 403, most likely a managed-account restriction.
USER

Let's switch to a different Google account for Firebase.

USER

Logged in

→Still 403 creating a project from the tools. Suggested creating it in the Firebase console.
USER

I created the project in the Firebase console. Continue the setup.

→The new project wasn't visible on that account. Asked for its ID.
USER

The project ID is:

USER

[an existing project ID]

!That was an existing project with a live app and database. Deploying leaderboard rules there would replace its rules, so Claude left it untouched.
USER

Use this
Packtracks-f2e0c

→Checked first: no apps, no data, rules deny everything. Safe. Registered the web app and wrote validated rules. The rules deploy was blocked by Claude's permission check, so the user ran it.
CLAUDE · what shipped (later replaced: see 0x0B)
  • Leaderboard over Firestore's REST API: no SDK, about 150 lines.
  • Security rules: anyone can read and add; nothing can be edited or deleted; names [A-Z0-9 _-]{1,12}; ranked value must match the mode; plausibility floors (e.g. sprint ≥ 8 s).
  • Results screen offers a handle entry when a run makes the top 10; GLOBAL BOARDS in the menu.
USER

I ran the deploy. Verify the leaderboard end to end.

CLAUDE
✓ reads for all 5 modes ✓ unknown modes and other paths denied ✓ 12 / 12 bad scores rejected ✓ real upload from the game UI ✓ public edit / delete blocked ✓ test data cleaned up
0x07

The AI plays its own game

#1 on every board
USER

Alright as AI I want you to see what the best possible score you can get is and count it for the leaderboard

CLAUDE

Wrote tools/bot.js: a headless player that runs the real engine with every system live, sending each action through the input module so Thermal Throttle's input lag applies to it too. Limits: one input per frame and at most 3 pieces/second, a top-human pace. Placement uses a published board-evaluation heuristic plus hold. Best of 5 attempts per mode:

ModePosted as CLAUDE-AIRun
ENDURANCE580,674level 20, 212 lines
LINE SPRINT0:37.702.68 PPS
SCORE ATTACK265,126129 lines in 2:00
20G SURVIVAL200 linescleared the mode
DIG RACE0:06.90a 3.95 s run hit the 4 s floor and was rejected

Balance finding: holding back to stay HOT scored 68k in Score Attack; playing flat out and eating 25 throttles scored 265k. The throttle is too mild to deter speed. Bug found: goal modes could overshoot (201/200 lines) and be rejected; uploads now count lines up to the goal.

0x08

Deploy to Cloudflare

live
USER

Can we deploy this to cloudflare as a subdomain to my domain

CLAUDE

Found rgztechservices.com on the Cloudflare account, confirmed two candidate subdomains were unused, and asked which to use.

USER · picked

coredump.rgztechservices.com

CLAUDE
  • Static-assets Worker with a custom domain. A build step copies only the game into dist/, so tooling, tests and config can never be published by accident.
  • Security headers via _headers.
  • Verified: HTTPS 200, private files 404, leaderboard loads on the live domain.
0x09

Fit to window

USER · with screenshot

It does not fully fit

User's screenshot: the layout with a scrollbar
The user's screenshot: a fixed-size layout with a scrollbar.
CLAUDE

The layout was a fixed ~720×750 px. It now zooms to fill the window (0.5×–1.6×) and recalculates on resize; canvases render with extra resolution so they stay sharp when scaled up. Checked at 1892×889 (1.19×) and 1280×620 (0.82×) with no scrolling, then redeployed.

0x0A

This page

USER

Now I want a tab on it to show all prompts and everything you did include like screenshots and make it all look nice

CLAUDE

Added the GAME / BUILD LOG tabs and this page, built from the session itself: every prompt verbatim, a summary of each phase, and 18 screenshots taken along the way (click any to enlarge). Account emails, account IDs and unrelated project names are left out.

0x0B

v0.2: everything else

42 tests
USER

What else can we add to this

CLAUDE

Proposed touch controls, versus against CLAUDE-AI, replays with a cheat-proof leaderboard, a tougher Thermal Throttle, a daily challenge, an exploit trainer, achievements, live 1v1, player profiles, an installable app, share cards and a stats page.

USER

Add all those features

CLAUDE

Asked where the leaderboard should live, since verification, profiles and live matches all need server code.

USER · picked

Move to Cloudflare

CLAUDE · the foundation: every run is a replay
  • The game now advances in fixed 60 Hz steps, and every input is recorded with the step it landed on. Mode + seed + handling + inputs fully describe a run: a sprint is about 3 KB.
  • Fixed a subtle bug first: the queue preview and garbage holes drew from one random-number stream, so how often the screen redrew could change the game. They're separate now.
  • The browser, the AI and the server all run the same simulation file, so a replay re-simulates identically anywhere. Tests prove it for every mode.
CLAUDE · Cloudflare backend (Firebase retired)
  • One Worker on the same subdomain. A SQLite Durable Object stores the boards and re-plays every submitted run before accepting it. The score it records is the one it computed, so faking a score means actually playing it.
  • Also serves daily boards, replays, player profiles and stats. A second Durable Object per room relays live 1v1 matches over WebSockets.
  • CLAUDE-AI re-posted all its runs through the new verifier.
✓ browser run verified at rank #1 ✓ empty / tampered replays rejected ✓ replays play back frame-exact ✓ 1v1 across two tabs: board, garbage, win/loss
CLAUDE · Thermal Throttle, rebalanced with the bot
TuningScore Attack: flat outScore Attack: heat-managed
Before183,64539,685
+ garbage on overheat240,28939,685
Shipped: decay 12/s, 900 ms stall, HOT ×1.5148,738155,012

Garbage made spamming more profitable (more lines to clear), so the shipped fix makes overheating cost time instead. Careful play now wins Score Attack; speed still wins Sprint, but each meltdown costs about 6 s.

CLAUDE · new to play
  • VERSUS vs CLAUDE-AI at four levels, whose bot builds for multi-line attacks, or online 1v1 with a 4-letter room code. Clears send garbage; an incoming-garbage meter shows what's coming.
  • DAILY CHALLENGE: the same pieces for everyone each UTC day, with its own board.
  • EXPLOIT TRAINER: 6 hand-built puzzles. A solver in the test suite searches every reachable placement to prove each one is solvable.
  • 20 ACHIEVEMENTS with toasts, replays (▶ on any board entry, 1/2/4× speed), share cards (1200×630 PNG, "BEAT CLAUDE-AI" when you do).
  • Phones: touch buttons plus gestures (drag to move, tap to rotate, flick down to drop, flick up to hold), and a layout that fits the screen. Installable as an app and playable offline.
  • STATS tab: board leaders, runs by mode, recent verified records and per-player profiles.

Under the hood

RuntimePlain HTML, CSS and JS. No build tools, no frameworks, no npm packages.
RenderingCanvas 2D: cached chip sprites, an overdrawn FX layer, a CSS CRT treatment.
AudioWeb Audio synthesis: oscillators, filtered noise, a look-ahead sequencer.
DataSQLite Durable Object that re-plays every submitted run before ranking it.
HostingCloudflare Worker + static assets on a custom subdomain; WebSocket rooms for 1v1; offline-capable PWA.
Tests42 headless tests: engine, replay determinism, puzzle solvability; plus an AI player.

Built with Claude Code · play CoreDump →