Git Automation Pipelines
Relevant source files
The following files were used as context for generating this wiki page:
Git Automation Pipelines in Continuous Claude-v2 represent orchestrated workflows that chain multiple Model Context Protocol (MCP) tools to perform complex version control analysis and repository management. These pipelines are implemented as "Scripts"—agent-agnostic Python workflows that utilize CLI arguments to drive multi-step git operations without requiring manual file edits or high token overhead.
Sources: scripts/README.md, scripts/multi_tool_pipeline.py:1-15, CLAUDE.md
Pipeline Architecture and Execution
The pipeline architecture transitions from simple single-tool calls to complex orchestration via Python scripts. This "Scripts-Based Execution" is the preferred method for workflows involving more than two tools, providing up to a 99.6% reduction in token usage compared to writing custom logic from scratch in every session.
Execution Flow
Pipelines follow a specific operational pattern:
- Discovery: Identifying available pipelines via
ls scripts/. - Analysis: Reviewing pipeline documentation and arguments via
cat scripts/{script}.py. - Execution: Running the pipeline via the
runtime.harnesswith specific CLI arguments (e.g.,--repo-path,--max-commits).
Sources: CLAUDE.md, scripts/SCRIPTS.md, scripts/multi_tool_pipeline.py:27-35
Git Analysis Pipeline Components
A typical git analysis pipeline orchestrates the following sequential tool calls:
The diagram shows the sequential execution of git MCP tools within the multi_tool_pipeline.py script to generate a comprehensive repository snapshot.
Sources: scripts/multi_tool_pipeline.py:43-73
Metadata Collection and Environment Integration
Pipelines also integrate with shell-based metadata collection to capture the current state of the repository environment. This includes branch names, commit hashes, and the status of the "thoughts" system.
Metadata Extraction Logic
The spec_metadata.sh utility identifies repository details by interacting directly with the git work tree:
- Commit Hash: Retrieved via
git rev-parse HEAD. - Branch Name: Identified via
git branch --show-current. - Repository Root: Resolved via
git rev-parse --show-toplevel.
Sources: scripts/spec_metadata.sh:7-17
Component Summary Table
| Component | Type | Primary Function | Source File |
|---|---|---|---|
multi_tool_pipeline.py | Python Script | Orchestrates Git status, log, and branch tools. | scripts/multi_tool_pipeline.py |
spec_metadata.sh | Shell Script | Collects environment-specific Git and system metadata. | scripts/spec_metadata.sh |
runtime.harness | Execution Harness | Asyncio-based wrapper for running pipelines with MCP. | CLAUDE.md |
mcp-server-git | MCP Server | Provides the underlying git capability primitives. | scripts/multi_tool_pipeline.py |
Pipeline Tool Orchestration
The multi_tool_pipeline.py demonstrates a sophisticated tool chaining pattern. It utilizes the call_mcp_tool interface to interact with the mcp-server-git in three distinct steps.
Sequence of Operations
The pipeline performs a deep analysis of a local repository as follows:
The sequence diagram illustrates the communication flow between the script, the execution harness, and the MCP server during a git analysis cycle.
Sources: scripts/multi_tool_pipeline.py:43-73
Parameters and Constraints
The Git pipelines are designed with immutability of logic but flexibility of parameters.
| Parameter | Type | Default | Description |
|---|---|---|---|
--repo-path | String | . | Target path for git operations. |
--max-commits | Integer | 10 | Depth of historical analysis. |
Sources: scripts/multi_tool_pipeline.py:23-24, scripts/SCRIPTS.md
Significance in Continuous Claude
Git Automation Pipelines are critical for maintaining "Session Continuity." By capturing reasoning per commit in .git/claude/commits/*/reasoning.md and using automated commit skills, the system ensures that decisions made during development are preserved even after the Claude session context is cleared. This approach enables the "Clear > Compact" philosophy, where the context is wiped for fidelity, and the state is reloaded from persistent git-tracked ledgers.
Sources: CLAUDE_ONBOARDING.md, CLAUDE.md