Live data from Hacker News

How Claude Code works in large codebases

claude.com

171–180 of 191 posts

Re: How Claude Code works in large codebases

#171
post #80

Just an anecdote: I was designing a project for LLMs onboarding and orchestration. Claude chose to read only the first 40 lines of each file. Later, in another session, looking for causes of low quality result, Claude detected the fault and changed the code to perform an AST analysis, so now the analyzer takes documentation lines and functions signature (input/output) as input. Claude's initial approach was really po…

I think it's taught to look at source code through a peephole for the sake of context preservation, but I feel like this could be a good use-case for some sub-logic or even a full sub-agent. Like, here sub-agent, you skim that file and tell me a summary, and highlight any areas related to X and Y so that I can look at them in my main context. You can also periodically observe the main work stream and interrupt me if…

One thing you can do is offload from Claude to a dumb local model for summarizing. Local LLM sub-agents.

Re: How Claude Code works in large codebases

#173

Earlier quoted context omitted.

The article listed explains how to avoid this. If you naively turn it loose on a big code base, yes, you’ll burn a lot of tokens while it tries to find stuff.

This is such a shame, finding where stuff is in a large codebase is my number 1 use for LLM. I hate it that it relies on grep so much, I can do grep better and faster myself.

I mean, it doesn't have to be a shame. I typically will have it start making an index as it probes, so the big token burn is upfront, and future searches are more targeted. It is pretty good at doing this.

Re: How Claude Code works in large codebases

#175

Earlier quoted context omitted.

My last project was about 400Gb, and probably 2M lines of C++. The days size is mostly assets but there’s still a lot of code.

>2M lines of C++ Even with a git history, wouldn't that only be maybe a few hundred MB?

Dunno, we use perforce. The 499GB is assets.

Re: How Claude Code works in large codebases

#176

How important are Claude.MD files when they don’t even describe (with concrete terms) what should even go into each one?

the fish: you can read about that here: https://code.claude.com/docs/en/best-practices#write-an-effe... the fishing: 1) install the official `skill-creator`; 2) use that with the above link to create `claude-md-improver`; 3) improve the skill by tasking claude with researching the topic of `progressive-disclosure`, in the official docs; 4) point the new skill at you CLAUDE.md file and accept the changes

Seems crazy how they suggest a lightweight CLAUDE.md (shows 4 lines) but the /init command they suggest creates 100 lines of Markdown.

Re: How Claude Code works in large codebases

#177
post #130

Earlier quoted context omitted.

If you’re message is in response to me, which I think it is, I deliberately don’t give access to credentials and env variables. I’ve worked to create restrictions and seen AI models use very interesting methods to bypass them. Even now my prompt says the AI must verify the path of the files it intends to edit, and get permission before editing one file at a time and only after permission. I stop it from ignoring thos…

This is not privilege separation/sandboxing. Separate virtual machine for an agent with limited credentials is reasonably safe approach

I built www.propelcode.app with separate Linux containers, unless you disconnect the container and your computer from the internet the models can escape the sandbox and get information off of your machine.

I am open to being corrected and learning from you if you have a better method of sandboxing

Re: How Claude Code works in large codebases

#178

Earlier quoted context omitted.

Dude, AI has been shown to execute queries on coworkers env files, extract master keys, decrypt variables and push to production.

Why are important push secrets in a dev env config? Btw humans devs make this same mistake all the time.

umm lots of providers have cli tools: ‘heroku run rails db:drop —-app {name}’ railway, fly.io etc. so unless you don’t ever use their cli tools locally there’s a vector. Plus CI/CD might also have credentials to do things like run migrations.

Re: How Claude Code works in large codebases

#180

Earlier quoted context omitted.

or easier, open ~/.claude/projects/[project]/[session].jsonl (excluding the system prompt)

Doesn't really seem easier and it's in a harder to read format

I had a hard time understanding the claude logs and built a light weight html visualizer for myself. Here is the github if anyone is interested

https://github.com/dtang27182/claude-code-log-visualizer

Post reply on HN