New to Claude Skills? Learn how to install them →

davila7 on GitHub

Git Context Controller

Free

Manage agent memory with versioned file system.

Get this skill

Free · Opens the source repo

What Git Context Controller does

The Git Context Controller (GCC) skill enhances the memory management capabilities of AI agents by structuring memory as a versioned file system under .GCC/. This skill is particularly useful for developers and designers working on multi-step projects where tracking progress, experimenting with different approaches, and recovering context across sessions is essential. By mimicking Git's operations, GCC provides a familiar framework for managing project milestones and branching for alternative strategies.

GCC operates through four primary commands: COMMIT, BRANCH, MERGE, and CONTEXT. The COMMIT command allows users to save milestones, capturing essential details about the work completed. The BRANCH command creates isolated workspaces for testing new ideas without disrupting the main project flow. Once an experiment is complete, the MERGE command integrates the findings back into the main project, ensuring that valuable insights are preserved. The CONTEXT command enables users to retrieve historical project information, helping to maintain continuity in ongoing work.

The initialization process sets up the necessary directory structure, including files for commit history, execution logs, and branch-specific summaries. Users can configure GCC's behavior through a metadata.yaml file, allowing for proactive commits that suggest saving progress after significant tasks. This proactive feature can help prevent loss of context and streamline workflows.

GCC is ideal for developers and designers who require structured memory management in their projects. It is particularly beneficial for those working with complex tasks that involve multiple iterations and experimentation. By providing a clear overview of project progress and facilitating easy access to historical context, GCC supports efficient project management and enhances productivity.

When to use it

Use GCC when working on multi-step projects that require tracking of progress, experimentation, and recovery of context across sessions.

When not to use it

GCC may not be suitable for simple projects or tasks where version control and structured memory management are not necessary.

What you can build with it

Tracking Project Milestones

Use GCC to commit progress at key milestones in your project, ensuring that you have a detailed history of what has been accomplished.

Experimenting with Alternatives

Create branches to explore different approaches without affecting the main project, allowing for safe experimentation.

Recovering Context Across Sessions

Utilize the CONTEXT command to retrieve historical project information, making it easier to resume work after a break.

How to install Git Context Controller

View source

1. Install with the skills CLI

npx skills add davila7/claude-code-templates/git-context-controller --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by davila7

Git Context Controller (GCC)

Overview

GCC transforms agent memory from a passive token stream into a structured, versioned file system under .GCC/. Inspired by Git, it provides four operations — COMMIT, BRANCH, MERGE, CONTEXT — to persist milestones, explore alternatives in isolation, synthesize results, and recover historical context efficiently.

Initialization

On first use, check if .GCC/ exists in the project root. If not, run scripts/gcc_init.sh to create the directory structure:

.GCC/
├── main.md          # Global roadmap and objectives
├── metadata.yaml    # Infrastructure state (branches, file tree, config)
├── commit.md        # Commit history for main branch
├── log.md           # OTA execution log for main branch
└── branches/        # Isolated workspaces for experiments
    └── <branch-name>/
        ├── commit.md
        ├── log.md
        └── summary.md

For detailed file format specifications, read references/file_formats.md.

Configuration

GCC behavior is controlled via metadata.yaml:

  • proactive_commits: true — Automatically suggest commits after completing coherent sub-tasks
  • proactive_commits: false — Only commit when explicitly requested

Toggle with: "enable/disable proactive commits" or by editing metadata.yaml.

Commands

COMMIT

Persist a milestone on the current branch.

Triggers: /gcc commit <summary>, "commit this progress", "save this milestone", "checkpoint"

Procedure:

  1. Read the current branch's commit.md to determine the next commit number
  2. Append a new entry to commit.md with:
    • Sequential ID (e.g., [C004])
    • Date (UTC ISO 8601)
    • Current branch name
    • Branch purpose (from summary.md if on a branch, or from main.md)
    • Previous progress summary (1-2 sentences from last commit)
    • This commit's contribution (detailed technical description with files touched)
  3. Append an OTA entry to log.md recording the commit action
  4. Update metadata.yaml file tree if files were created/modified
  5. If on main branch, update milestones section in main.md

Proactive behavior: When proactive_commits: true, suggest a commit after:

  • Completing a function, module, or coherent unit of work
  • Fixing a bug and verifying the fix
  • Finishing a research/exploration phase with conclusions
  • Any point where losing context would mean re-doing significant work

BRANCH

Create an isolated workspace for exploring an alternative approach.

Triggers: /gcc branch <name>, "branch to try...", "explore alternative...", "experiment with..."

Procedure:

  1. Create .GCC/branches/<branch-name>/ directory
  2. Create summary.md with: purpose, parent branch, creation date, key hypotheses
  3. Create empty commit.md and log.md for the branch
  4. Update metadata.yaml to register the new branch
  5. Update main.md Active Branches section
  6. Log the branch creation in the parent branch's log.md

From this point, all COMMITs and OTA logs go to the branch-specific files until a MERGE or explicit branch switch.

MERGE

Integrate a completed branch back into the main flow.

Triggers: /gcc merge <branch>, "merge results from...", "integrate the experiment", "branch X is done"

Procedure:

  1. Read the branch's summary.md and commit.md to understand outcomes
  2. Append a synthesis commit to main's commit.md summarizing:
    • What was tried
    • What was learned
    • What is being integrated (or why the branch is being abandoned)
  3. Update main.md:
    • Add milestone entry with branch results
    • Remove from Active Branches
    • Update objectives if applicable
  4. Update metadata.yaml: set branch status to merged or abandoned
  5. Log the merge in main's log.md

CONTEXT

Retrieve historical memory at different resolution levels.

Triggers: /gcc context <flag>, "what did we do on...", "recover context", "show me the history", "where were we"

Flags:

  • --branch [name] — Read summary.md and latest commits for a specific branch (or current branch if no name). Provides high-level understanding of what happened and why.

  • --log [n] — Read last N entries (default 20) from the current branch's log.md. Provides fine-grained OTA traces for debugging or resuming interrupted work.

  • --metadata — Read metadata.yaml to recover project structure: file tree, dependencies, active branches, configuration.

  • --full — Read main.md for the complete project roadmap, all milestones, and active branches. Use for cross-session recovery or handoff to another agent.

When no flag is specified, default to --branch for the current active branch.

OTA Logging

Throughout all work (not just during explicit commands), maintain the OTA execution log:

  1. Observation: What was noticed or discovered
  2. Thought: Reasoning about what to do next
  3. Action: What action was taken

Append entries to the active branch's log.md. Keep a maximum of 50 entries; when exceeding, remove the oldest entries. Each entry includes a sequential ID, timestamp, and branch name.

Log OTA entries at meaningful decision points — not every single action, but significant observations, strategy changes, and outcomes.

Cross-Session Recovery

When starting a new session on an existing project with .GCC/:

  1. Read metadata.yaml to understand project state and active branches
  2. Read main.md for the global roadmap and objectives
  3. Read the active branch's latest commits and log entries
  4. Resume work with full context of what was accomplished and what remains

Natural Language Mapping

User saysCommand
"save/checkpoint/persist this"COMMIT
"try a different approach"BRANCH
"that experiment worked, integrate it"MERGE
"where were we?" / "what's the status?"CONTEXT --full
"what happened on branch X?"CONTEXT --branch X
"show recent activity"CONTEXT --log
"what files do we have?"CONTEXT --metadata
"enable/disable auto-commits"Toggle proactive_commits in metadata.yaml

Frequently asked questions about Git Context Controller

Similar skills