Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Sleeps, retries and longer timeouts as 'fixes' card 6 of 6

Remember

builds on: Patching the symptom instead of the cause, Race conditions and interleavings
A sleep, retry or longer timeout changes how often the race loses, not whether it can. Ask "what must happen before what, and what signals it?" and make the code wait on that signal. Retries belong around transient failures outside your control, such as a network blip. Timeouts are ceilings on how long to wait. Neither creates ordering.
Terms on this card
race
A bug where the result depends on which concurrent task happens to run first.
timeout
A maximum time to wait for something before giving up with an error.
Learn this step by step on Bytewise
Lesson goal: Recognise a race 'fixed' with a sleep, a flaky call wrapped in a retry loop, or a raised timeout. Explain why these pass locally and in CI but fail under load or on slower machines, and what a real ordering fix looks like. · the whole lesson