Why Does Claude Code Need Git? When It Actually Matters
Claude Code works without Git for simple edits, but several important workflows depend on a repository. Here is what Git gives Claude Code, what it records versus what session state records, and what neither captures.
Updated 6 min read
Claude Code does not require Git to run. It can read and edit files in any directory. But several of its most useful features — checkpoints, safe rollbacks, parallel branches and verified diffs — depend on a repository being present. Tools like fenbs keep the task decisions and progress that code history alone cannot capture: why a change was made, what was agreed, and where the next session should start.
This guide explains which Claude Code workflows depend on Git, what the two systems each record, and what you should track outside both.
What Claude Code can do without Git
On a plain directory with no .git folder, Claude Code can still read files, write changes, run shell commands and answer questions about the code. For a single-file script, a quick fix to a config file, or an experiment in an isolated folder, Git is not necessary.
The limitation is recoverability. If Claude Code changes a file and the result is wrong, the original is gone unless you saved a copy separately. On small, low-stakes tasks this is acceptable. On anything larger, the inability to roll back is a real risk.
What Git gives Claude Code
A Git repository gives Claude Code several things it cannot get from a plain directory:
- Safe rollback: every committed state can be restored with
git checkout. A wrong change is reversible. - Diff visibility: Claude Code can show exactly which lines changed rather than asking you to compare files manually.
- Branch isolation: Claude Code can create a branch for a set of changes, which keeps the main branch clean until the work is reviewed.
- Stash and checkpoint: Claude Code uses Git stash or commits to save intermediate states so you can step back to them.
- Meaningful commit history: a commit records what changed and when. Claude Code can write a commit message from its own understanding of the change.
These are not extras. Safe rollback and diff visibility are what make it practical to let an AI assistant edit real code. Without them, every Claude Code session on important files carries unnecessary risk.
For how checkpoints work within a session, see Claude Code checkpoints. For running parallel work in separate branches, see Claude Code worktrees.
What Git records — and what it misses
A Git commit records the state of the files at a point in time, the author, the timestamp and a message. That is a complete picture of what changed. It is not a complete picture of why.
A commit message can say "Add retry logic to the payment service," but it does not record: who asked for it, which business rule it satisfies, what alternatives were considered, whether it was tested on a staging environment, or who approved the approach. Those facts live in a chat transcript, a code review comment, a decision in fenbs, or nowhere at all.
Session state — what Claude Code knows within one conversation — is even thinner. It lives only while the session is open. A commit captures the files; a closed session captures nothing.
Keep the decisions and progress that code history misses
fenbs records what was agreed, why it was decided, and what remains. When Claude Code closes a session or you commit a change, the task in fenbs carries the context: which task this commit belongs to, what was tested, and what the next step is. History in fenbs shows who made each change — person or assistant — and when. Code history shows the diff; fenbs shows the story behind it.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
When Git is especially important with Claude Code
Git matters most in three situations. The first is when Claude Code will make many file changes in a single session. More changes means more to verify and more to undo if something is wrong. A checkpoint before Claude starts means you can restore the starting state in one command.
The second is when multiple people or sessions work on the same codebase. Branches keep their work separate until it is reviewed. Without branches, two sessions editing the same file at the same time cause conflicts.
The third is when the code history matters to other people: code reviewers, auditors, or future developers reading the blame log. A clean, attributed commit history is part of the handoff to anyone who works in the codebase later.
What Git and fenbs track together
Think of Git as the record of what the code looks like at each point in time. fenbs is the record of what the team decided and what the work was trying to achieve. Both are incomplete without the other.
A commit hash in a fenbs task note connects the two. "FET-42 completed in commit a1b2c3d" means anyone can find the change in Git and the context in fenbs. Six months later, the developer reading the blame log can follow the reference to understand the decision.
For how GitHub specifically fits into Claude Code workflows, a separate page covers the GitHub integration in detail.
How to do this with fenbs
- Create a free account and add a project for the codebase.
- Add a task for each piece of work Claude Code will do. Write the goal, the acceptance criteria and the agreed approach.
- Before a Claude Code session starts on a significant change, make a Git commit to create a safe checkpoint.
- Connect Claude Code from Integrations and ask it to read the task before it starts. It knows what was agreed, not just what the code looks like.
- After the session, record the commit hash in the task note and update Where we left off so the next session has the full picture.
For an introduction to Claude Code and installation instructions, see what Claude Code is and how to install Claude Code.
A practical summary
- No Git: fine for single-file experiments and throw-away scripts. Not recommended for real codebases.
- Git without fenbs: tracks what changed, not why. Enough for solo work on simple tasks.
- fenbs without Git: keeps task decisions and progress, but no safe rollback for file changes.
- Git and fenbs together: the full picture — recoverable code changes with their decisions and progress attached.