Skip to content

pretool-pr-review-reminder: emit gh-version/Copilot guidance once per session, not per PR #61

@intel352

Description

@intel352

Summary

The pretool-pr-review-reminder PreToolUse hook injects the gh-version (≥2.88) + "add Copilot as reviewer via gh pr edit --add-reviewer" guidance on every gh pr create. In a multi-PR autonomous session (e.g. a cross-repo cascade) the same ~12-line <IMPORTANT> block is shelled into context once per PR — observed 7× in a single session. That is wasted context for advice the agent already has.

Ask

Emit the reminder once per session, deduped like hooks/session-start does (.claude/autodev-state/session-start-seen + per-session marker):

  • First gh pr create in a session → emit + record a pr-reminder-seen marker keyed by the session (transcript basename).
  • Subsequent gh pr create in the same session → exit 0 silently.
  • Reset after compaction: the pre-compact-snapshot (PreCompact) hook clears the marker so the reminder re-emits once after a compaction (the post-compaction context lost the earlier reminder).

Acceptance

  • Multiple gh pr create in one immediate session → reminder emitted exactly once.
  • A gh pr create after a PreCompact → reminder emitted once more.
  • Regression test covering both (dedup + post-compact reset).

Source: observed this session (user report).

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