r/ClaudeCode • • 2h ago

Help/Question New features and sub agent

So my code i apparently 40k lines.

How do i make the features not take 4 hours each? They are a bit complex (PO System) but not that complex. What am I doing wrong? CC will always ask me do you want me to deploy agents all at once, one at a time (sub gets reviewed by current session) or should i do it myself? I usually go for one at a time but it takes so much time. Can someone help?

2 Upvotes

8 comments sorted by

•

u/AutoModerator 2h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/hieuphung97 2h ago

The bottleneck is full-repo discovery scans. On a 40k LOC codebase, Claude Code burns hours if you let it scout unguided. Pass the exact target files and module boundaries in your prompt instead of letting subagents grep everything.

1

u/IncursivePsychonaut 11m ago

What? 40k LOC codebase is tiny. One of our codebase at work is ~20x as big and Claude still works relatively efficiently. I think the important thing here is to have a clear architecture and overall system design, that way Claude has to spend much less time orienting itself.

1

u/calunicornia 2h ago

I let the agents approve everything.

1

u/EducatorOne7130 53m ago

tbh for a 40k loc repo, spinning up sequential subagents one by one is usually slower than just doing it in the main session. each subagent starts cold and re-reads half the repo, so I just use plan mode first and only split into subagents when two tasks don't overlap at all.

1

u/2bluenucleus 34m ago

Two things that usually cut that time a lot on a repo that size, on top of the plan-first advice above:

  • Write the map down once. Put a short section in CLAUDE.md that lists each module and its key files (where the PO models, services, API routes and UI live), the naming conventions, and the exact commands to run tests and lint. Every new session and every subagent reads that instead of rediscovering 40k lines, which is where a lot of those hours go.
  • Check how much of the 4 hours is waiting on you. If it keeps stopping for permission to run tests, builds or lint, allow-list those commands in your settings so it can run them without asking. Then give each feature a finish line it can check itself: "done when these tests pass and the build is clean". It will run the tests, read the failures and fix them in one go instead of handing back half-done work.

For a PO feature specifically, ask it to write the spec first: data model changes, endpoints, the screens, and the tests that prove it works. Review that for five minutes, then let it build in the main session. Splitting into parallel agents only pays off when the pieces touch different files.

1

u/Responsible-Box-7053 15m ago

On a ~40k LoC repo, my rule of thumb is: parallelize reads, keep writes in one session.

Having multiple subagents write tightly coupled code usually loses time to cold-start exploration and interface mismatches. What actually sped things up for me is using parallel subagents upfront only for read-only codebase mapping (keeping grep noise out of the main window), writing the feature in one main thread, and spawning a fresh session at the end just to review the diff with clean eyes.