ConfigHub · Durable config for coding agents
Docs / docs/git-and-github.md Source on GitHub →

Git, GitHub and a hub, with the plugin

This page is for someone who uses the Claude plugin in a Git repository and wants to know what it does with Git and GitHub, whether they need the local hub, and how to add a hub later.

The walkthrough the Claude plugin ends with /confighub:to-hub, copying the record into a hub.

What goes wrong without it. Git keeps the latest value of each setting and the commit message, not why an agent set it. A teammate's agent, or a CI job's, starts from the files and undoes a change it was never told about. A pull request shows changed lines, not which values change and why.

What you get. The record of what agents changed, and why, kept with your commits. A comment on each pull request that lists every changed value. And a hub when you want approvals, whether it is your organization's shared hub or a hub of your own.

Git: there is nothing to connect

The Claude plugin works in any folder and any repository. It keeps its record on your machine, in ~/.confighub/agent-changes. Nothing leaves your machine unless you turn on a setting that sends it somewhere.

To keep the record with your commits, set CUB_MINI_RECORD_IN_REPO=1. Each commit an agent makes then carries .cub-mini/changes/SESSION.record, with its signature beside it. Anyone who checks the repository out gets it: a teammate, a CI job, or a sandbox with an empty home folder. Their agent is told what earlier agents changed in a file, and why, before it changes the file (in CI or a sandbox).

Where the app started

Before the first recorded request in a project, the Claude plugin keeps the repository and full Git revision present then, and whether uncommitted files existed. If Git or its history is unavailable, it records that no revision was available. bin/confighub mini changes shows Starting point, marked first observed. It is not proof of the app's creation date or the commit it was originally forked from.

The metadata is signed separately and checked by bin/confighub mini changes --verify. Repository URLs lose passwords, query strings and fragments. No private request or file contents go into it. It stays when old sessions expire; bin/confighub mini changes --forget removes it. With CUB_MINI_RECORD_IN_REPO=1, the signed record in Git carries it to a colleague's checkout. From plugin 0.79.8, after a successful standalone git clone or gh repo create --template … --clone, supported shell hooks also record the inspected checkout's remote and HEAD as a separate Selected source. A nested checkout keeps this observation when opened directly. A requested template name is recorded without guessing its revision. Compound shell commands, expressions, failed commands and checkouts outside the project are not inferred.

GitHub, with no hub

A hub, with no confighub mini

You need a hub for approvals: agents that propose, and a person who approves. If your organization has a ConfigHub, use it. You do not need the local hub.

  1. Install cub, ConfigHub's command-line tool, and sign in: cub auth login.
  2. In Claude Code, in the repository, type /confighub:to-hub. It names the hub your cub is signed in to, and lists what it would write: each file the record covers, and each change with its reason.
  3. Type /confighub:to-hub --yes to write it. Each file becomes a Component, and each recorded change a revision with its reason. Running it again writes only what was recorded since.

Then require approval for production, and give each agent a key of its own (approvals).

For a hub of your own, on your machine, type /confighub:to-hub --yes with no hub signed in: it starts one on this machine, downloading the local hub first if it is not here, and writes the record into it (install the local hub). To give an app a staging and a production copy of its settings too, type /confighub:staging in the app's folder instead. The other cub mini commands that move work between hubs, copy, connect and offer, come with the local hub (how the commands map).

A hub beside Git, with Git still delivering

If Argo CD or Flux deploys from Git, the hub can hold the approved copy while Git keeps delivering it:

  1. Take the repository in. cub local copy --from-git takes a commit's values into the hub, each with the commit's message as its reason.
  2. Change it in the hub. Agents propose, and the person you name approves.
  3. Write the approved copy out for Git. cub local copy COMPONENT --variant live --to-dir deploy/api writes a folder for each copy and a CHANGES.md that says why each value is set. Commit it on a branch, as a pull request.
  4. Check each pull request against the hub. The check compares the pull request's files with the hub's approved copy, value by value, and sets the status "ConfigHub: api-live" on the commit, named after the copy. A value nobody approved fails, and is named. Branch protection that requires the status lets only the approved copy merge (the check).

GitHub's runners must reach the hub to run the check in the pull request's own job, so that needs your organization's shared hub or a server of your own. With the local hub on a laptop, run the same check from the laptop, and it sets the same status: cub local copy COMPONENT --variant live --check-git deploy/api --github-status.

Or let the clusters deploy from the hub itself, over OCI, and keep Git for people to read (GitOps over OCI).

What branch protection then lets through

When main requires "ConfigHub: api-live", for administrators too, and the check runs from the approver's laptop:

Pull requestIts statusThe merge
The approved copy, written out from the hubsuccessmerged
The same, with 6 replicas typed in by handfailure: Deployment/api/spec.replicas is 6 here, 4 in the hubrefused
A change the check never ran onnonerefused
The 6 replicas again, merged by the repository's owner with administrator rightsfailurerefused: Required status check "ConfigHub: api-live" is failing.