Lurker News
I'm having a really hard time working with claude. In the past when I wrote all the code manually, it was always carefully reviewed and architected, with all possible flows carefully mapped out. Now, my code is mostly AI written which has led to things going out of control. Since it's easy to add new features and support many user flows, we went ahead and implemented flows that support a lot of cases our users run into. But now, I feel like things are getting too complex with no central notion of behaviour definitions, which causes every bug-fixing session to feel like a game of whack-a-mole, and results in missing edge cases and UI bugs that are becoming impossible to review and keep track of.

Every time I build anything new, it adds more complexity and the agent only seems to focus on the surrounding code within that session without keeping track of how it fits into the rest of the code base/product.
How do you all deal with this? Any suggestions for improving?

Comments (39) 68 threads

Earlier comments
chatziko#
Tips that work for me:

0. You need a very very clear vision of what you build. If it's fuzzy in your mind, the result will be a mess.
1. Write a very strict AGENTS.md. Emphasize that all design decisions are yours, agents are allowed to implement already specified behaviour. Also no new dependencies, interfaces, seams, etc, are allowed by the agent.
2. Work at one thing at a time and be on top of it. Every conversation followed, anything out of the ordinary checked immediately.
3. Keep a detailed TODO list shared between you and the agent. Every task you work on should be an item there, we scoped and specified. Anything that goes beyond a few commints is split (sub items, separate items, etc). Agents can propose nee items never file them automatically. Many can be open but work is always on a single item.
4. Extensive testing. Not bloated, need to be careful, but I'd say at least 3x or more the number of tests you'd write yourself. And tests for code quality (lint, dependency checks, etc)

alexjplant#
OpenSpec solves this incidentally by dividing work into planning, implementation, and archiving phases. If you tell it what you're doing and the business reasons during planning (and bicker with it about technical implementation) then it goes off the rails much less when it actually does the work. You can also PR the spec to coworkers before implementation and run the implementation step in a new context to keep it more on track.
NishanStepak#
You need to make sure you download your git history. You can analyze your git history with artificial intelligence to know where there were issues. There should be a complete record of every command you put into AI. 1. You need to audit your work regularly. You can ask almost any AI to audit your work. There are several different audits you can do, security, marketing, performance, seo, bias etc. Use more than one ai for the performance audits. This should tell you where a lot of the performance issues are. There are also specialty audits you can get from specific services. I also have a weekly audit run for general issues. Cover all the bases. 2. You have to watch the AI carefully to make sure it is not generating errors. I catch it looping quite often or making mistakes. 3. Ask people to review your site. There are places where you can get human reviews. Do this regularly. AI is self referential and will make mistakes that no person will make.
waximabbax#
I can tell you what helps me and maybe you can incorporate some of this in your own code as well.

1- Ensure you have Changelogs.md, Agents.md properly written to your likings.
2- Depending on what you are building there is always a way to add actual UI tests and takes screenshots of before and after. If its a related to web UI, you can use playwright and or similar but there is always an option to test UI. Worst case scnerio is when none of libs help you and in those cases, you can add automated tests for UI using computer control from agents and take screenshots.
3- When reviewing PRs, always use a totally different agent. For example if you use claude code for creating PR, then perhaps ask Codex or Cursor to review the PR in depth.
4- Prefer smaller multiple PRs over larger ones.
5- Last resort: If you don't have to review and check PRs yourself, perhaps consider hiring a QA engineer if you can afford one.
Last but not least, learn to freeze the scope and remember not all bugs and edge cases are worth covering.

Load more comments