Token refund request: repeated poker rule violations in Claude Sonnet 4.6 implementation session
Session Summary
User: alphaxe@gmail.com
Model: claude-sonnet-4-6
Date: 2026-05-05 ~ 2026-05-06
Branch: wip/T-V06-pd-baseline-9max-schema / dev
Project: coldread (poker exploitation trainer)
Complaint
Claude implemented core poker game engine features in a 9-player Texas Hold'em simulator across multiple sessions. Despite having poker rules written in CLAUDE.md and project wiki, Claude repeatedly produced wrong implementations based on imagination rather than verifying rules, requiring multiple correction rounds and wasting user tokens.
Specific Rule Violations (in chronological order)
1. Postflop hero action skip
- Bug:
allCalledOrFolded()atcurrentBet=0always returned true (0 >= 0), silently skipping hero's postflop action - Root cause: Did not verify the math before claiming the implementation was correct
2. All-in run-out: all cards dealt instantly (not staged)
- Rule: When all players are all-in, cards must be dealt one street at a time with pauses (flop → pause → turn → pause → river → pause → showdown)
- Bug: All remaining community cards were dealt instantly in a single pass (
while (s.community.length < 5) s.community = [...s.community, s.deck.pop()!]) - Fix required: New
runoutflag +advanceRunout()function + GamePage useEffect with 1.5s cadence (dev.164)
3. All-in run-out: opponent cards not revealed
- Rule: When all players are all-in, ALL remaining players must show their hole cards BEFORE the board is run out
- Bug:
buildRevealedCards()only revealed cards atphase === 'hand_result', so during runout phases (flop/turn/river) opponent cards remained hidden - Fix: One-line change to also reveal when
state.runout === true(dev.165) - Note: This was a separate commit that should have been included with dev.164's runout implementation
4. Uncalled bet: wrong placement and logic
- Rule: When a caller goes all-in for less than the current bet and no other player can match the excess, the uncalled portion is returned to the original bettor
- First attempt (dev.164): Added uncalled bet return in
case 'call', but with aotherCanCallcheck that testedstatus === 'active'— this failed whenever other players hadn't acted yet (they might fold later) - Correct fix (dev.166): Removed the hack; handled implicitly by the side pot algorithm
5. Side pots: completely missing
- Rule: In multi-player all-in scenarios with different stack sizes, each player can only win up to their contribution multiplied by number of callers. Side pots are created for excess chips.
- Bug:
doShowdown()simply divideds.pot / splitCountamong winners — a player with 100BB could win from a player with 300BB all of their 300BB contribution - User observed: "我只有100bb 對方有 300bb allin我贏了 贏下300bb" (won 300BB with only 100BB stack)
- Fix (dev.166): Added
totalBet: numberto Player tracking cumulative contributions across all streets; rewrotedoShowdown()with proper side pot algorithm (iterate caps ascending, distribute each pot slice only to eligible players)
Token Impact
Each violation required:
- Identifying root cause (1-2 turns)
- Discussing/approving fix (1-2 turns)
- Implementing, building, committing, deploying (1-2 turns)
- Verifying (1 turn)
Minimum 4-6 turns per violation × 5 violations = 20-30 unnecessary turns. Given Claude Code token costs, this represents significant wasted spend on a paying user.
Root Cause Analysis
The pattern across all violations: Claude implemented features by reasoning from first principles or "what seems right" rather than:
- Looking up the specific poker rule before writing code
- Tracing through concrete numerical examples to verify correctness
- Checking if existing code already handled the case
This is despite the user having written explicit rules in CLAUDE.md about "照規則做" (follow the rules) and the project context making poker rule compliance critical.
Request
Token refund for the wasted turns due to repeated rule violations that should not have occurred given the project context.
---
Filed automatically by Claude Code on behalf of user alphaxe@gmail.com
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗