Command replay (a class of call, not one reported incident)
Stop an agent trying to throw away all uncommitted work
What happens
git reset --hard followed by git clean -fdx. The call below tries to throw away all uncommitted work. The agent sends it through its Bash tool, and it involves Git.
The call
git reset --hard && git clean -fdx
Tool: Bash. The replay uses placeholder tokens and hosts only.
Fix it without us
Commit or stash before the agent starts, and push the branch to a remote. Git can bring back committed work, but not untracked or ignored files, so keep a copy of files such as .env that git does not track.
What KYA does
Replay result: Stopped. In the replay test, the local hook denies the call and names the rule.
Rule git-hard-reset-clean, first stopped in version 0.33.0.
The hook is local and advisory. It fails open: if kya breaks or times out, the call goes ahead.
Install
For Claude Code, the host this replay ran on:
/plugin marketplace add The-Pixel-Boys/shield-kya
/plugin install kya@shield-kya
For any host:
npm i -g @shield-agent/kya@latest && kya start