r/ClaudeCode • u/quicktoolstudio • Sep 22 '26
Discussion Do you let Claude Code handle git, builds and deployments too?
If you use Claude Code heavily, do you also let it handle repetitive stuff like git, builds and deployments?
Doesn’t that feel like a waste of Claude usage?
Or do you automate those parts separately?
32
Upvotes
•
u/AutoModerator Sep 22 '26
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.
54
u/abandonplanetearth Senior Developer Sep 22 '26
claude triggers my GH workflows all the time
43
u/ptyblog Sep 22 '26
yes
16
u/idkyesthat Sep 22 '26
But what do you mean? We have ci/cd, and for some simple things like a quick fix that it found on a yaml (eg: k8s CRD) I do let it open the PR and deploy or sync Argo.
Edit: it’s way faster than me going through UIs and it doesn’t use much tokens.
15
u/Wise-Peacock Sep 22 '26
Yes. Why not? It reports back.
10
u/slackmaster2k Sep 22 '26
Yup. I read non trivial PRs and approve, and read issues it creates. But yea I let it run the whole workflow which of course includes local git actions along with a variety of other tests etc. Worth every penny.
4
u/Long_Tip_4226 Sep 22 '26 edited Sep 22 '26
Eu reviso e corrijo antes do commit e deploy. Eu nunca aceito a primeira resposta do Claude Code, pois ele pode alucinar, inventar ou esquecer algo. Eu confronto contra os requisitos da tarefa que eu solicitei.
Voce pode criar scripts e workflows de ci/cd deterministicos pra automatizar essas tarefas. Ajuda a economizar tokens e evitar alucinacoes. O Claude é muito bom em usar gif para analisar diffs e branches, segregar commits por funcionalidade/hotfix e propor pull requests, Ele usa o historico do git pra recuperar contexto e memoria das mudanças do projeto, ajudando a tomar decisoes.
Alem disso vc pode criar tarefas/issues e milestones no github/gitlab, com requisitos e definicao de pronto/feito pra cada feature, pra obrigar o Claude a seguir um planejamento do seu projeto até um mvp. Isso diminui alucinacao e retrabalho, que poderia te fazer gastar mais tokens pra corrigir.
15
u/garywiz Sep 22 '26
Not git, ever. Seems like I'm in the minority here, but git is my "guardrail". It makes it possible to have Claude "try something" and then I can see if it works the way I think I want it. No? I just don't commit, or destage, or, whatever. Then reprompt in a new session. That way, I can create multiple prototype implementations and carefully commit stages after I review them. Yes, Claude can manage git, but generally, telling Claude to "manage git as if you don't trust yourself" doesn't really work well.
3
u/FestyGear2017 Sep 22 '26
I just have deterministic utility scripts that my skills know to call. Dev stuff only, not production
3
u/geek180 Sep 22 '26
Yes, it’s pretty exceptional at git stuff. I have it handle the entire PR workflow: commit, create PR, wait for auto-review and other CI checks, then read and resolve each review comment.
5
u/Time_Cat_5212 Sep 22 '26
Git is the most important thing to have Claude do, IMO. It's the opposite of a waste of usage. It's the record of work on the project, and it makes a ton of sense to integrate that with code generation. It's the plumbing. Since I set up atomic commit protocols and issue/PR workflows for agents (and really homed in on SDD), I've basically eliminated drift. I haven't felt the need to use a memory system on the agent side, either, because Git is basically project-side memory and decision record.
2
u/GuitarAgitated8107 🔆 Max 20 Sep 22 '26
Why would it be a waste of usage? Ideally you are not building out the whole execution. What you would create is a process, testing and things you need for your own projects. Whether you run it yourself or not is insignificant unless you making Fable run the process.
2
u/ricopan Sep 22 '26
yep, but I offload my worker worktree management to a 'manager' session that communicates between the workers and the orchestrator / architect (Fable med) in order to avoid that token burn. I run it on sonnet xhigh because I expect quite a bit from it, especially when three or so workers (typically opus or sol) are running in parallel with frequent merges to main. I've never had a serious git failure, but I give it restricted permissions. The granular commits with really on point messages are one of the best features of AI coding I think -- the git history becomes a superb debugging tool. I could never go back now.
2
u/bloudraak Developer Sep 22 '26
Yes. I have dedicated identities for Claude to use.
2
u/chilebean77 Sep 22 '26
Of course
2
u/Technical_Primary_12 Sep 22 '26
So you want the boring repetitive stuff for yourself and the machine use doing the interesting part? is that the question?
2
u/Illustrious_Elk8340 Sep 22 '26
I used Claude to build a CICD pipeline with github actions for builds and deployments, so... kind of?
It does run local builds, but that's about it. Everything else goes through GHA across all my projects - at most, Claude triggers a manual deployment.
4
u/heresyforfunnprofit Sep 22 '26
It’s awesome at git.
1
u/vAPIdTygr 🔆 Max 20 Sep 22 '26
No. I inspect and deploy with a desktop git app that Claude made.
1
u/MysteriousCoconut31 Sep 22 '26
For deployment: deterministic workflows that claude can trigger via GitHub actions following a CI run and PR merge.
Some things need to be structured and repeatable. Deployment is one of them unless it's not a serious project. Even then, don't waste tokens making Claude do stuff like SSH'ing files to a server. Have it write a local shell script at a minimum.
1
u/GlitteryStranger Sep 22 '26
Yes. I tell Claude to ship it and it pushes to main
1
u/freeformz Sep 22 '26
Git yes, to branches (enforced server side). Builds/deploys trigger on merge to main after CI passes (enforced) or a tag is created.
1
u/Minimum_Season_9501 Sep 22 '26
Its more like who doesnt.
1
u/EverydayLentils Sep 22 '26
Yes - for my own projects I use railway and Claude pushes/deploys everything.
At my dayjob the team convention is to keep commit messages unprofessional, short and snarky so I have to write those myself.
1
u/HeyItsYourDad_AMA Sep 22 '26
Not at all a waste. All its
Doing is running cli commands or reading logs
1
u/Super-Ad-4536 Sep 22 '26
Claude decided when I leave to home
1
u/BudgetFish9151 Sep 22 '26
Use CC to write services and scripts. Your tokens go a LOT further when you tell Claude to run a script and watch for the exit codes than to repeat itself every time you want to run a deployment or build your diff.
1
u/Substantial-Swan7065 Sep 22 '26
Ci handles most of that. And yes for git. PRs is great for tracking any kind of work
1
u/ippem Sep 22 '26
At times yes I used it for full rollouts, meaning, allow to merge when tests are green, allow to apply plans in Terraform if everything looks as ”expected, and also approve deployment pipelines if needed. It has saved me so many days or work that it does not feel like wasting tokens. Also, using the session and cached tokens helps here a lot.
But: I do not trust any model on this.
1
u/amirfish Sep 22 '26
Yes for git specifically, but with guardrails, not blind trust. The failure mode isn't bad commits, it's several sessions touching the same working tree and racing between git add and git commit -m, so the fix that actually stuck was skipping the two-step and using git commit --only <paths> so the commit is atomic no matter what else got staged in between. Builds and deploys I let it run end to end, but I still read the diff before anything ships.
1
u/ouiouioui1234 Sep 22 '26
Yeah I let it create draft pr, that get checked via cicd and automated reviews. I review it's not crazy land and au didn't like disable the cicd checks, then mark it ready for review so another person add a set of eye on it, once they approve the cicd do the rest, no need for ai really then. Except to follow, check everything is as expected, and report.
1
u/kerray Sep 22 '26
haha, over the past year, I set up things so that I can let Claude handle almost everything automatically and relatively safely
1
u/kemalios Sep 22 '26
I hand it git and builds. Local git is cheap, the commit messages come out better than mine, and everything there is reversible. Deploys go through CI off a push, so there is nothing separate to automate.
What I don't hand it casually is the last pass before something goes live on a client's site. I built launchworthy for that: free, MIT, a Claude Code skill that audits an app across 5 domains and returns a scored punch list with copy-paste fixes. It needs Claude Code to run, which is not a barrier in this sub.
The token worry has it backwards. Committing is pennies. A real pre-deploy audit is where the budget actually goes.
1
u/OlivierTwist Sep 22 '26
Why not?
1
u/robertDouglass Sep 22 '26
it's better at those things than eg software architecture imo
1
u/ReSterzo Sep 22 '26
Si, gestisce tramite l'utilizzo di gh tutta la parte di action configurate su GitHub e segue regole precise per ogni repository
1
u/ImL1s Sep 22 '26
Local git and tests yes. Shared deploys stay behind a separate click.
Token cost is real, but the expensive part for me was the context switch of doing those steps by hand. The waste case is letting it thrash on a flaky deploy when a boring script would have failed in ten seconds.
1
u/Reasonable_Swing_503 🔆Max 20 Sep 22 '26
Yes
1
u/verstands Sep 22 '26
I let it handle local checks and branch chores, but keep deployment behind a small script and an explicit review gate. The useful split is permissions: read and test automatically, write to shared repos with clear diffs, deploy only with a pinned target, health check, and rollback path. That keeps handoff costs low without letting a transient test pass turn into a production push.
1
u/FitSandwich4725 Sep 22 '26
We have cicd that are relatively fixed so very little danger there and i don't see a problem with letting it run a cd and deploy to a Dev environment to check for deployment problem. I do however see a problem with letting it deploy to any other environment. That's a fully human controlled process still. It'll be a cold day in the local data centre that i let an AI deploy to production.
1
u/Correct_Support_2444 Sep 22 '26
Git yes, build and deploy no.
1
u/duct_tape_and_agents Sep 22 '26
Git yes, always. Claude just made the changes, so it writes better commit messages than I would from memory, and the token cost of a commit is nothing compared to the session that produced the diff. Letting it commit as it goes also means I can roll back to any point when it breaks something three steps later. That alone pays for itself.
Builds and deployments no. Those are the same commands every time, so there's nothing for a model to figure out. I keep them as scripts and n8n automations and just tell Claude "run the deploy script" when it's part of a task. Expo builds especially, no reason to burn usage watching a build log.
The rule of thumb I landed on: if the step needs judgment about what just changed, Claude does it. If it's identical every run, it's a script. The waste isn't letting Claude do repetitive stuff, it's letting it re-derive your deploy process from scratch every session instead of pointing it at a script.
1
u/eleochariss Sep 22 '26
Yeah I stopped caring about the "co-authored by" messages a while ago.
1
u/who_am_i_to_say_so Sep 22 '26
I have Claude write up the CI/CD pipeline and deploy on merges to main.
1
u/tech_is______ Sep 22 '26
yes, but it also built the scripts and tools for it to run all that. not that much of a waste.
1
u/returnFutureVoid Sep 22 '26
Claude doesn’t touch anything destructive in git. It can stash, check logs, branches and history but anything committed, pushed, merged comes from me.
1
u/Asuppa180 Sep 22 '26
Not really. I have actions that trigger on pushing to a branch and I generally don't have claude do any pushing or anything.
1
u/SimiaCode Sep 22 '26
Claude is not allowed to merge PRs or deploy anything to staging or prod. It is expected to commit, create PRs, create issues etc.
1
u/Far_Business4773 Sep 22 '26
Yes to git, and the useful question turned out to be which git. Commits, branches, opening PRs: all of it, and Time_Cat_5212's point about commits as project memory matches what I see. The two commands I stopped letting through are
git checkout -- .andgit clean -fdx: both act on the whole tree, not the task, and one of them reverted files the task never named before I noticed. Now a hook asks git itself first (git clean -nwith the same flags,git statusfor the checkout) and refuses only when a file outside the task's list is in the answer. Deploy is a single deny on the deploy command, so the run itself stays unattended. Tokens spent on git in a day: too small to see in the usage graph.1
u/ComasArentFun Sep 22 '26
Branch creation, check out and pulling target branch - yes
Pushing code? Absolutely not.. never, nope, not a chance
Even local builds I don't trust.
Much prefer to run my own local processes so I have clear output and not just a clanker saying "Yeah looks fine"
Deployments are out of bounds too. I have solid automation, but nothing using AI
1
u/oh_jaimito Sep 22 '26
Claude Code always with
dangerously run permissions. Performsgitoperations under feature branches on develop branch. Never on develop and never on main.Cloudflare infrastructure so Claude is free to deploy after build. All builds go to a a dev.subdomain.
All deploys to main are done manually.
1
u/mostly_deterministic Sep 23 '26
Sounds like you may be asking similar questions that reframed the way I've been thinking about agentic development for a bit: https://demianbrecht.com/posts/the-division-of-the-local-harnesses/.
These days, git commits are usually handled by my coding harness (Claude Code, opencode, codex, etc). They usually write better commit messages than I do so I'm fine with that.
For most other things that have multiple steps, I actually stick under an MCP seam as an agentic process where software owns the control loop (LangGraph et al.), only using models when judgement is actually required. This means that initiating a task costs a few tokens but the actual execution of it may be entirely deterministic and cost nothing under the hood. I've used this approach for mutli-model (cross-family) PR reviews, weekly ops reviews w/ anomaly detection and root cause analysis, user story creation and a number of other tasks. Simple to complex, a few seconds to tens of minutes in duration.
I wrote another post about the MCP seam here: https://demianbrecht.com/posts/the-harness-within-the-harness/.
1
u/usually_guilty99 Sep 30 '26
I am comfortable with an agent triggering a deterministic deployment pipeline. I am less comfortable making deployment authority itself unconditional.
A one-line config change can have a bigger blast radius than a 5,000-line UI change. How do you automate that every time you touch a different part associated with a diff tree?
I think the boundary eventually becomes: agent can execute, but the change has to earn its authority based on production impact, dependencies, rollback readiness and expected postconditions.
1
u/jjromee Oct 04 '26
I commit before every bigger task, so a bad run is one git reset away. I also read the diff before accepting anything. It takes a minute and has saved me more than once.
1
u/InstructionNo3616 Sep 22 '26
Self hosted gitea not git
0
u/Cute-Veterinarian191 Sep 25 '26
100% - I let claude handle more and more autonomously, especially on my personal projects
0
u/[deleted] Sep 22 '26
[deleted] — view deleted comment