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 3 of 6

Tells, and the question that settles it

builds on: Patching the symptom instead of the cause, Race conditions and interleavings
**Tells** in a fix for an intermittent failure: - a new sleep (`time.sleep`, `Thread.sleep`, `time.Sleep`, `setTimeout`) between starting work and using its result - a retry loop around a failure caused inside your own code - a raised timeout with no reason the work got slower - "passed 50/50 runs" as the evidence **Settle it:** name what must happen before what, then wait on that event: join, channel, future, latch.
Terms on this card
timeout
A maximum time to wait for something before giving up with an error.
retry loop
Code that repeats a failed operation a few times, often with a delay, hoping a later attempt succeeds.
thread
An independent path of execution inside a program that runs concurrently with others.
join
Blocking until a thread has finished, e.g. Python's `t.join()` or Java's `Thread.join()`.
channel
A Go (or Rust) pipe between concurrent tasks; sending, receiving or closing it also orders their steps.
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