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.
One-Time Setup (5 minutes)
Connect your repo and configure the webhook in GitHub. This is done once per repository with Claude's help.
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.
Connect via Dashboard (Recommended)
Go to Account Settings
Navigate to Dashboard → Account
Click "Connect Repository"
Enter your repository URL (e.g., owner/repo or full GitHub URL) and select a project.
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.
Activate
After adding the webhook in GitHub, click "I've Added the Webhook - Activate" to start syncing.
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:
- Go to your repo → Settings → Webhooks → Add webhook
- Paste the Payload URL provided by ContextForge
- Set Content type to
application/json - Paste the Secret provided by ContextForge
- Under "Which events would you like to trigger this webhook?" select Let me select individual events
- Check Pushes and Pull requests
- 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_connectConnect a GitHub repository to start tracking commits and PRs.
| Parameter | Type | Description |
|---|---|---|
| repo_url | string | GitHub URL or owner/repo format |
| space_id | string? | Target space (creates "Git" space if not specified) |
memory_git_activateActivate or deactivate the webhook after configuring it in GitHub.
| Parameter | Type | Description |
|---|---|---|
| repo | string | Repository in owner/repo format |
| active | boolean | true to activate, false to deactivate |
memory_git_syncManually sync existing commits and PRs (requires GitHub token for private repos).
| Parameter | Type | Description |
|---|---|---|
| repo | string | Repository in owner/repo format |
| sync_type | string? | "commits", "prs", or "all" (default) |
| limit | number? | Max items to sync (1-100, default: 30) |
memory_git_commitsList commits that have been synced to memory.
| Parameter | Type | Description |
|---|---|---|
| repo | string? | Filter by repository (optional) |
| limit | number? | Max results (default: 50) |
memory_git_prsList pull requests that have been synced to memory.
| Parameter | Type | Description |
|---|---|---|
| repo | string? | Filter by repository (optional) |
| limit | number? | Max results (default: 50) |
memory_git_listList all connected GitHub repositories.
memory_git_disconnectDisconnect a repository and stop syncing.
| Parameter | Type | Description |
|---|---|---|
| repo | string | Repository 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.