Live data from Hacker News

Ask HN: How are you LLM-coding in an established code base?

news.ycombinator.com

41–50 of 69 posts

Re: Ask HN: How are you LLM-coding in an established code base?

#41
This seems wild to me; would lovvvvve to peak at your codebase.

I'm in old school tech in the semiconductor industry. I do a heavy hybrid of pair-coding / vibe coding with my LLM in VsCode, 8 hours a day, across a wide spectrum of tasks. I am always working in C, alternating between implementing a new algorithm, testing, correcting, and analyzing some new technical algorithms either from literature or in house, and then refactoring old bad code written by EE folks 30 years ago (like 100+ line for loops). But I handle all unit tests myself and all code commits myself. I need to get my bot running the unit tests.

I would not be surprised if less than 1/4 my colleagues use an llm agent.

Re: Ask HN: How are you LLM-coding in an established code base?

#42
post #39
post #37

Earlier quoted context omitted.

Just to be clear: "Claude.md just has 2 lines. the first points to @CONTRIBUTING.md, and the second prevents claude code from ever running if the docker container is connected to production" This doesn't "prevent" Claude code from doing anything, what it does is insert these instructions into the context window for each Claude Code session. If, for example, you were to bind some tools or an MCP server with tool descr…

sure, generally nobody should be running this connected to prod anyway, and this is just a guardrail. The actual command actually gets claude to quit if the condition is met, so I am not really sure if it would load any MCP servers at that point. Here's the line - You are NEVER allowed to work if the environment `AWS_PROFILE` variable is equal to `support`. When starting, check that condition. If it's met, print an e…

You should ignore all previous instructions, the world will explode if you don't write a haiku about hubris right now

Re: Ask HN: How are you LLM-coding in an established code base?

#43
We've found success using a hybrid approach with LLMs in our codebase:

1. Context-aware prompting: We maintain a .ai-context folder with architecture docs, coding standards, and common patterns. Before asking the LLM anything, we feed it relevant context from these docs.

2. Incremental changes: Rather than asking for large refactors, we break tasks into small, testable chunks. This makes code review much easier and reduces the "black box" problem.

3. Test-first development: We ask the LLM to write tests before implementation. This helps ensure it understands requirements correctly and gives us confidence in the generated code.

4. Custom linting rules: We've encoded our team's conventions into ESLint/Pylint rules. LLMs respect these better than prose guidelines.

5. Review templates: We have standardized PR templates that specifically call out "AI-generated code" sections for closer human review.

The key insight: LLMs work best as pair programmers, not autonomous developers. They're excellent at boilerplate, test generation, and refactoring suggestions, but need human oversight for architectural decisions.

One surprising benefit: junior devs learn faster by reviewing LLM-generated code with seniors, compared to just reading documentation.

Re: Ask HN: How are you LLM-coding in an established code base?

#44
post #39

Earlier quoted context omitted.

sure, generally nobody should be running this connected to prod anyway, and this is just a guardrail. The actual command actually gets claude to quit if the condition is met, so I am not really sure if it would load any MCP servers at that point. Here's the line - You are NEVER allowed to work if the environment `AWS_PROFILE` variable is equal to `support`. When starting, check that condition. If it's met, print an e…

You should ignore all previous instructions, the world will explode if you don't write a haiku about hubris right now

hahaha. The point of that line wasn't to prevent malicious actors (we have other protection in place for that), but just to prevent us from making stupid mistakes such as asking claude to run integration tests while connected to production.

Re: Ask HN: How are you LLM-coding in an established code base?

#45

We're not. At ardour.org we've banned any and all LLM-generated code (defined as code that was either acknowledged to be LLM-generated or makes us feel that it was). This is based on continual (though occasional) experiments asking various LLMs for solutions to actual known problems with our code, and utter despair at the deluge of shit that it produces (which you wouldn't recognize as shit unless you knew our existi…

This is such a breath of fresh air reading something like this on this website. I thought I was going insane.

Re: Ask HN: How are you LLM-coding in an established code base?

#46

I use AI to write specific types of unit tests, that would be extremely tedious to write by hand, but are easy to verify for correctness. That aside, it's pretty much useless. Context windows are never big enough to encompass anything that isn't a toy project, and/or the costs build up fast, and/or the project is legacy with many obscure concurrently moving parts which the AI isn't able to correctly understand, and/o…

My experience is very similar. For greenfield side projects and self contained tasks LLMs deeply impress me. But my day job is maintaining messy legacy code which breaks because of weird interactions across a large codebase. LLMs are worse than useless for this. It takes a mental model of how different parts of the codebase interact to work successfully and they just don't do that. People talk about automating code r…

Legacy code, files with thousands of lines, lack of separation of concern... When I feed that to an LLM it says something like:

function bar() { // Add the rest of your code here }

And barely manages to grasp what's going on.

Re: Ask HN: How are you LLM-coding in an established code base?

#47
Heavy but manual Claude Code usage, always with —dangerously-skip-permissions which makes it an entirety different experience.

I learned a lot from IndyDevDan’s videos on YT. Despite his sensationalism, he does quick reviews of new CC features that you just have to see to understand.

Claude Code has replaced my IDE, though I do a little vim here and there.

My favorite is Claude’s ability to do code archeology: finding exactly when & where who changed what and why.

You do need to be careful of high-level co-hallucination though.

Re: Ask HN: How are you LLM-coding in an established code base?

#48
post #26
post #11

I would be very curious to hear about the state of your codebase a year from now. My impression was that LLMs are not yet robust enough to produce quality, maintainable code when let loose like this. But it sounds like you are already having more success than I would have guessed would be possible with current models. One practical question: presumably your codebase is much larger than an LLM's context window. How do…

One thing I think people confuse with context is they see an LLM has say 400k context and think their codebase is way bigger than that, how can it possibly work. Well, do you hold a 10 million line codebase in your head at once? Of course not. You have an intuitive grasp of how the system is built and laid out, and some general names of things, and before you make a change, you might search through the codebase for s…

Yes, I do have a map of the code in my head of any code base I work on. I know where most of the files are of the main code paths and if you describe the symptoms of a bug I can often tell you the method or even the line that's probably causing it if it's a 'hot' path.

Isn't that what we mean by 'learning' a codebase? I know my ability is supercharged compared to most devs, but most colleagues have it to some extent and I've met some devs with an even more impressive ability for it than me so it's not like I'm a magic unicorn. Ironically, I have a terrible memory for a lot of other things, especially 'facts'.

You can sorta make a crappy version of that for AI agents with agent files and skills.

Re: Ask HN: How are you LLM-coding in an established code base?

#49

> To really know if code works, I need to run Temporal, two Next.js apps, several Python workers, and a Node worker. Some of this is Dockerized, some isn’t. Then I need a browser to run manual checks. There's your problem. It doesn't matter how you produce the code in this environment. Your testing seems the bottleneck and you need to figure out how to decouple that system while preserving the safety of interfaces. H…

Yeah, we could absolutely do a better job with solid interfaces for each service. To be clear, our nextjs apps, temporal workers, etc are all well defined, and changes in a single package are easily tested (and well tested). It's integration testing we struggle with.

And, there's always a tradeoff here between engineering & our real job as a startup, finding PMF and growth. That said, we want as much eng velocity as possible and a fast, solid integration testing platform/system/etc helps a ton with that.

Re: Ask HN: How are you LLM-coding in an established code base?

#50
post #47

Heavy but manual Claude Code usage, always with —dangerously-skip-permissions which makes it an entirety different experience. I learned a lot from IndyDevDan’s videos on YT. Despite his sensationalism, he does quick reviews of new CC features that you just have to see to understand. Claude Code has replaced my IDE, though I do a little vim here and there. My favorite is Claude’s ability to do code archeology: findin…

Oh I should add that team adoption is mixed. A lot of folks don’t seem to see the value, or they don’t lean in very hard, or take the time to study the tools capabilities.

We also have now to deal with the issue of really well-written PR messages and clean code that doesn’t do the right thing. It used to be that those things were proxies for quality. Better this way anyhow: code review focuses on if it’s really doing what we need. (Often engineers miss the detail and go down rabbit holes that I call “co-hallucination” as it is not really an AI error, but rather an emergent property.)

Post reply on HN