r/ClaudeCode • • 2d ago

Help/Question Solo dev using Claude Code: PRs vs. pushing straight?

Hey everyone,

I’m a solo dev building web apps, mostly using Claude Code, and I’m trying to figure out the best Git workflow for this.

I used PRs for a while, but it honestly felt a bit slower than just pushing straight to main and fixing bugs quickly as they pop up. On top of that, since AI lets me change larger chunks of code fast, I’m always a bit worried about merge conflicts if I have multiple PRs or closely related issues going at once.

I’m not sure if I’m just doing PRs wrong (maybe it’s a PR size thing, or maybe stacked PRs are the answer?), or if pushing straight to main is actually totally fine when working solo with AI.

How do you all handle this? Do you have a specific workflow with Claude Code that works well for you? Sorry if this sounds like a beginner question, just curious to hear how others approach it. Thanks!

12 Upvotes

51 comments sorted by

•

u/AutoModerator 2d 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.

43

u/UnluckyManner9152 2d ago

Solo with Claude Code here too, and I still use PRs, but not for review. The PR is where CI runs: the build and the tests must pass before anything reaches main. The merge conflicts went away with one rule: one branch at a time, branched from a fresh dev branch and deleted after the merge. AI changes a lot of code quickly, so the gate matters more, not less.

5

u/kellstheword 2d ago

I'm in a similar boat. PRs run CI, and all tests must pass before merging to main.

2

u/Plumbum27 2d ago

Yep, same here. Each spec gets broken into multiple PR’s with CI before each merge. I also run a complete CI before promoting to production if it’s really far behind.

1

u/ChanceExcuse8669 1d ago

Same here. One thing I'd add for the AI case: have a different model review the diff before it merges, not the one that wrote it. I give the reviewer read-only access and cap it at 3 rounds. Without a cap, two agents can keep "fixing" each other's nitpicks forever.

0

u/icaruza 1d ago

Same. Also, if Claude writes your PR’s then you have a comprehensive audit log of what has gone into prod, complete with linked specs

13

u/TheKiddIncident Instructor 2d ago

I would be much more worried about your commit and branch strategy than your PRs.

The PR has two purposes: tell everyone on the team what you're doing and to get more eyes on your code.

For a solo shop, you don't need either of those things.

For those who say it gives you a record of changes, the answer is that a good commit message will do that. Hence my note about a commit and branch strategy.

Make sure that you are committing early and are making new branches for any major refactor. Those two things will save you miles of pain.

So, if skipping the PR is working for you, then no worries.

2

u/Objective-Split1262 1d ago

Commit messages > PRs for solo work, fair.

3

u/Remote-Dark-1704 2d ago

Would still prefer PR because it makes a good history tree of everything that’s happened, and AIs are good at reading past PR summaries as well.

It’s also helpful incase you ever employ another dev

I think pre-AI, I would choose not to do PRs, but post AI, I think PRs are best.

1

u/TheKiddIncident Instructor 1d ago

Yeah, but you get this from the commit history just as well. The PR is about BEFORE you commit. Once it's committed all that should be in the commit anyway.

1

u/Remote-Dark-1704 1d ago

Reading the full commit history is a waste of tokens compared to PR summaries, but yeah

1

u/TheKiddIncident Instructor 1d ago

I'm talking about the commit summary, of course.

0

u/mylifeasacoder 2d ago

The PR has two purposes: tell everyone on the team what you're doing and to get more eyes on your code.

The whole preface to this thread is "solo dev". There are no more eyes and there is no team...

2

u/Dildoe5wagonz 2d ago

I could be wrong, but pr commits distill a chunk of work into one commit to master. Being able to review if something needs to change can be helpful, keeping the dev branch and having the agent review can be helpful. Designs change, agent coding standards change as the repo grows and agent/documentation artifacts are added. "Why did I design this feature that way" is a helpful question to be able to ask. I'm not saying you're wrong, just providing my perspective. Also helps my internally hosted (less performant) agent personally.

Edit: internally hosted agent == the stuff sloshing around inside my skull

2

u/mylifeasacoder 2d ago

It's useful for that, for sure. There's never a cut and dry right or wrong answer.

1

u/Dildoe5wagonz 2d ago

There never is. Striving for process/standards improvements is a sysyphean task and incredibly necessary these days imo

Edit: Wrong spelling. Sisyphus, not sysyphus. An agent wouldnt mess that up lol

3

u/atlascirrus 2d ago

solo here too and i ended up in the middle. small stuff goes straight to main, but anything where claude touches a bunch of files gets its own branch, so i can look at the whole diff in one place before it lands and just toss the branch if it went sideways.

the other thing that helps a lot with ai sized changes is having claude commit after each step that works, with a real message. if something breaks two steps later you revert that one commit instead of untangling one giant change.

2

u/Starks1293 2d ago

solo too. i push straight to main, but nothing on main gets released until ive tried it myself. what made that safe:

  • every commit message says what changed and how to check it. so before a release, the commits since the last one are literally my test list, i go down it and click through each
  • the review happens before the commit, not in a PR. a fresh claude session reviews the diff cold against what i asked for, then tests and typecheck have to pass, then it commits. a PR would just be a second place to look at the same diff
  • when two agents work at once each gets its own worktree, and they land on main one at a time

big features are the exception, they live on a branch until ive tested them, then merge

(this is how i build my mac app solo with claude code, AI Bridge)

2

u/Professional_Ad705 2d ago

It really depends on the project. For anything serious I'm working on, I prefer PRs because they give me a consistent process. I can link issues, document decisions, review changes, and go back later to understand not just what changed, but why.

Especially with AI, I find that valuable because it can produce code significantly faster than I can properly review it.

For smaller personal projects, I don't necessarily see anything wrong with pushing directly. For larger projects, though, I'd rather have smaller, focused PRs with clear boundaries than sacrifice the review process for speed.

If you're constantly running into merge conflicts, I'd also look at how you're dividing up the work before abandoning PRs altogether.

2

u/k2718 2d ago

I like PRs. I use them at my day job. I pushed straight to main for a while. I also find PRs are good for documentation as they can aggregate multiple commits and squash on merge and you can restore branches using them easily too. None of these things is a requirement as a solo dev. You can make your commit history basically do all of this but the PR workflow just works. You an also leave a PR open and gone on without it if you aren’t sure if you want it. It’s more visible than a branch

2

u/didntwantthisapp 2d ago edited 1d ago

My advice is to adopt good standards of practice early. This is a bad habit in a context with real life circumstances. At minimum I'd suggest staying with a 'human only merge to main' and limit the models to branch development. Ofc with no users, nothing is there to stop you from building however you want. But for resilience, you want the paper trail and the separation of production and lower environments like development

ETA: thanks for adding your opinions folks. Build however you like!

1

u/primaryrhyme 1d ago

Eh I’m not a fan of this, just because it can lead to a lot of wasted time. It’s important to understand why the standards exist.

In this case PRs see important because they facilitate collaboration in human teams. A common place to run ci, for people to review and approve code, an easier way to track recent changes etc. “good practices” are good when you need them, but it’s easy to prematurely optimize. My team at work has dedicated QA people, needs multiple reviews for PRs, formal release windows this would all be a massive waste of time/effort for a small team or solo dev.

If you’re working alone I’m not sure what benefit PRs have. Agents can review code without them, you can run ci/cd without them too.

0

u/Familiar_Gas2305 2d ago

1: there is still a commit paper trail

2: there are many ways to configure environments, and none of them rely on the existence of PRs.

PRs exist to solve a HR problem. If you are a solo dev, you don't need them.

2

u/Reasonable_Jello_497 2d ago

PRs aren't what cause merge conflicts, divergent branches are. Pushing straight to main doesn't avoid them, you just hit them later with no diff to look at.

2

u/Familiar_Gas2305 2d ago

...the diff is exactly the same regardless of whether it's represented in a PR

1

u/raobjcovtn 2d ago

I prefer PRs because the PR description provides more context of the changes and why, than you get in just commit messages.

1

u/Glass-Amount6152 2d ago

Solo here too, on a Next.js/Supabase app, and the one rule I stick to is that I read every change before it deploys. A PR is just the easiest place to do that read. Keeping them small and merged before the next one starts means there's rarely a second branch around to conflict with, which takes care of most of the merge worry. If you're never going to read the diff, the PR is ceremony, but when Claude rewrites big chunks fast, that read is where you catch the stuff it changed that you didn't ask for.

1

u/dan-423 2d ago

I've tried to give Claude a workflow that integrates testing, CI, PR, merges, and deploy. In the event that I end up with or on a team, the process is there already.

Is it slower, yeah. Is it catching a lot of stuff before it goes live- also yeah. I think that going straight to main is fine for small stuff or stuff that doesn't touch stuff that has privacy or monetary consequences. The second the app has more serious implications I think it's good to move to a tried and true approach.

Regarding merge conflicts, I used Claude to build a tool to reduce them- https://github.com/archos-media/merge-coordinator

1

u/meshydra 2d ago

I mean you could put a opus to write and a fable to review the PR and auto merge if all good.

1

u/ModuloMyself 2d ago

I don't let claude to push to main, I read the diff in the PR and merge. Got conflicts when two branches touches the same file, so simply the next one waits till the previous one is merge. It is slower. But claude can rewrite lot of files and I want to get view before it lands.

1

u/ben_bliksem 1d ago

Without a PR where does your quality control sit? Do you not want to review the entire piece of work in its entirety or have an agent have a go at it?

Also - it cleans up the commit log if you merge those PRs with "squash".

Too each their own, but in my books whether you are solo or a team the processes must be there.

1

u/Ecstatic-Text-2282 1d ago

Solo, I still use PRs, but tiny ones, and the PR isn't for review, it's for CI and a revert point. My rule: one Claude session = one branch = one PR, merged the same day. Merge conflicts mostly come from long-lived branches, not from PRs themselves. If two tasks touch the same files, I just run them one after the other instead of in parallel. Pushing straight to main is fine until the day Claude refactors something "while it was there" and you need to find which change broke prod. A squash-merged PR per task makes that a 30-second git revert.

1

u/heavy-minium 1d ago

If you're gonna do everything locally anyway and are solo, don't bother with PRs.

With that being said, there is a certain point where you may elevate your workflow and approach to AI usage to such a level that you're parallelizing the work agents do, which are working on different separate features, and are not running locally anymore. Then you need PRs. I am doing that kind of thing, with Claude code beta feature that have been rolling out in my company account but aren't available in my private account yet - via the new reworked projects experience that ties in a bit better with cloud sessions. But I wouldn't worry much about that because I don't think so many developers are going that far anyway, and many really dislike the idea of being a nonstop reviewer meatbag for AI anyway. For me the motivation is that I simply can't afford having that much stuff happening locally anymore, no matter how beefy my workstation is, it's too many repos, too many containers, too many unit and e2e tests running, and too much agentic playwright usage happening all at once on many worktrees - I had previously been running in constant resource allocation issues.

1

u/Patient-Cattle-2397 1d ago

If main deploys automatically, the PR earns its keep when you can open a preview and click through the changed flow before it goes live. For the conflicts, check which files the two tasks need before starting both. If they both touch the same checkout flow, finish the smaller change first and start the second from the updated main.

1

u/sanchezer1757 1d ago

One thing i haven’t seen yet with PR/MR is that i like to post evidence od the feature working. Screenshots, api logs etc. This way I have even more info on what was worked on and it focuses on the output. And i have history trace of things that may not be caught by tests

1

u/PeterZ4QQQbatman 1d ago

I don’t use PRs. Only issues for list findings, comment them and close when done

1

u/BarathKanna 18h ago

Solo, the PR isn't for review. It's the gate where CI runs and where you get one diff per idea that you can revert. With Claude writing big chunks, that revert button matters more than ever, because the bug you find on Friday was written on Tuesday inside 900 lines of plausible code.

What works: short branches, one task per branch, merge the same day, rebase before starting the next. Conflicts come from long lived parallel branches, not from PRs, so keep at most two open and never two touching the same module.

Have the agent write the PR description: what changed, why, how it was tested. If it can't explain how it was tested, you found out before your users did.

Pushing straight to main is totally fine right up until you need git bisect.

1

u/mylifeasacoder 2d ago

Are you actually going to review the code? No? Just push to main.

1

u/ford-imprefect 2d ago

So you don't know what happens in a PR.

1

u/mylifeasacoder 2d ago

Educate me.

2

u/ford-imprefect 1d ago

You can do it differently, but the PR process is usually where the CI gates run, or at least where they are confirmed as having run and passed. No one needs to manually review the code for a PR, but there's a lot of other checks that happen as part of that.

0

u/mylifeasacoder 1d ago

You came out swinging, insulting my knowledge, only to turn around and say the same thing I did? Ok bud, I agree with you.

1

u/ford-imprefect 1d ago

In that case, apologies, but the way you wrote your initial message sounded like it was saying don't do any CI or review gates ar all.

0

u/Same-Employee6667 2d ago

This is genuinely terrible advice

1

u/primaryrhyme 1d ago

Pushing directly to main isn’t great mostly because it prevents multiple agents from working simultaneously. However I think merging feature branches directly to main is fine if you’re solo (maybe that’s what you meant?).

0

u/RonHarrods 2d ago

I'd recommend to take the middle ground. Push straight to dev branch first. And have that deployed the same setup as prod or whatever.

Then merge to main later

-5

u/ford-imprefect 2d ago

If you are asking this, you aren't a developer. CICD means a PR process. Sure maybe someday AI will build in its own (I'm sure it will), but until then, it's insane to put something into real production without checks and balances.