MODULE 3 · EVERYDAY WORKFLOWS / 25 MIN Free NOVEMBER 2026 EDITION · CLAUDE CODE 2.1.318
Git, commits and pull requests
Let Claude handle the git busywork (branches, commit messages, PR descriptions, review) while you stay in control of what ships.
Updated 5 November 2026 · Reviewed 5 November 2026
What you’ll be able to do
Go from a finished change to a reviewed pull request with a clear description, without writing a single git command yourself (unless you want to).
Prerequisites
- A GitHub repository you can push to
- GitHub CLI installed and logged in:
gh auth login
Commits with meaning
After finishing a change:
Review the staged and unstaged changes and commit them with a conventional
commit message. If the changes are unrelated, split them into separate commits.
Claude reads the diff, groups the changes and writes messages that explain the why, not just the what.
Set the rule once in CLAUDE.md: “Only commit when I ask. Use Conventional Commits.”
Branches and pull requests
Create a branch feat/truncate-helper from main with the current changes, push it,
and open a PR. The description should explain the motivation, the approach, and
how it was tested.
Claude runs git checkout -b, git push -u and gh pr create for you. Each command asks for permission unless you’ve allowed it.
Self-review before teammates see it
Review this branch's diff against main as a strict senior reviewer:
correctness bugs, missing edge-case tests, unclear names, leftover debug code.
List findings by severity with file:line. Don't change anything yet.
Then fix what’s worth fixing:
Fix findings 1 and 3. Skip 2, which is intentional.
Built-in review commands
Claude Code ships review skills you can run directly:
| Command | What it does |
|---|---|
/code-review (alias /review) | Finds correctness bugs in your branch’s changes. Runs as a background subagent so it doesn’t fill your context |
/code-review high --fix | Reviews at higher effort, then applies the fixes (edits still go through your permission mode) |
/code-review 1234 --comment | Reviews PR #1234 and posts the findings as inline PR comments |
/simplify | Cleanup only: reuse, simplification, efficiency. Applies its fixes |
/security-review | Looks for vulnerabilities (injection, auth issues, data exposure) in your branch versus origin |
/code-review ultra | A deeper, multi-agent ultrareview in the cloud (needs a claude.ai account; billed separately) |
Use your own structured prompt when you want a particular review style, and /code-review for a fast, consistent bug hunt. /code-review follows your CLAUDE.md, so your conventions apply automatically.
Dealing with review comments
When teammates leave comments:
Read the review comments on PR #12 with gh, address each one, and reply to
each comment summarising what you changed.
Merge conflicts
I'm rebasing on main and have conflicts. Resolve them, keeping both features
working, run the tests, and explain each resolution.
Always read the explanation. Conflict resolution is where subtle bugs sneak in.
Exercise
Using loop-practice (pushed to a GitHub repo of your own):
- Ask Claude to add a
capitalize(text)helper with tests. - Have it create a branch, commit with a conventional message, push and open a PR.
- Run
/code-review, plus your own strict self-review prompt, and fix at least one finding. - Push the fix and check that the PR updated.
Verify it worked
- A PR exists with a clear description written by Claude
- The commits follow a consistent message convention
- You ran a self-review and fixed at least one finding
Knowledge check
3 QUESTIONS · PASS MARK 80%Tip: select the text that's wrong before clicking, and it's quoted in your report.