Safe Mode
What triggers it, what it locks, why it pins core.hooksPath=/dev/null, and how to leave it.

It is a conclusion, not a switch
Safe Mode is not a setting you turn on. It is a state GitAegis derives from Doctor’s evidence, and it means one thing: the repository’s index or HEAD cannot be trusted. It is set when any of these is true:
- reading
.git/indexfailed; - the index signature is wrong;
- the index checksum is wrong;
- the index is truncated;
- reading
HEADfailed.
It appears as a banner above every Doctor tab, a chip in the status bar, a badge on the repository card, and a badge on Doctor’s overview. It applies to one repository, not to the application.
What it locks
- This repository’s hooks do not run. Every Git subcommand GitAegis spawns for a Safe Mode repository carries
core.hooksPath=/dev/null, including the write subcommands a repair issues. - No account or provider state can unlock a mutation. The Safe Mode refusal is decided locally. Optional update, account, AI, or provider traffic cannot authorize or execute a Git operation.
- Maintenance tasks are refused.
- This repository’s configuration is not written. Saving an author identity to repository scope is refused; saving it to your global configuration is not, because your own config file is not the damaged repository.
- Mutating controls are disabled in the interface: fetch, pull, push, force push, create branch, create stash, apply stash, staging and unstaging, the commit composer, conflict resolution, and the Flight Recorder’s Resume, which is the same sequencer continue as Work’s, so it is held by the same rule. Each disabled control explains why on hover.

Read paths stay open. History, diffs, refs and the Flight Recorder are all still readable, because diagnosis needs reading and reading cannot make it worse. Capsule restore and Lost Work both work in Safe Mode; they are part of the reason it exists.
Why core.hooksPath is pinned to /dev/null
A hook is a program the repository asks Git to run. On a repository whose index or HEAD is already untrustworthy, running its programs during a diagnosis or a repair adds an uncontrolled write to a situation that exists because writes went wrong. Pinning core.hooksPath to /dev/null through the pinned GIT_CONFIG_* environment is the one way to hold that off from outside the repository, because a repository’s own configuration cannot override it. Outside Safe Mode your hooks still run on write paths, as they should.
Two things Safe Mode does not do
- External diff and merge tools are never run, in any mode. That is a property of every GitAegis invocation, not a Safe Mode protection. Earlier wording gave Safe Mode credit for it; it does not deserve the credit.
- Content filters are not sandboxed. A
filter.<driver>declared by the repository’s own.gitattributescan still run during a repair that restores files:merge --abortandrebase --abortmaterialise the working tree, which is precisely what those repairs are for. Git offers no way to disable filters wholesale from the command line, so this claim was retracted rather than implemented. If a repository’s filters are themselves suspect, repair it from a shell instead.
How to leave it
Safe Mode is a symptom, not a fix, and there is no control that dismisses it. Run a fresh scan from Doctor → Overview, read the findings, and apply the recommended repair. Every repair takes a mandatory capsule first. There is no override for that. When the underlying evidence clears, the state clears with it.
A damaged index is usually the easiest of these to survive, because the index can be rebuilt from HEAD and your files are untouched:
cd /path/to/repository# keep the evidencecp .git/index /tmp/broken-indexrm .git/index# rebuilds the index from HEADgit resetgit status
If GitAegis has a capsule from before the damage, restoring its index domain is the better route, because it preserves staging.