Git Integration

Automatically sync your commits and pull requests to give your AI assistant context about your code changes. GitHub activity is shown directly on your task cards and detail views.

How It Works

Git Integration uses GitHub webhooks to automatically capture every commit and PR you make. Once configured, you don't need to do anything else - just work normally and your history is saved.

1

One-Time Setup (5 minutes)

Connect your repo and configure the webhook in GitHub. This is done once per repository with Claude's help.

2

Automatic Forever

Every push from any terminal, VS Code, or GitHub web is automatically saved. No action needed.

The Flow

After Setup:

  You (any terminal)          GitHub                    ContextForge
       │                         │                            │
       │  git push               │                            │
       │───────────────────────▶│                            │
       │                         │                            │
       │                         │  webhook (automatic)       │
       │                         │───────────────────────────▶│
       │                         │                            │
       │                         │                            │  Saves commit
       │                         │                            │  to memory
       │                         │                            │

  Later, ask Claude:
  "What commits did I make this week?"
  "What changed in the auth module?"
  "Show me recent PRs"

Setup Guide

You can connect a GitHub repository in two ways: using the Dashboard (recommended) or via MCP commands.

A

Connect via Dashboard (Recommended)

1

Go to Account Settings

Navigate to Dashboard → Account

2

Click "Connect Repository"

Enter your repository URL (e.g., owner/repo or full GitHub URL) and select a project.

3

Configure Webhook in GitHub

The dialog will show you the Payload URL and Secret with copy buttons. Click the link to go directly to your repo's webhook settings.

4

Activate

After adding the webhook in GitHub, click "I've Added the Webhook - Activate" to start syncing.

B

Connect via MCP Commands

Step 1: Tell Claude to connect your repo

"Connect my GitHub repo https://github.com/username/my-project"

Step 2: Configure webhook in GitHub

Claude will give you the Payload URL and Secret. Add these in your repo's Settings → Webhooks.

Step 3: Activate the webhook

"Activate the webhook for my repo"

Webhook Configuration Details

When adding the webhook in GitHub, use these settings:

  1. Go to your repo → Settings WebhooksAdd webhook
  2. Paste the Payload URL provided by ContextForge
  3. Set Content type to application/json
  4. Paste the Secret provided by ContextForge
  5. Under "Which events would you like to trigger this webhook?" select Let me select individual events
  6. Check Pushes and Pull requests
  7. Click Add webhook

Tip: GitHub will send a "ping" to verify the webhook. You should see a green checkmark if successful.

Done! You're All Set

From now on, every git push you make (from any terminal, VS Code, or GitHub) will automatically be saved to your memory. No additional steps required.

GitHub Activity on Tasks

When commits and PRs are linked to a task (via the issue:<short_id> tag), they appear directly in the dashboard:

Badge on Task Cards

Task cards and list rows show a GitHub icon with the count of linked commits and PRs. Visible in both grid and list views.

Detail View Section

Opening a task shows a "GitHub Activity" section with the full list of linked commits and PRs, including SHA, author, and external links.

How linking works: When the MCP webhook processes a commit, it automatically tags the knowledge item with issue:<short_id> if the commit message or PR references a task. These tags are what connect commits to tasks in the UI.

Managing Connected Repositories

You can manage your connected repositories from the Account page in the dashboard. The GitHub Repositories section shows all connected repos with their sync status.

Activate / Pause Sync

Toggle webhook sync on or off without removing the repository.

View Webhook Info

Access the webhook URL and secret anytime to update your GitHub configuration.

Open in GitHub

Quick link to your repository on GitHub.

Disconnect

Remove the repository and all synced data. Don't forget to also delete the webhook in GitHub.

Querying Your Git History

Once commits are being saved, you can ask Claude about your project history:

# Recent activity

"What commits did I make today?"

# Feature-specific

"Show commits related to authentication"

# PR history

"What PRs were merged this week?"

# Summaries

"Summarize changes in the last sprint"

Importing Existing History

The webhook only captures new commits after setup. To import existing commits, use manual sync:

# Import last 50 commits

"Sync the last 50 commits from my repo"

Note: Manual sync requires a GitHub token for private repositories. The webhook works without a token because GitHub pushes the data directly.

What Gets Captured

Commits

  • Commit message
  • Author name and email
  • Timestamp
  • SHA hash
  • Files added/modified/removed
  • Commit type (feat, fix, docs, etc.)

Pull Requests

  • PR title and description
  • Author
  • Status (opened, merged, closed)
  • Source and target branch
  • Labels
  • Number of commits and changes

MCP Tools Reference

memory_git_connect

Connect a GitHub repository to start tracking commits and PRs.

ParameterTypeDescription
repo_urlstringGitHub URL or owner/repo format
space_idstring?Target space (creates "Git" space if not specified)
memory_git_activate

Activate or deactivate the webhook after configuring it in GitHub.

ParameterTypeDescription
repostringRepository in owner/repo format
activebooleantrue to activate, false to deactivate
memory_git_sync

Manually sync existing commits and PRs (requires GitHub token for private repos).

ParameterTypeDescription
repostringRepository in owner/repo format
sync_typestring?"commits", "prs", or "all" (default)
limitnumber?Max items to sync (1-100, default: 30)
memory_git_commits

List commits that have been synced to memory.

ParameterTypeDescription
repostring?Filter by repository (optional)
limitnumber?Max results (default: 50)
memory_git_prs

List pull requests that have been synced to memory.

ParameterTypeDescription
repostring?Filter by repository (optional)
limitnumber?Max results (default: 50)
memory_git_list

List all connected GitHub repositories.

memory_git_disconnect

Disconnect a repository and stop syncing.

ParameterTypeDescription
repostringRepository in owner/repo format

Use Cases

  • "What did we change in the last sprint?"

    Claude searches your synced commits to summarize recent changes

  • "Who worked on the authentication module?"

    Find commits and PRs related to specific features or files

  • "Why was this approach chosen?"

    PR descriptions often contain decision rationale and context

  • "Generate release notes for v2.0"

    Automatically compile changes between releases

Troubleshooting

Webhook shows "failed" in GitHub

Check that the webhook URL and secret are exactly as provided. The secret is case-sensitive.

Commits not appearing after push

Verify the webhook is activated with memory_git_list. Status should be "active".

Manual sync fails with 404

For private repositories, manual sync requires a GitHub token. The webhook works without a token because GitHub sends the data directly.