Craft of code
Working effectively with AI coding tools
Use autocomplete, chat, and coding agents to go faster without shipping code you do not understand — context, verify loops, and protecting your skill growth.
AI coding tools are leverage, not a substitute for engineering judgment. Used well, they compress boilerplate, exploration, and first drafts. Used poorly, they ship plausible bugs, hollow out your skills, and create PRs nobody can debug at 2am.
The rule that keeps you safe: you own every line that merges, the same as if a junior teammate wrote it. Review AI output with the rigor of code review. If you cannot explain it, you cannot ship it.
Concepts in this section
| Step | Concept | What it answers |
|---|---|---|
| 1 | AI coding modes | Autocomplete, chat, or agent — and when to slow down? |
| 2 | Agent verify loops | What pass/fail signal makes the loop honest? |
| 3 | Prompting AI tools | What constraints do you load? |
| 4 | Reviewing AI-generated code | What characteristic failures do you hunt? |
| 5 | Learning with AI tools | How do you get faster without hollowing out skill? |
High leverage lives on boilerplate, exploration, and mechanical migrations. Security, money, concurrency, and first-time learning stay human-mandatory. For deeper agent architecture, see coding agents.
A workflow that holds up: state the invariants in one paragraph, write or generate a failing test, let the agent work against pnpm test or go test, then review as if a new hire wrote the diff. Reset the session when it starts ignoring files or looping. Parallel agents only help when they sit on isolated branches and you still review the merge as one change.
Agree team policy before the first paste: which vendors are approved, what may leave the laptop, whether PRs should disclose generated code, and who still owns review. AI review bots do not replace that ownership. Pasting production secrets, customer PII, or unreleased security details into a public model is an incident. Use enterprise tiers with data controls when the company provides them, and scrub fixtures.
SDE2 expectation is faster delivery with equal or better quality. "Used Copilot" is noise in a packet. "Cut migration time with an agent and test guardrails while owning the cutover" is signal. Interviewers will ask how you use the tools. Bring a failure story where you caught a bad suggestion, and keep coding interview practice off autocomplete.
Common mistakes
- Shipping code you cannot explain.
- No verify loop — the model said it works.
- Pasting secrets or customer PII into a public model.
- Letting the tool write every first version, then failing interviews and incidents.
- Parallel agents on the same files.
Key takeaways
- You own every merged line. AI is an accelerant, not an author of record.
- Prefer tools with a verify loop: tests, types, and runnable checks.
- Load goals, examples, and constraints. Keep instruction files short and accurate.
- High leverage on boilerplate and exploration; human-mandatory on security, money, and concurrency.
- Protect skill growth. Follow team policy on secrets and disclosure.
Further learning
Anthropic's Code w/ Claude talk on Claude Code best practices.
Related
Case study: coding agent
How coding agents work: repo context, edit tools, test loops, sandboxes and review.
Code review
Author small, reviewable PRs and give reviews that improve both the code and the author — design first, tone that teaches, turnaround that unblocks.
Writing code others can maintain
Managing complexity with deep modules, clear naming, honest comments, consistent style, and error strategies that shrink the blast radius of change.