Recovery capsules
The six captured domains, when a capsule is taken, where it is stored, and per-domain restore.

Two kinds, one mechanism
A capsule is an ordinary directory of files on disk. A checkpoint is a capsule of type light checkpoint. There is no second mechanism hiding behind the second word. Two kinds exist in this edition:
- Light checkpoint (
chk-…): refs,HEAD, reflogs, the binary index, your staged and unstaged changes as patches, and Git operation markers. - Standard capsule (
cap-…): everything above, plus an archive of your untracked files and a fullgit bundleof the repository’s objects and refs.
The create dialog offers only those two. full, repair-evidence and team-support are reserved for a later phase and the store rejects them.
The six domains
A restore is chosen per domain, so these are worth knowing individually rather than as one word.
| Domain | What is captured |
|---|---|
| Refs | Every ref with its oid: local branches, remote-tracking branches, tags, notes and GitAegis’s own refs/aegis/ namespace, as the ref tree, packed-refs and the reflogs. Plus HEAD: its symbolic target when attached, its oid when detached. |
| Index | The index file byte for byte, including the stage entries of a conflicted merge: stage 1 (base), stage 2 (ours), stage 3 (theirs). |
| Staged changes | git diff --cached --binary against HEAD. The content of what you had staged, not a list of which files changed. |
| Working changes | git diff --binary. Modifications to tracked files that had not been staged. |
| Untracked files | An uncompressed tar of files Git does not know about yet, built from git ls-files --others --exclude-standard and size-bounded. Standard capsules only. |
| Operation state | What Git was in the middle of: MERGE_HEAD, CHERRY_PICK_HEAD, REVERT_HEAD, BISECT_LOG, ORIG_HEAD, FETCH_HEAD, MERGE_MSG. Read the limits article before relying on this one. |
What one capsule directory holds
This is also the answer to “what would leave my machine if I sent someone a capsule”.
| Entry | Contents |
|---|---|
manifest.json | id, repository, label, HEAD ref and oid, Git version, retention expiry, skipped untracked paths, capture notes |
checksums.json | a SHA-256 for every other entry: what the restore-time integrity check reads |
HEAD | the raw .git/HEAD file |
refs/ | a recursive copy of .git/refs |
packed-refs | copied when the repository has one |
reflogs/ | a recursive copy of .git/logs: includes commit subjects and author identities |
index.original | the binary .git/index, byte for byte |
index-metadata.json | whether an index was present at all |
staged.patch | git diff --cached --binary |
unstaged.patch | git diff --binary |
operation-state/ | one file per marker found, or a single none entry |
config.sanitized | git config --local --list with credential-bearing lines stripped. Evidence only, never written back |
untracked-files.tar | standard capsules only; uncompressed |
repository.bundle | standard capsules only; git bundle create --all, readable by Git with GitAegis nowhere in sight |
When a capsule is taken
Automatically, before the operation runs, decided by the plan’s risk level:
- A caution-risk operation takes a light checkpoint.
- A destructive-risk operation takes a standard capsule.
- Lower-risk operations take none, because they remove nothing.
- Three operations take none even when risky (removing a worktree, updating a submodule and fetching LFS objects) because a capsule of the primary worktree genuinely could not restore them, and advertising one would be a lie.
Capsules are also taken automatically before every Doctor repair, before every maintenance task, and before every restore.
If the capture fails, the operation is blocked and never runs. GitAegis reports that the safety checkpoint could not be created and that the operation was not executed. No control in the interface waives that.

Manually: press ⌘K and run Create Recovery Capsule, or use Doctor (⌘5) → Capsules → create.
Where capsules are stored
~/Library/Application Support/dev.gitaegis.app/aegis/capsules/<repository-id>/<capsule-id>/Outside your repository, so a capsule survives operations that rewrite .git, and on this Mac only. The capsule index (id, repository, kind, label, expiry, pinned) is a table in ~/Library/Application Support/dev.gitaegis.app/aegis/app.db; the content is the directory.
Restoring, domain by domain
Doctor (⌘5) → Capsules → pick a capsule → Restore. Domains the capsule did not capture are disabled in the dialog and marked not captured, rather than offered and then quietly skipped. Choosing Complete state restores every restorable domain in that particular capsule. It does not imply that a light checkpoint has an untracked-file archive.

What happens, in order:
- Integrity is verified. Every entry is re-checked against
checksums.json. A corrupt capsule is refused outright. It is never partially applied. - A fresh standard capsule is taken of the current state, and becomes the rollback target for the restore itself. Restoring is not a one-way door.
- The selected domains are applied. Refs move by compare-and-swap (
git update-ref <name> <oid> <current>), so a ref that has moved since capture is refused and reported rather than silently overwritten.HEADis restored by writing.git/HEAD. The index is written back byte for byte. Staged changes are applied withgit apply --cached, and skipped if you also selected the index, which already carries them. Working changes are applied withgit apply. Untracked files are extracted from the tar, and an existing file is never overwritten. A collision is written alongside as<path>.restored,<path>.restored-2and so on, with the count reported. - Postconditions are checked.
HEADmust resolve andgit status --porcelain=v2must parse. If a check fails, or any ref update was refused, the operation ends asrequires-interventionwith the exact list, never as a silent partial success.
Undo
The repository toolbar has an Undo action. It finds the most recent succeeded or partially-succeeded operation that has both a rollback plan and a checkpoint, and restores that checkpoint with all domains selected. If nothing qualifies it says Nothing to undo rather than doing something approximate.
Retention: ninety days, then gone
Every capsule is stamped with an expiry 90 days after it was created. Expired capsules are deleted, and the deletion is permanent. Shortly after each launch GitAegis removes every capsule whose stamp has passed, deletes its directory, and reports how many went and how much disk that freed. A capsule holds copies of your repository content, so a removed one cannot be recovered from anywhere in the app.
Three kinds are never removed:
- Pinned capsules, whatever their stamp says.
- Capsules referenced by an operation that never finished. They are the rollback for work still in flight, so they survive until it resolves.
- Capsules that have not yet expired. The stamp decides, not the age.
The same pass reclaims capsule directories left without a database row, which is what a crash midway through writing a capsule leaves behind.
To pin one, use the pin control on its card in Doctor → Capsules. The pin is written to the catalogue immediately and the card re-reads the stored row, so what you see after the click is what the next sweep will see. Unpinning is equally real: an unpinned capsule past its expiry goes on the next sweep.
One consequence to know before you need it: if a Flight Recorder event pointed at a capsule that has been removed, the event stays on the timeline but loses its checkpoint link. Restore on it then recreates deleted ref pointers only, and no longer offers index, staged or working-tree domains it cannot deliver.