Skip to content

loop-codex-stop-hook and loop-plan-file-validator have conflicting requirements when plan file lives under .humanize/ #203

@tony-nowatzki

Description

@tony-nowatzki

Summary

When an RLCR loop is started with --track-plan-file and the plan file is located under .humanize/plans/, the two hooks enforce contradictory git-tracking requirements:

  • loop-codex-stop-hook.sh calls git_has_tracked_humanize_state() which runs git ls-files -- .humanize and blocks exit if any file under .humanize/ is tracked.
  • loop-plan-file-validator.sh checks that the plan file is tracked in git (blocks with "Plan file is no longer tracked in git" if it isn't).

Since gen-plan defaults to placing output under .humanize/plans/, using --track-plan-file (which setup-rlcr-loop.sh enables automatically when the plan file is under .humanize/) creates an unresolvable conflict.

Steps to Reproduce

  1. Run /humanize:gen-plan --input <draft> — output goes to .humanize/plans/<slug>.md
  2. Run /humanize:start-rlcr-loop .humanize/plans/<slug>.md
    • Loop starts with plan_tracked: true in state.md
    • Plan file is committed to git
  3. Complete a round of work and attempt to exit
  4. Stop hook fires: "Detected tracked or staged files under .humanize/. Run git rm --cached -r .humanize"
  5. User runs git rm --cached -r .humanize to fix it
  6. Prompt hook fires on next message: "Plan file is no longer tracked in git"
  7. User must manually re-add and recommit the plan file
  8. Go to step 4 — infinite loop

Workaround

Move the plan file outside .humanize/ to a dash-separated path like .humanize-plans/<slug>.md which git_has_tracked_humanize_state() explicitly exempts (it only checks the .humanize/ prefix, not .humanize-*). Update state.md's plan_file: field to match.

Suggested Fix

Option A: git_has_tracked_humanize_state() should exclude .humanize/plans/ from its check when plan_tracked: true in state.md.

Option B: setup-rlcr-loop.sh should move the plan file to .humanize-plans/ (or another exempt path) when --track-plan-file is used, so the two hooks never conflict.

Option C: gen-plan should default to outputting plans to a non-.humanize/ path (e.g., .humanize-plans/ or plans/).

Environment

  • humanize plugin version: 1.16.0
  • Claude Code version: current

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions