Core Concepts

Branching

Contxt supports branches — isolated memory contexts that mirror your git workflow. Capture decisions and patterns per-branch, then merge or compare across branches as your project evolves.

How branches work

Every memory entry belongs to a branch. By default, entries are created on main. When you switch branches, Contxt filters context to that branch — so your AI only sees decisions relevant to the work in progress.

Branches are independent of git — you can name them anything. The convention is to match your git branch name so hooks can auto-switch context.

Branch commands

contxt branch list

List all branches and their entry counts.

contxt branch switch <name>

Switch to a branch (creates it if it doesn't exist). All subsequent entries are added to this branch.

contxt branch create <name>

Create a new branch without switching to it.

contxt branch merge <name>

Merge entries from the named branch into the current branch. Duplicate entries (matched by title) are skipped.

contxt branch delete <name>

Delete a branch and all its entries. You cannot delete the currently active branch — switch away first.

Automatic branch switching

When the post-checkout git hook is installed, Contxt automatically switches its context branch to match your current git branch:

contxt hook install

After installation, every git checkout or git switch silently updates your active Contxt branch.

Use cases

  • Feature branchesCapture decisions specific to a feature (e.g. "use optimistic updates here") without polluting main context.
  • ExperimentsPrototype on a branch. If the experiment is scrapped, the context is cleanly isolated and won't confuse future AI sessions.
  • Time travelView what your context looked like at any point by switching to a historical branch snapshot.