Git AI

Claude Code Web

Track AI-generated code from Claude Code Web sessions with Git AI.

Claude Code Web runs in a remote cloud environment that supports the same hooks system as a local Claude Code installation. Just install Git AI normally and configure it with a SessionStart hook that runs each time a new Claude Code Web environment spins up.

Install script

Create the following script in the project repository. It checks for a remote environment, downloads Git AI if missing, and adds it to the session PATH.

.claude/hooks/install-git-ai.sh

#!/bin/bash
set -euo pipefail

# Only run in remote (Claude Code on the web) environments
if [ "${CLAUDE_CODE_REMOTE:-}" != "true" ]; then
  exit 0
fi

# Install git-ai for AI code attribution
# https://github.com/git-ai-project/git-ai
if ! command -v git-ai &> /dev/null; then
  curl -sSL https://usegitai.com/install.sh | bash
fi

# Ensure git-ai is on the PATH for the session
echo "export PATH=\"\$HOME/.git-ai/bin:\$HOME/.local/bin:\$PATH\"" >> "$CLAUDE_ENV_FILE"

Make the script executable:

chmod +x .claude/hooks/install-git-ai.sh

Hook configuration

Register the install script as a SessionStart hook in the project settings file. Claude Code Web executes this hook each time a new session begins.

.claude/settings.json

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/install-git-ai.sh"
          }
        ]
      }
    ]
  }
}

Commit both files to the repository. Every Claude Code Web session that clones the repo will pick up the hook and install Git AI automatically.

Enhanced telemetry

Teams and Enterprise customers can collect additional live telemetry from running Git AI sessions by adding a telemetry-write scoped API key to the environment:

GIT_AI_API_KEY=<api_key>

Set this variable in the cloud environment's secrets or environment configuration so it is available when the session starts. With the key in place, Git AI streams session-level telemetry back to the Git AI dashboard.