[Bug] Claude Code violates architectural and testing rules under task pressure; inlines SQL, skips HTTP/JWT tests, ignores migration init patterns
Bug Description
The user's CLAUDE.md and persistent memory state several rules as highest-priority. Claude violated
them during a 5-phase implementation task:
- Response style (flagged in CLAUDE.md as the highest-priority rule, with prior incidents in memory).
Claude wrote walls of text, multi-paragraph end-of-turn summaries, and unnecessary code blocks
throughout. The rule is "1–3 line summary, terse, one question max, details to a doc not pasted
inline."
- "Tests must verify the actual feature." Backend tests hit the DB layer directly; no test went
through the HTTP/JWT path. No browser walkthrough of Brownfield toggle / dismiss / search mode. Same
shape as the prior "32 passing tests, missed a missing field" incident already in memory.
- Service → repository layering. Four spots inlined SQL/SQLAlchemy where a repository method should
exist:
inline."
- "Tests must verify the actual feature." Backend tests hit the DB layer directly; no test went
through the HTTP/JWT path. No browser walkthrough of Brownfield toggle / dismiss / search mode. Same
shape as the prior "32 passing tests, missed a missing field" incident already in memory.
- Service → repository layering. Four spots inlined SQL/SQLAlchemy where a repository method should
exist:
- product_api.py /products/search endpoint built SELECT/JOIN inline.
- portfolio_section_service.py did select(Product) and update(Portfolio).values(build_type=...)
directly.
- portfolio_cascade_service.py did select(ProductType) directly.
Stated reason on self-audit: "the query felt simple, I was pushing through phases." Rationalization,
not principle.
- Docker init wiring gap. Added migration 025 and a new master-data loader; did not surface that EI
migrations have no automated init runner until the user asked. Memory rule: "always find and use
proper migration/seed/init scripts."
- Memory hygiene. Did not write a memory entry for the discovered fact that EI has no automated
migration runner — recurring pitfall.
Pattern across violations: task-size pressure overrode standing rules. Every violation was a "this
one's small enough to skip" rationalization. CLAUDE.md exists precisely to prevent that compounding.
Environment Info
- Platform: darwin
- Terminal: vscode
- Version: 2.1.165
- Feedback ID: 7304799e-6fbf-4439-8b31-9a271e7fa0e7
Errors
[]This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗