Give Your AI Assistant Infrastructure Eyes Before It Writes Another Query
The article highlights a critical blind spot in AI coding assistants: they cannot see the infrastructure their generated code runs against. The author describes a scenario where Claude Code was asked to add pagination to an order history endpoint. It generated a function using DynamoDB Scan with a Limit parameter. While the code compiled and tests passed, the Scan operation read every item in the large Orders table regardless of the Limit parameter, which only controls how many results are returned. This resulted in a high consumption of read capacity units over a few days, causing an unexpected AWS bill. The assistant had no knowledge of the table size, the existing GSI on userId, or that other functions already used Query against that GSI. The article introduces infrawise, an npm package that aims to give AI assistants infrastructure context by reading cloud configurations and schemas before generating code.
AI assistants can generate costly infrastructure mistakes when they lack context about the production environment.