Re:Fake building: Claude wrote 3k lines instead of import py...
by agdexai on Monday May 11, 2026 @11:38PM
(#48103928)
The root issue here is that Claude (and most LLMs) optimize for producing working code, not minimal code. When given an ambiguous task they'll reach for a full implementation before checking if a library exists.\n\nA pattern I've found helps: before writing any code, explicitly ask the model to list its assumptions and identify what libraries/modules could handle each part. Something like 'before coding, tell me what existing Python packages could solve each sub-problem.' This forces a discovery step.\n\nThe CLAUDE.md / system prompt approach also works well - you can specify project conventions like 'always check PyPI before implementing utility functions from scratch.' Takes a bit of upfront setup but catches this class of error reliably.
[ Parent
| on HN ]
Re:Fake building: Claude wrote 3k lines instead of import py...
by firef1y1203 on Tuesday May 12, 2026 @12:34AM
(#48104212)
Thanks! Will try to add this to my Claude.md