Sharing a lesson learnt building in Claude Code. I had to explicitly tell Claude Code something I thought was obvious.

“Never use hardcoded data values. All data must come from query results, or computed from query results.”

Here’s why this is important.

1. LLMs are trained to produce output that “looks right”, not “is right” necessarily. When Claude Code generates a UI, its training signal is “does this look right?” and hardcoded values for the most part look right. It has been trained on millions of code examples with placeholders/static data, so it knows to reproduce those patterns very well. This is sophisticated auto-complete :-)

2. LLMs can resolve ambiguity silently. When Claude Code is uncertain where data should come from, it fills the gap with a hardcoded value. The ambiguity is not surfaced.

3. There is no runtime feedback loop. There is no mechanism that tells it “this number is not real”, so there is no correction mechanism. It is up to the experienced eyes to know that something “doesn’t make sense”.

The fix is to front-load the constraint rather than correcting it mid-session like I’ve had to do. Put in the project instructions upfront, something like:

"Never use hardcoded data values. All data must come from query results, or computed from query results."

AI builds fast and the output looks convincing, which makes it easy to move on without checking whether the data is real. That’s on us, not on AI. Speed of building cannot become the speed of judgement.

What do you think? Share your thoughts on this post on LinkedIn.