Using AI to write better code more slowly

(nolanlawson.com)

160 points | by signa11 3 hours ago

21 comments

  • bottlepalm 1 hour ago
    I've hit this point with AI where it's not a simple process, but a long drawn out back and forth.

    I'll use AI to design the implementation of a medium sized, cross cutting feature. Review all the details, maybe iterate on just that. Then implement with Claude 4.7 Max - which runs slower, but does a better job. Then review the implementation, then have Codex GPT 5.5 xhigh fast review it - which almost always finds corner cases. Have Claude fix those - Claude is better at writing intuitive maintainable code versus Codex overengineered/shortcut filled code. (Codex is better at finding/fixing bugs and doing reviews - it's annoyingly pedantic)

    Then repeat with fresh Claude/Codex instances having them both review the current staged changes and getting feedback, handling the feedback. Then covering it in tests. I mean overall I still implement the feature faster than coding it manually, but I spend a majority of the time going back and forth with reviews, handling corner cases and at the finish end up with what I feel a really solid implementation of whatever feature I'm working on. The v1 feature feels more like a v3 given the amount of iteration it already went through.

    • scosman 1 hour ago
      yes exactly. Too many people ask AI to one-shot complex tasks, and wonder it behaves like a junior asked to rush something.

      I have my own skill: 5 rounds of research/planning/test-planning. Interactive with me in loop for all important decisions. Starts with high level shape, then details. Planning can take 2-3 days of my time, then the implementation agent can take many hours (Opus 4.7). It splits the implementation across many phases/commits, each with its own code-review fix loop. Deep code review at the end can take another hour or two. It opens a PR, Gemini reviews, it reads out and resolves those issues.

      Projects still take days or weeks, but 5x faster than doing it all myself.

      • deadbabe 41 minutes ago
        Does the 5x faster including shipping? Or just the work part?

        IMO if you are not shipping out faster then the faster work gains are meaningless.

        If you are shipping faster, you’re probably picking up more work and shipping everything too fast leading to burnout.

        • mhluongo 39 minutes ago
          If you're not shipping faster, it's meaningless, and if you are, it's also bad?
    • sunsetSamurai 12 minutes ago
      maybe it's dumb question, but how do you feed the results of one agent to another? do you copy and paste manually? or how do you do it programmatically?
      • kevinsync 1 minute ago
        When I pair Claude and Codex, I use claude-co-commands [0] to drive from Claude and talk to Codex via MCP. Lately I've found Codex has been far more consistent for my specific projects, so I've just been almost entirely inside Codex. YMMV

        [0] https://github.com/SnakeO/claude-co-commands

      • adrianN 10 minutes ago
        Having the agents write their plans into text files and iterating on those works reasonably well.
    • chrisweekly 47 minutes ago
      You helpfully cite Claude w/ Opus 4.7 max and Codex w/ GPT5.5 xhigh fast, but what "AI" do you use for the initial design?
      • bottlepalm 43 minutes ago
        Claude primarily, though will sometimes get a second opinion from Codex.
    • rootnod3 1 hour ago
      And then Anthropic has an outage and you what...have a coffee break until then? All that time babysitting the AIs just to be a little faster but probably with less knowledge/control over what they did?
      • afavour 1 hour ago
        I don’t think you’re quite getting what OP is describing. I work in a similar way… I am aware of all the code being written. If Claude had an outage I could write it myself. It would just take longer.

        You say “all that time” babysitting AIs but in my experience it isn’t that much time, if anything the back and forth at the planning stages is more productive than when I’m doing it by myself because I’m being asked questions and having to think things through from different angles.

      • efitz 1 hour ago
        If you only have one AI window open, you’re doing it wrong. You task swap to another window/agent, get it working on something, rinse and repeat. I can keep 4 busy most of the time. When I task swap I also check in on what the other agents are doing to make sure they’re on track, not blocked and not struggling.
        • well_ackshually 23 minutes ago
          congratulations on your soon to be coming burnout.

          Keeping that many tasks in parallel, running all the time will kill you.

      • comradesmith 1 hour ago
        I’ll deal with that problem when it happens
      • refactor_master 58 minutes ago
        We're already having coffee breaks when AWS and CloudFlare are down. What's another break in the mix? If anything, we might be lucky that they're down at the same time, so we can consolidate the breaks.
      • bottlepalm 1 hour ago
        As the AI is working, I am working - reviewing, regression testing, thinking about if the currently implementation is too complex and how to simplify it etc.. I totally review and understand everything the AI is generating and often push back, have it re-do something, or do it myself. In the end I feel like the quality of the work is at a v3 level in the time it took to do a v1. The productivity and quality increase is real.
      • 8note 38 minutes ago
        why not?

        then demand some lack-of-uptime compensation for a lack of uptime

      • glhaynes 1 hour ago
        "All that time babysitting the AIs just to be a little faster" doesn't seem like an accurate/unbiased portrayal of what they said: "The v1 feature feels more like a v3 given the amount of iteration it already went through."
      • mohamedkoubaa 1 hour ago
        And then solar radiation permanently knocks out the electrical grid and you what... have coffee break until society finds a new equilibrium?
      • wahnfrieden 1 hour ago
        Codex has 99.98% uptime
      • soupspaces 43 minutes ago
        In Soviet Russia, the AI babysits you https://en.wikipedia.org/wiki/In_Soviet_Russia
    • nomel 19 minutes ago
      I've noticed the following really helps (most important at end):

      1. Have claude form the plan and converse with a simple "Note any concerns with this plan" type plan-critic agent.

      2. Let it run.

      3. After (with everything in context) have it make a future_recommendations.md.

      4. Have it make a plan.md to implement those future recommendations, conversing with the plan critic..

      5. Clear context. Repeat with 1. Do this loop a few times, with some feedback from actual review thrown in.

      But, most importantly, because Claude will aggressively try to maintain code "as is", and happily build on it's previous crap, while preferring to hand roll implementations of everything, add something like this to memories/directives:

      * When evaluating designs, default to "pull in the library" over "hand-roll it." Hand-rolling is much worse than a dependency.

      * "Precedent" / "matches house style" / "reuses existing pattern" / "consistent with what we already do" are not valid engineering arguments.

      * This project is still in the development stage with no real deployments. Mitigation costs and existing precedence are not a concern.

      With these, in the last week that I've started using them (after inspecting the insane justifications for leaving crap design decisions in the plans), Claude went from junior level slop that required more oversight than it was worth to something very reasonable, using standard libraries, requiring nudges for architecture rather than pure "wtf!?".

      I think they've fine tuned heavily towards "don't rewrite the codebase" tuning, which completely rational from multiple perspectives, but also not appropriate for new code.

      I do enjoy a considerable daily token allowance, so this may not apply to everyone.

    • vessenes 1 hour ago
      I have a very similar workflow, and experience similar temperaments from the agents. I also find anecdotally that they are moderately competitive - you get very different attention from them when you say "competitor X wrote this - please find all bugs" than when you say "you just wrote this - please find all bugs".
      • bottlepalm 1 hour ago
        Hah yea I just told them I wrote it, or I reviewed it. I don't want to get the AI's in a pissing contest with each other because they will get distracted and try to show off.
    • skydhash 35 minutes ago
      That sounds too much like three weeks of work saving you three hours of planning.

      In my experience, software engineering is a matter of knowledge. Understanding it and then coming up with a solution. The latter is a flash of insight that comes mostly from experience. Then you gather more information to flesh it out, or brainstorm it with your colleagues.

      What you're describing sounds more like a ritual of doing busy work than anything practical. Because tasks vary so much. A feature may be huge, but you take care of it in a day with copy pasting because you already have all the building blocks in other files. And something may be twenty lines of code, but you spent the whole week sweating on it (concurrency stuff maybe). Those ritualistic workflows sounds more like someone imagining software development than actually doing it.

  • crabmusket 1 hour ago
    The linked article about getting LLMs to critique each others' code review[1], the magpie tool[2], and also this recent article from Cloudflare about their code review stack[3] are all quite compelling.

    I'm fairly AI-skeptical not on grounds of "do they work" but "are they good for the world". I feel that getting AIs to do this kind of review work is a rare case that doesn't outsource thinking and deskill workers. It doesn't trigger the same alarm bells as having the AI write the code (including having the AI fix the issues it discovers). That's setting aside environmental and other ethical concerns, which are still significant to me.

    I have been impressed by the recent quality of AI code reviews*, but the experience of interacting with 3 separate AI reviewers via GitHub PRs is pretty terrible. Having more local-oriented and jj/rebase-aware review rounds would be great.

    *context: fairly large PHP/Laravel backend and Vue frontend

    [1]: https://milvus.io/blog/ai-code-review-gets-better-when-model...

    [2]: https://github.com/liliu-z/magpie

    [3]: https://blog.cloudflare.com/ai-code-review/

  • justinlivi 1 hour ago
    I find myself spending on average more time in LLM review/resolution loops than it would take for me to write the code by hand. Partially because once I'm in the flow I write very very quickly and the code pours out sometimes faster than I can write. But also because the LLM code on the first few tries is generally really really bad. What I find interesting though is that spending the time to personally review and direct the LLM through several iterations of review and revision on average results in higher quality code written in about the same time as I would have written it. This might be particular to me, but seeing several interations of someone else's code helps me better understand holistically my objective as opposed to whatever happens to come out of my flow-state consciousness.
    • zik 44 minutes ago
      If your AI is writing bad code then you need to change your AI. No current high-end AI should be producing bad code.
  • smusamashah 1 hour ago
    Title of this article suggested more depth and I was expecting actual code examples. But it is like other opinion pieces. It suggests a prompt (ask AI to find bugs) that works for the author advising everyone to do it that way.

    I use these tools at both work and for personal side projects and I was expecting to watch and learn. But these opinion pieces without examples are way too many now.

    • vessenes 1 hour ago
      Have you tried his suggested workflow? I think it's a useful workflow, and if I hadn't found a workflow like this already would appreciate the pointer.

      I guess he could write a code harness to do this, or gin one up really quickly, but that kind of tooling today seems like the purview of the practitioner -- you -- it's frankly faster for you to spec what you want to try this idea out if you want it automated than it would likely be to deal with his code.

  • vessenes 1 hour ago
    One thing that's been interesting to me over the last few years is charting the edge of my coding laziness. As a coder, I'm lazy about boilerplate code -- I hate writing it, I hate maintaining it, etc. And so I design and architect (or used to) around that preference. Sometimes that's smart, sometimes that's not. But it was my preference, and I avoided something that was hard for me to do.

    When LLMs started being somewhat useful for coding a few years ago, and I found they were in fact great at boilerplate, in fact pretty much only good at boilerplate ca 2023 or so, it got me thinking about all the accommodations we make in design and systems architecture that are sort of tacitly understanding who we're working with and their strengths and weaknesses.

    The modern models have their own very different strengths and weaknesses compared to humans, and deploying them is a really interesting exercise of different architectural and engineering skills. I've enjoyed it, and hope I continue to.

    • foobarbecue 11 minutes ago
      The thing about boilerplate is that a good library or framework makes it optional, and / or automatically written.

      I'd much rather django-admin startproject, npm init, or meteor create and get deterministic output than prompt an LLM and get who knows what.

      In a mature web ecosystem, boilerplate is minimal. I worry now that we've given this task to LLMs, less development effort will go into startproject-esqe CLIs and good opinionated defaults.

  • reactordev 12 minutes ago
    This is the approach I take, with many guardrails and nested CLAUDE.md's to keep things sane.
  • TACIXAT 1 hour ago
    This article doesn't address writing code with AI, just code review. My issue with agentic coding is that I make numerous micro-architectural decisions while programming. I almost never have a full spec up front and develop one as I consider what I am writing.

    When using Claude Code or Codex, that is all gone. Claude Code is extremely eager to reach the end goal to the point that it feels like a fever dream to write code with it. In the end, I have low confidence about edge cases and fit into the project's architectural and design goals.

    On top of that, I enjoy programming, reverse engineering, etc. and I feel that the LLMs, while able to solve some problems or deliver some features, take that fun away. I'm trying really hard to find a workflow with them that I'm confident in, but I fear that workflow is just chat, search, and being a rubber duck for my thoughts.

  • kiba 1 hour ago
    I used LLM as a tutor to tackle unfamiliar terrain. That is, I write code that I know very likely doesn't work but is the best code that I could have written. The LLM will happily tirelessly show me what I did wrong and what the correct code actually look like. Then, at the end of it, I got code that running. That's a tight feedback loop.

    It's still very slow. It took me two hours to write code that generate JSON data and then to write a web page that displays a knowledge graph.

    One thing you have to be aware is that the LLM will happily generate code for you and you have to discipline it from time to time. I notice that my reading comprehension begins to suffer if I don't write the code myself and have to understand what the LLM wrote for me as opposed to the LLM correcting where I went wrong.

    One thing I would like to try with an LLM is understanding a large and complex existing codebase like OpenSCAD that doesn't leverage my existing skillset(high level programming languages with OpenSCAD as primary language in the past year). That has always been a barrier to contribution for me.

  • ai_fry_ur_brain 33 minutes ago
    Just dont use it lol, it does nothing you cant do by yourself. You're nerfing parts of your brain by relying on it.
    • ctrl-alt-zen 1 minute ago
      Yeah, agreed. “Cognitive surrender” is one way of describing that loss of personal faculty. I don’t think AI proponents are acknowledging second order effects of letting your mind interact less and less while requesting more and more complexity built for you without adequate verification.
    • ianm218 10 minutes ago
      There is things you really can't do by yourself. I've been working on porting some large codebases to Rust lately to experiment with fixing memory safety bugs. There is just no way you can write 100k LOC in a week of production code with tons of tests etc. Even "10X" engineers just can't type that fast.
  • knuckle 20 minutes ago
    Stop being reasonable! This is a hypecycle!
  • EFLKumo 50 minutes ago
    https://news.ycombinator.com/item?id=48246232

    This reminds me the article above. Now people have diverse ideas on agentic coding. Some suggest human-in-the-loop while others suggest giving a detailed specification and let the agent run freely; some suggest leveraging LLM's high productivity and here we get an opinion that LLM can actually slowly write good code.

    It's happy to see opinions that are more practical and variant emerging, turning LLM into literally a tool instead of something to be hated or hyped.

    In my own practice, I find LLMs (SOTA ones) good at medium-level tasks, those needed to reason and plan for a while. However, the design taste on architecture is unexpectedly disgusting. Sometimes writing interfaces myself and asking LLMs to fill in implementations, alongside context-completing tools like context7, deepwiki, docs.rs MCPs, etc. and giving a escape hatch (e.g. encouraging it to use the AskUser tool in Claude Code), may be considered my best practice.

  • syntaxing 1 hour ago
    Hot take, barring from special edge cases, I find using dumber models (like local Qwen 3.6) to be the best balance. Smart enough to do stuff but dumb enough where I don’t trust it and verify what it’s doing rather than letting it do the third whole code base refactoring of the day. Also forces me to know my code base and ask very descriptive tasks rather than go “something is wrong, fix it”.
  • efitz 1 hour ago
    Great article and right on point.
  • ptlan_asnh 1 hour ago
    How profound! Talking points are changing from "vibe coding delivers bug free software" to "slow down and enjoy the AI".

    Great how the promoters are mirroring the current anti-AI sentiment. The next step is canceling all subscriptions and not using AI at all. Maybe your mind will work again.

    • CuriouslyC 1 hour ago
      Not so much. People are just walking things back from the Gastown/Oh My Opencode/etc peak of trying to get 10 agents working simultaneously on a project unsupervised. They've collectively realized that you still have to understand and validate what the agents produce in some way if you want to build maintainable software.
  • npollock 1 hour ago
    learn by considering critique
  • slopinthebag 1 hour ago
    I use cheaper models (Deepseek is king, but GLM and Kimi as well) and do the planning myself. I often start a task myself, write some code to get the LLM on the right track, and then have it complete parts of the implementation that are kind of boring or repetitive. LLM's are just next token predictors, I don't mean that in a demeaning way, but I've found if I can get the LLM started on the right track with my own code, it completes what I want. Having the LLM write code just from a spec ends up with poor quality slop in my experience.

    I'm not 100x'ing my output like some people claim, but using it as a augmentation rather than delegating my work to it results in better code, and I don't lose context / control over my codebases. I really have read 100% of the code, because the LLM is generating smaller pieces around and inside my own written code. Works well enough for me, and open models are already both cheap enough and good enough for this workflow. This is why the big companies are so desperate to push full-on agentic hands-off workflows and developer replacement - that's the only way they won't go bankrupt.

  • chengyongru 19 minutes ago
    [flagged]
  • zhxiaoliang 1 hour ago
    [dead]
  • jdw64 1 hour ago
    [dead]
  • seblon 1 hour ago
    I want to mention, Claude code has a command /code-review. I find it quiet useful.
  • alasano 1 hour ago
    Instead of using a skill and having the agent own the flow for this, I've been building an external orchestrator that handles the process.

    By default it uses pi agent core + pi ai (from the excellent pi coding agent) as a multi model runtime but also supports a Claude Agent SDK runtime.

    I can have an implementation and review process of an OpenSpec change run anywhere from 2 hours to 24+ hours going through review/fix/verification rounds automatically until the implementation matches the spec and any additional reviewers are done finding issues after the fix rounds.

    it's going to be fully open sourced in the next two weeks and fully free to use

    https://engine.build

    • whattheheckheck 1 hour ago
      Maybe we can come up with an spec for aligning asci diagrams. Can't really build anything with confidence when the attention to detail is lacking in these agentic systems

      https://imgur.com/a/r4fhOwy

      • tudelo 1 hour ago
        It's interesting... Opus seems horrible at keeping text aligned. Markdown it is I suppose
      • alasano 1 hour ago
        What's that from? OpenSpec docs?
        • whattheheckheck 44 minutes ago
          Yeah not trying to pick on any particular project because its quite the mark that the writer didn't proof read the documentation and its quite widespread