# HyperTwist Git Cleanup Hygiene Protocol
## Date
2026-06-09

## Status
Active

## Mandatory rule for implementation and documentation work
Before any working-tree cleanup or state-changing Git command, we require an explicit checkpoint commit.

### Hard guardrail
1. If uncommitted changes exist, create a commit immediately before any command that can erase tracked file content (`git reset --hard`, `git clean -fd`, `git checkout -- <path>`, etc.).
2. Do not run destructive cleanup commands across uncommitted state.
3. Any reset sequence must be explicitly user-authorized in-channel before execution.
4. If a reset command is accidentally run, stop the task lane and create a recovery commit attempt from the HEAD snapshot first.

## Per-phase procedure
1. `git status --short` at phase start.
2. `git add -A` and `git commit -m "checkpoint: ..."`.
3. Re-open the phase only after the commit hash is confirmed.

## Recovery handling
If a hard reset appears in the reflog while files are needed:
- list the lost/remaining file set immediately,
- check for untracked snapshots,
- create a branch and recover state from latest safe commit before continuing.

