Skip to content

Add CLAUDE.md self-correction + investigate-where-pointed rules - #2

Open
VideoGameTips wants to merge 2 commits into
mainfrom
docs/claude-md-self-correct
Open

Add CLAUDE.md self-correction + investigate-where-pointed rules#2
VideoGameTips wants to merge 2 commits into
mainfrom
docs/claude-md-self-correct

Conversation

@VideoGameTips

Copy link
Copy Markdown
Owner

Summary

Two new work-habit rules added to CLAUDE.md (no code/runtime changes):

  • Investigate where pointed first. When a bug report names a feature, system, button, or area (e.g. "mobile shooting", "the kill log", "bot AI"), grep/read that exact code path before exploring the rest of the codebase.
  • Self-log repeat mistakes. After making the same mistake 3+ times (wrong cwd, off-by-one parallel array, stale-build confusion, etc.), append a new entry to the "⚠️ Hard-won gotchas" section so it stops recurring.

Why

The gotchas list is the project's accumulated debugging memory. These rules make investigation faster (start at the named area) and keep the gotchas list self-feeding (log recurring errors automatically).

Note for reviewer

This session's actual code fixes — the 3v3→6v6 matchmaking cap, wall-climbing movement, the bot wall-clipping fix, and the mobile fire+aim fix — were already committed and pushed directly to main, so this PR contains only the CLAUDE.md doc changes.

🤖 Generated with Claude Code

…istakes

Two new work-habit rules:
- When a bug report names a feature/area, grep that exact code path first
  instead of exploring the whole codebase.
- After making the same mistake 3+ times, append it to the Hard-won gotchas
  section so it stops recurring.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
VideoGameTips added a commit that referenced this pull request Aug 22, 2026
Removed 22 weapons that were stat twins of something else in the same role,
keeping one of each family. ak20/ak30/an94/m4a1 were the clearest case: four
assault rifles at 22-25 dmg and 130-150 ms, which is one gun with four names.

How the families were chosen, because "similar" needs a definition: same slot
and same role (AR / SMG / Shotgun / Sniper / MG / Launcher / sidearm variants),
then complete-linkage clustering where EVERY pair in a family must be within 20%
DPS, 25% damage, 25% fire rate and 60% magazine. Complete linkage matters — a
first attempt with greedy chaining put minigun and solar_lance in the same
family as ak20, which is obviously wrong. The keeper is the cheapest member,
tie-broken by roster order, so the survivors are the familiar cheap ones.

Gone (-> survivor):
  ak30, an94, m4a1        -> ak20
  incendiary_shotgun      -> sg8
  thermal_lmg             -> rpd
  royal_minigun           -> minigun
  magnet_rifle            -> freeze_gun
  lazy_laser              -> painter_beam
  pulse_disc              -> glassmaker
  phase_driver            -> quantum_repeater
  rpg                     -> grenade_launcher
  coin_gun, traffic_cone, cream_pie -> snub_revolver
  phase_pistol, ion_revolver        -> revolver
  emp_pistol, shuriken              -> pistol
  pocket_rocket           -> throwing_axes
  blowgun                 -> boomerang
  mini_uzi                -> machine_pistol
  ppk                     -> m1911

Every reference was followed, not just the roster entry. WEAPONS and
weaponModels stay index-aligned (gotcha #2) — the models array is rebuilt from
the surviving order and now carries each entry's id as a trailing comment, so a
future mismatch is visible instead of silent. WEAPON_COSTS, BUNDLES and
WEAPON_DAMAGE cleaned on BOTH client and server (gotcha #4).

Live code paths that would otherwise have handed out a weapon that no longer
exists, all repointed at the survivor: a forcePlayerWeapon('cream_pie') event,
9 lobby bot loadouts, 8 "Best Loadouts" presets, and the SILENTAGENT unlock code
on the server. Dead sound-profile branches for removed guns deleted; blowgun
dropped out of DOUBLE_JUMP_IDS with it.

Safe for existing accounts: purchases are plain ids in u.purchased, and across
all 17 local accounts nobody owns anything on the drop list. A stale id there is
ignored rather than fatal.

Verified at runtime: 99 weapons / 99 models, aligned; every model non-empty and
still carrying _flash; and zero dangling ids across bundles, presets and bot
loadouts. The 12 weapons with no cost entry are the free admin guns — costless
before this change too.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant