← ContentsClaude Code · advanced

Working with git / GitHub via Claude Code

Claude Code is an agentic coding tool that integrates directly with git and GitHub (as well as GitLab) to handle the full version-control workflow from your terminal or a cloud environment. It can read repository state, stage changes, write commit messages, create and switch branches, open pull requests, and respond to GitHub issues—all driven by natural language instructions rather than manual git commands. On the local side, Claude Code detects the git executable and the GitHub CLI (gh) automatically from your system PATH and uses its native Bash execution tool to run commands. On the cloud side, it offers a GitHub Actions integration that lets CI/CD pipelines trigger Claude autonomously—parsing issues, writing code, running tests, and opening PRs without any local environment. For web-based use (Claude Code on the web at claude.com/code), git operations are routed through a secure Anthropic-managed proxy that attaches scoped authentication tokens, validates branch names and push destinations, and ensures that sensitive credentials such as git signing keys are never exposed inside the sandboxed session. A Code Review feature (Team and Enterprise plans, research preview) can also post automated review comments on pull requests when triggered manually or automatically.

When you’d use it

  • Context-aware commit message generationA developer has staged a set of changes but doesn't want to write the commit message manually. They ask Claude Code to analyze the diff and commit with an appropriate Conventional Commits-style message.
  • Automated GitHub issue resolutionAn engineer tags '@claude' in a GitHub issue describing a bug. The GitHub Actions integration picks up the trigger, clones the repo, locates the bug, applies a fix, runs linting and tests, and opens a pull request linked to the original issue—without any local environment involvement.
  • Merge conflict resolutionAfter a failed 'git pull', a developer asks Claude Code to resolve the merge conflicts. Claude reads the conflicting hunks, rewrites the files with the correct combined logic, stages the resolution, and can create a PR describing what was changed and why.
  • Parallel feature development with git worktreesA team wants to migrate a large codebase to a new ORM simultaneously across model and view layers. They run multiple Claude Code sessions in separate git worktrees so edits never collide, then open draft PRs per branch for human review before merging.
  • CI/CD pipeline debugging and automated fixTests are failing in a GitHub Actions pipeline. Claude Code reads the error logs, identifies the misconfigured step or broken code, pushes a fix commit, and monitors re-runs until the pipeline passes.

What changed recently

  • 2025Claude Code GitHub Actions reached General Availability (v1.0), introducing breaking changes to workflow YAML syntax versus the beta version. Key additions include automatic mode detection (the action can immediately ingest and process assigned issues without waiting for a manual confirmation loop) and simplified configuration. Teams on the beta must migrate their workflow files.
  • 2025A patch to the EnterWorktree feature was released ensuring local git worktrees track changes based on the local HEAD rather than the remote origin. This fix enables multiple agent sessions to run parallelized development on the same repository simultaneously without tracking conflicts.
  • 2025The 'skipLfs' option was added to 'github'/'git' marketplace source configurations in Claude Code settings, allowing users to skip Git LFS binary downloads during clone and update operations to reduce session startup time.
  • 2025Claude Code on the web launched at claude.com/code, enabling browser-based Claude Code sessions in an isolated cloud sandbox. Git operations are transparently routed through a secure Anthropic proxy; sensitive credentials such as git signing keys are architecturally excluded from the sandbox.
This is the short version

The full chapter has three worked examples, the common pitfalls, and the workflow that makes it pay — plus the other 84 features, kept current.

Get Claude Master — $97
CLAUDEMASTER
An independent publication.
Independent product. Not affiliated with or endorsed by Anthropic. “Claude” is a trademark of Anthropic, used here only to describe the subject of this manual.
© 2026 Claude Master — All rights reserved.