Claude Desktop: Fix "Git Is Required for Local Sessions"

If Claude Desktop tells you that Git is required for local sessions, the fix is usually to install Git and make sure it is available on your system PATH. This guide walks through the diagnosis and the setup.

Updated 5 min read

Claude Desktop shows the message "Git is required for local sessions" when it cannot find a working Git installation on your machine. Local sessions let Claude read and interact with a local directory; Git is used to track changes and provide context about the repository. Without it, Claude Desktop cannot start the session.

The fix in most cases is to install Git and restart Claude Desktop. If Git is already installed, the fix is usually to make sure it is on the system PATH. Tools like fenbs can hold your task brief while you sort out the development environment, so the work context is ready when the session starts.

Why Git is required

When Claude Desktop opens a local session with a directory, it uses Git to understand the project: what files have changed, what branch you are on, and what recent commits say about the work. It also uses Git to stage changes it makes so you can review them before accepting. Without Git, it cannot do any of that.

This is different from the Claude.ai web interface or the API, which do not require Git. The requirement is specific to Claude Desktop's local session feature. See the Claude desktop app overview for how local sessions fit into the product.

Git does not have to be configured with a remote, a username, or an email for Claude Desktop to use it. A bare local repository is enough. The local session uses Git as a change-tracking layer, not as a collaboration or backup tool.

Step 1: Check whether Git is installed

Open a terminal or command prompt and run:

Check Git version
git --version

If you see a version number (for example, git version 2.46.0), Git is installed. If you see an error like "command not found" or "'git' is not recognized", Git is not installed or not on your PATH.

Step 2: Install Git if it is missing

On macOS, the easiest route is to install the Xcode Command Line Tools, which include Git:

Install Xcode Command Line Tools (macOS)
xcode-select --install

Alternatively, install Git directly from git-scm.com, which provides installers for macOS, Windows, and Linux. The site is the primary source for Git downloads.

On Windows, the Git for Windows installer from git-scm.com adds Git to your PATH automatically. On Linux, use your distribution's package manager: sudo apt install git on Ubuntu or Debian, sudo dnf install git on Fedora.

Step 3: Verify PATH after installation

After installing, open a new terminal window and run git --version again. A new terminal is important because the old one may not have loaded the updated PATH. If the version appears, close Claude Desktop completely and reopen it.

On Windows, if Git installed but git --version still fails in a new terminal, check that the Git bin directory was added to the system PATH. Open System Properties > Environment Variables, find the Path variable, and confirm it includes a path like C:\Program Files\Git\cmd.

Step 3b: Check the Git binary path on macOS

On macOS, Git installed via Homebrew goes to /usr/local/bin/git or /opt/homebrew/bin/git depending on whether you are on an Intel or Apple Silicon Mac. If a terminal finds Git but Claude Desktop does not, check whether Claude Desktop's PATH includes the Homebrew prefix. Running which git in a terminal tells you the path to the Git binary your shell uses.

Step 4: Confirm the directory is a git repository

Even with Git installed, Claude Desktop may require the local directory you are opening to be a git repository. Check whether the directory has been initialized:

Check if directory is a git repository
cd /path/to/your/project
git status

If git status returns "not a git repository", initialize one:

Initialize a git repository
git init

You do not need remote hosting. A local git repository is enough for Claude Desktop's local session feature.

How fenbs helps

Keep your task notes ready while you fix the environment

Add the project to fenbs before spending time on environment setup. Write the task and where things stand as the current context. When Claude Desktop is working again and you connect it to fenbs over MCP, it reads the project context and picks up from Where we left off.

Create a free account

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

If the error persists after installing Git

If you have confirmed that git --version works in a terminal but Claude Desktop still shows the error, try these steps:

  1. Quit Claude Desktop fully, not just close the window. On macOS, right-click the dock icon and choose Quit.
  2. Reopen Claude Desktop after quitting completely.
  3. Check the Claude Desktop logs for more detail about what it tried and why it failed.
  4. If Claude Desktop was open when you installed Git, it may have cached the old PATH. A full restart of the app, or in some cases the machine, picks up the new PATH.

For MCP configuration issues unrelated to Git, see claude desktop MCP not working and claude desktop MCP config. For a comparison of Claude Desktop with CLI and VS Code options, see claude code desktop vs CLI vs VS Code.

How to do this with fenbs

  1. Create a free account and add a task for the work you planned to do in the local session.
  2. Write where things stand and what the next step is, so the context is not lost while you fix the environment.
  3. Once Git is working and Claude Desktop opens the local session, connect Claude Desktop to fenbs from Integrations.
  4. Ask Claude Desktop to read the project context before it starts. It reads the task and the rules before making any changes.
  5. After each session, save progress so the next session starts from the right place.

Questions people ask.

Why does Claude Desktop need Git for local sessions?

Claude Desktop uses Git to understand what has changed in a directory, track the branch and recent history, and stage changes for your review. Without Git, it cannot provide that context or safely record what it does.

Do I need a remote repository on GitHub or similar?

No. A local git repository is sufficient. Run git init in the project directory and Claude Desktop can open a local session there. You do not need to push to any remote.

I installed Git but the error still appears. What should I try?

Quit Claude Desktop fully and reopen it. The app needs a fresh start to pick up the updated PATH. If that does not help, open a terminal and confirm that git --version works, then check that the PATH includes the Git binary directory.

Does this affect the Claude.ai web interface?

No. The Git requirement is specific to Claude Desktop's local session feature. The Claude.ai web interface and the API do not require Git.

Can I use Claude Desktop without Git at all?

The local session feature requires Git. Other Claude Desktop features, such as connecting to MCP servers or using it as a chat interface, may work without it. Check Anthropic's help documentation for the current requirements.

More in Agent harness (for developers)

All Agent harness (for developers) articles

Start with one thing.

Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.