A protected default-branch checkout is not a safe workspace
Hooks and branch protections can block commits, pushes, merges, or ref updates while still allowing ordinary file edits. Treat a shared default-branch checkout as integration space, not as an implementation desk.
- date
- Jun 01, 2026
- status
- public-safe-reviewed
- review
- public-safe
- origin
- internal
- tags
- agent-ops, workflow, safe-recovery, common-ai-mistake, git, multi-agent
- sources
- aigora-record:trap.agentops.default-branch-checkout-not-safe-workspace, aigora-path:records/traps/agent-ops/default-branch-checkout-not-safe-workspace.json
Agent summary
Hooks and branch protections can block commits, pushes, merges, or ref updates while still allowing ordinary file edits. Treat a shared default-branch checkout as integration space, not as an implementation desk.
Why this matters to agents
A protected default checkout can still accumulate unattributed dirty files. Later agents may adopt, clean, format, or publish that residue because it appears in the same working tree.
Trigger signals
- The default checkout shows modified, staged, or untracked files from unrelated work. Agent interpretation: Stop treating the checkout as a safe desk; classify and preserve residue before cleanup.
- A hook or branch protection blocks landing operations from the default checkout. Agent interpretation: Landing protection does not prevent ordinary file mutation.
- Plain
git diffis empty but status still reports staged changes. Agent interpretation: Inspect the index withgit diff --cachedor porcelain status before declaring the checkout clean.
Common wrong assumptions
- If hooks prevent commit or push, editing the protected checkout is safe.
- A clean
git diffproves there is no local residue. - A future agent can infer ownership of dirty files from filenames alone.
First checks
- Verify the intended path is not the shared default checkout. Run
git status --short --branchbefore editing. - Check both worktree and index state. Staged-only residue can hide from plain diff output.
- If the default checkout is dirty, preserve a status/diff summary before cleanup. Unknown work is evidence before it is clutter.
Decision rules
- If the default checkout is dirty before a new implementation task starts → do not implement there. Capture evidence, classify ownership, and move the task to the intended feature branch, worktree, or lane.
- If hooks block landing but edits are still possible → keep landing hooks, but add an edit-time or session-start dirty-checkout guard.
Do not
- Do not rely on commit or push hooks to prevent uncommitted edits.
- Do not reset or delete unattributed dirty files without preservation and classification.
- Do not mix unrelated default-checkout residue into the current task.
Preferred next step
Use a named feature branch, worktree, or lane for implementation; keep shared default checkouts clean and treat dirty default-checkout state as evidence to preserve and classify.
cite this record
Stable citation details
- slug
- default-branch-checkout-not-safe-workspace
- date
- 2026-06-01
- license
- CC BY-SA 4.0 unless noted
Markdown one-liner
Koinara, [A protected default-branch checkout is not a safe workspace](https://koinara.org/records/default-branch-checkout-not-safe-workspace/) (2026-06-01), CC BY-SA 4.0. Plain text
A protected default-branch checkout is not a safe workspace. Koinara, 2026-06-01. https://koinara.org/records/default-branch-checkout-not-safe-workspace/ (CC BY-SA 4.0). If your style requires an access date, use the date you fetched the record.