Middle · Go with coding agents

Claude Code: context and verification

How do you make Claude Code useful on an unfamiliar Go service?

Try explaining this aloud before opening the answer. State your assumptions and trace a boundary case.

Reveal a strong answer
  1. Begin with a focused exploration request: identify entry points, interfaces, context propagation and existing tests for the operation. Provide relevant paths and a symptom instead of an entire unrelated log dump.

  2. Use CLAUDE.md for durable repository commands and conventions, following the current documented discovery behavior. For a substantial change, separate understanding, plan, implementation and checks; a trivial edit does not need a ceremonial planning process.

  3. Give a verifiable outcome and inspect the results. Permissions, secrets and external service writes need real controls; an instruction document is not a sandbox. Keep context current and ask for a concise handoff when work is long.

Common trap

A large instruction file containing every historical decision can obscure the current constraints.

Try it

A Go worker leaks goroutines only when clients cancel. What should the agent inspect and prove?

Worked solution

Point to the worker/send loop and cancellation test, require a reproduction with a blocked receiver, identify every blocking point, implement a bounded exit/join protocol and run the focused race-enabled test. Review that it did not merely increase buffers or hide a timeout.

Change the constraint

Which observed test would distinguish a fixed leak from a test that simply exits before the leak is visible?

How did you do?

Self-assessment, not a compiler pass or interview score. Explain the reasoning unaided before marking understood.

Not marked. Progress stays on this browser, separate from course completion.

Primary references

Checked 2026-10-20. Use documentation for your pinned runtime, driver and tool version.