Tell your Coding Assistant What you Expect
By Jon Chappell - jon@sage-tech.ai
The Problem
I asked Claude Code to add a health-check command to verify my app could access an LLM. Claude generated code that included a fallback response on failure – defeating the purpose of a health check.
We build health checks into software so that we have an easy way to detect when a service we are using is not available. Health checks save time and effort because they offer relatively simple service tests, compared to using more complex application interactions, which are more difficult to troubleshoot.
What I Asked
prompt> Add a
health-check
command line option toscandocs
, to check that scandocs can prompt Bedrock Claude.
What I Should Have Asked
prompt> Add a
health-check
command line option toscandocs
, to check that scandocs can prompt Bedrock Claude. The health check MUST verify by sending a prompt to Bedrock Claude and getting the response, resulting in either success or failure showing a meaningful error message.
This prompt adds specific expectations about success and failure. It could be further improved by stating expectations about AWS environment variables and .env file support, expected response structure and more. How much to specify depends on how deep a health-check I want.
Summary
Do not assume that your AI assistant knows your intent. Be explicit about your expectations.