Skip to content

Reduce git safety prompt loops and retry friction #430

@shiny-code-bot

Description

@shiny-code-bot

Summary

The 2026-06-14 codex-skills rollout-friction audit found recurring git/worktree safety prompt friction. The prompts protect user work, which is correct, but the current flow can force repeated retries instead of making the safe path obvious before command execution.

Evidence

Source audit: cbusillo/codex-skills #339, run .local/rollout-friction/2026-06-14-audit-339/.

Relevant clusters from clusters-latest80.json:

  • blocked_git_safety_prompt (resolved_after_retries): 12 episodes, cost score 999, destination investigate-repo-workflow.
  • blocked_git_safety_prompt, repeated_command_failure (resolved_after_retries): 3 episodes, cost score 363, destination fix-script-or-helper.
  • A high-cost auto-review loop cluster also included blocked_git_safety_prompt together with repeated GitHub/git command failures.

The outcome mix was mostly resolved_after_retries, which means the guard eventually worked but added avoidable churn.

Desired Direction

Keep the safety model, but make the guarded path more deliberate and less retry-driven.

Possible improvements:

  • Preflight git/worktree status before risky commands and provide a concrete next safe action.
  • Distinguish protected default/shared branches from already-isolated task worktrees.
  • Make the confirmation wording point to branch/worktree creation or the exact blocked risk.
  • Avoid repeated prompts for the same safe branch/worktree decision within a single task where the state has not changed.
  • Surface a structured event/tag so rollout-friction can tell branch-protection safety from stale checkout, dirty worktree, detached worktree, or command misuse.

Acceptance Criteria

  • A normal task-branch workflow avoids repeated git safety prompt retries when branch/worktree state is already safe.
  • Default/shared branch protection still blocks direct implementation work unless explicitly approved.
  • The prompt/error tells the agent the next safe action, not just that the command was blocked.
  • Structured telemetry or log text allows rollout-friction to classify the guard reason.
  • Add or update harness tests for safe task branch, default branch, dirty worktree, and detached/auto-review worktree cases.

Relationships

Related to cbusillo/codex-skills #339 rollout-friction audit.
Related to #416 for stale auto-review scope/baseline behavior; this issue is specifically about git/worktree guard-loop ergonomics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions