Hacker News new | ask | show | jobs
by bethekind 26 days ago
> mostly stuff that works for humans also works for AIs but you need to know to ask for it

I'm most curious about this sentence. What have you noticed about the similarities? I'm getting really good at asking for confidence levels, tests and pushing back, but I'm curious what you found

1 comments

If you don't start with a clear file structure and code architecture appropriate to your problem domain, the agent won't fill in the gaps and will give you mush that it will eventually fail to navigate effectively. So you need to be explicit and say (e.g.) "this project is structured as a Ports And Adapters project, one class per file. Adapters go in src/adapters, core domain in src/core/app, ports in src/core/ports, entry points in src/main" in AGENTS.md. Picking something like that rather than free-handing the structure also helps humans enormously, that's why those ideas exist. I've found that doing something like that helps the agents to stop the code from creeping into mush over time, and actually gives them a reason to self-correct drift if it happens. I tend to prefer something off the shelf like Hexagonal Architecture because the chances are good that the agent already knows about it and has a lot of background on it, but has no reason to pick it amongst all the alternatives unless prompted.

Tests are non-negotiable. I've found it helps to be very explicit about Red-Green-Refactor loops so you don't get it trying to one-shot more than it should, alongside git pre-commit hooks that won't let failing tests accidentally get committed. Again, this helps humans.

Thanks for that

I'm starting my first coding project with Claude Code and your comment gave me some helpful topics to study