Persist user-driven post-creation decisions as GitHub comments
Summary
When users interact with Claude after an artifact has already been posted to GitHub — pushing back on decisions, providing additional context, reclassifying severity of review findings, or clarifying architectural intent — these insights are lost when the session ends. Commands should capture significant post-creation changes and persist them as GitHub comments so they inform future sessions (planning, implementation, review).
Current Behavior
User pushback that occurs before artifacts are created on GitHub is captured properly — the artifact reflects the user's input when it is first posted. However, when a user provides feedback after the artifact is already on GitHub (e.g., reclassifying a review finding's severity after the review comment is posted, adding architectural context to a plan after it has been published, rejecting a proposed approach with rationale after a comment is already up), these changes are not persisted. The next session starts fresh with only the original posted content, missing the nuance that emerged during conversation.
Proposed Behavior
Commands that post artifacts to GitHub and then continue interacting with the user should identify when significant context changes occur post-creation and append follow-up comments to the relevant GitHub issue or PR. Specifically:
- When a user reclassifies the severity or disposition of a review finding after the review has been posted, the updated assessment should be reflected in a follow-up comment.
- When a user provides architectural rationale or constraints that affect a plan after the plan has been published, those should be captured on the issue.
- When a user rejects a proposed approach and explains why after the recommendation has been posted, the rejection and reasoning should be documented.
Not everything warrants documentation — only changes that affect future work: planning, design, architecture, and implementation decisions. Routine approvals and minor wording tweaks should not generate additional comments.
As a secondary benefit, this work may also improve how commands generally capture and convey user intent in their directives.
Acceptance Criteria
- Commands that post artifacts then continue user interaction (e.g.,
pr-review,pr-review-validate,issue-plan,issue-review-plan,issue-assessment) capture significant post-creation user-driven changes as follow-up GitHub comments - "Significant" is scoped to changes that affect future sessions: severity reclassifications, architectural decisions, rejected approaches with rationale, added constraints or context
- Pre-creation feedback continues to work as it does today (incorporated into the initial artifact)
- Routine approvals ("looks good", "approve") and minor wording tweaks are not documented
- Each persisted follow-up comment clearly attributes the change to user input (e.g., "User context: ..." or "Decision update: ...")
- Existing command workflows are not disrupted — persistence happens as an additional step, not a gate
Technical Notes
- The most impactful commands to update are those that post to GitHub and then continue interacting:
pr-review,pr-review-validate,issue-plan,issue-review-plan,issue-assessment - Implementation likely involves adding a "persist session decisions" step near the end of each affected command, after the artifact has been posted and user interaction has concluded
- The
pushcommand already posts progress comments — a similar pattern can be used for decision capture - Care should be taken to avoid noisy or redundant comments; a heuristic or user confirmation may be needed to decide what qualifies as "significant"
Independent Assessment
Key Finding: Pre-creation vs. Post-creation Feedback
The issue describes persisting user feedback that occurs after artifacts are posted to GitHub. After tracing through all five target commands, only pr-review has genuine post-posting user interaction (Step 8: deferred-item handling). The other four commands capture user feedback before posting — approval gates and modification loops conclude before the gh write, so the artifact already reflects user input.
The actual gaps break down differently than expected:
| Command | Post-posting interaction? | Unpersisted information |
|---|---|---|
pr-review |
Yes (deferred-item handling) | Which deferred items became issues, which were skipped, and why |
pr-review-validate |
No | "Skip posting" path leaves no GitHub trace that validation ran |
issue-plan |
No | Q&A rationale (Step 4) and architecture choice reasoning (Step 5) not recorded |
issue-plan-review |
No | "Proceed as-is" path leaves no record that a review was conducted |
issue-assessment |
No | "Cancel" path leaves no record |
This means the feature naturally splits into two related but distinct concerns:
- Post-creation decision capture (only
pr-review): Persist the outcomes of Step 8 deferred-item handling. - Decision rationale capture (all commands): Persist why choices were made (architecture selected, findings accepted/rejected, items skipped) as structured follow-up comments, even though those decisions happen before posting.
Naming Correction
The issue body references issue-review-plan — this was renamed to issue-plan-review in commit e9c38a6.
Design Considerations
- Significance heuristic: A simple approach is user confirmation ("Post a summary of the decisions made in this session?") rather than auto-detection. This avoids the complexity of classifying what's "significant" and gives users explicit control over comment noise.
- Comment format: Could follow the existing marker pattern (e.g.,
<!-- mach10-decisions -->) for machine-readability, or be freeform likepush.mdprogress comments if the primary audience is humans in future sessions. - No consumers yet: Downstream commands (
pr-review-fix,issue-implement) don't currently read decision comments. The initial value is as a human-readable audit trail; machine consumption can be added later.
Scope Estimate
Medium complexity, 2-3 implementation stages:
- Pattern design and
pr-review(the only true post-creation case) - Decision rationale capture for
issue-planandissue-plan-review - No-write exit path recording for
pr-review-validateandissue-assessment
The "secondary benefit" (improving how commands convey user intent in directives) should be deferred to avoid scope creep.
Implementation Plan: Persist User-Driven Post-Creation Decisions
Overview
Add decision persistence to five commands that post artifacts to GitHub and then continue user interaction. When users make significant decisions that aren't captured in the posted artifact, a follow-up comment (or inline section) records the decision for future sessions.
Architecture: Pragmatic Balance -- Each command has prescriptive, deterministic triggers for when to post decision comments. No open-ended significance judgment. Concrete line-count caps for noise control.
Marker convention: <!-- mach10-decisions --> HTML marker on all follow-up decision comments (first line of body). For issue-plan.md, decision rationale goes inline in the plan comment as a ## Decision Log section.
Stage 1: CLAUDE.md -- Decision Marker Sync Documentation
Goal: Document the new marker convention before modifying commands.
Files:
CLAUDE.md-- Add decision-comment marker sync entry to Writing Commands section
What to add:
- New bullet after "Duplicate-issue detection sync" documenting
<!-- mach10-decisions -->marker - Lists all five emitting locations (pr-review, pr-review-validate, issue-plan-review, issue-assessment) plus the Decision Log variant in issue-plan
- Notes the sync requirement: any change to the marker or Decision Log convention must be applied to all locations
Stage 2: issue-plan.md -- Embedded Decision Log
Goal: Capture Q&A answers and architecture choice reasoning directly in the plan comment.
Files:
commands/issue-plan.md-- Expand Step 7 plan comment body specification
Changes:
- Add a fourth bullet to the plan comment body requirements: a
## Decision Logsection appended after the staged breakdown - Decision Log includes: (a) synthesized Q&A from Step 4 (question/answer pairs, only decisions that shaped the plan), (b) architecture approach selected in Step 5 with rationale
- Omission condition: skip the section if Step 4 produced no questions AND Step 5 had no meaningful differentiation between approaches
- No new
ghCLI call -- expands the existing comment body
Dependencies: Stage 1 (CLAUDE.md documents the convention first)
Stage 3: issue-assessment.md -- Cancel-Path Decision Comment
Goal: Record assessment findings when user cancels without acting.
Files:
commands/issue-assessment.md-- Extend Step 6 Cancel branch
Changes:
- After "confirm that no changes were made", add instruction to post a
<!-- mach10-decisions -->comment on the issue - Content: that an assessment ran, user chose not to act, condensed Summary and Gaps from Step 4 (2-3 sentences each)
- Guard: only post if Step 4 assessment was completed (not if cancelled before findings were presented)
- Size cap: under 15 lines
Dependencies: Stage 1
Stage 4: issue-plan-review.md -- Proceed-as-is and Cancel Decision Comments
Goal: Record when user proceeds past Critical/Important findings or cancels after review.
Files:
commands/issue-plan-review.md-- Extend Step 5 for "Proceed as-is" and "Cancel" paths
Changes for "Proceed as-is":
- Post
<!-- mach10-decisions -->comment listing Critical and Important findings (one line each) and noting user chose to proceed without changes - Guard: do NOT post if all findings were Suggestions only (proceeding past suggestions is the expected path)
- Size cap: under 15 lines
Changes for "Cancel":
- Post
<!-- mach10-decisions -->comment with finding counts by severity, noting session ended without updating or proceeding - Size cap: 5 lines or fewer
Dependencies: Stage 1
Stage 5: pr-review-validate.md -- Skip-Posting Decision Comment
Goal: Record when user skips posting the validation assessment.
Files:
commands/pr-review-validate.md-- Extend Step 5 "Skip posting" branch
Changes:
- After skipping, post a lightweight
<!-- mach10-decisions -->comment on the PR - Content: validation ran, user chose not to post, finding counts (N genuine, N nitpicks, N false positives, N deferred) -- no individual finding details
- "Modify before posting" path: NO separate decision comment (the modified and posted assessment IS the record)
- Size cap: 5 lines or fewer
Dependencies: Stage 1
Stage 6: pr-review.md -- Deferred-Item Decision Comment
Goal: Record the disposition of each deferred review finding after Step 8 handling.
Files:
commands/pr-review.md-- Insert new sub-step after Step 8 summary block, before Step 9
Changes:
- Post
<!-- mach10-decisions -->comment documenting each deferred item's disposition:- Created as issue (with issue number)
- Skipped as duplicate (with existing issue number)
- Skipped by user choice (with one-sentence rationale if given)
- Not selected by user
- Guard: skip if zero deferred findings existed
- Size cap: under 20 lines
Dependencies: Stage 1
Stage 7: Version Bump
Goal: Bump plugin version for release.
Files:
.claude-plugin/plugin.json-- Version bumpREADME.md-- Check if any updates needed for new marker documentation
Dependencies: Stages 1-6
Testing
This is a pure plugin definition with no testable runtime code. Testing is manual: invoke each affected command against a real GitHub issue or PR and verify that decision comments are posted (or correctly omitted) on the expected paths.
Decision Log
Clarifying Questions (Step 4)
Significance heuristic: User chose autonomous posting over user confirmation. Claude should post follow-up comments when decisions are made that are not trivial, without adding an extra confirmation step. Implemented via prescriptive triggers per command.
Decision comment format: User chose HTML marker (<!-- mach10-decisions -->) for future machine-readability.
Plan comment format: User chose to embed Q&A and architecture rationale directly in the plan comment body (inline Decision Log) rather than a separate follow-up comment.
Scope: User chose all five commands in scope. Secondary benefit (improving how commands convey user intent) deferred.
Architecture Choice (Step 5)
Selected: Pragmatic Balance
Rationale: Prescriptive triggers align with the preference for autonomous posting -- triggers are deterministic so there's no ambiguity about when to post. Noise-conscious refinements (skip when only Suggestions, no double-posting on Modify path) prevent comment clutter. Concrete size caps provide a practical guardrail. Avoids the formality overhead of a shared significance rubric while being more thoughtful than always-post.
Alternatives considered:
- Minimal Changes: Always post on all relevant paths. Rejected because it would produce unnecessary comments when only Suggestion-level findings exist.
- Clean Architecture: Shared significance rubric in CLAUDE.md referenced by name. Rejected as overengineered for five self-contained command files; the rubric becomes an additional sync point without proportional benefit.
This plan will guide staged implementation via /mach10:issue-implement.
Progress: Stage 1 complete
Commit: a4395aa — Add decision-comment marker sync documentation to CLAUDE.md
What was done
Added the "Decision-comment marker sync" entry to the Writing Commands section of CLAUDE.md, documenting:
- The
<!-- mach10-decisions -->HTML marker used bypr-review,pr-review-validate,issue-plan-review, andissue-assessmentfor standalone decision comments - The inline
## Decision Logvariant used byissue-planwithin the plan comment body - The sync requirement: changes to either convention must be applied to all five locations
This is forward-looking documentation — the marker and Decision Log will be emitted by Stages 2-6.
Progress: Stage 2 complete
Commit: ad1c954 — Add Decision Log section to issue-plan comment body
What was done
Expanded commands/issue-plan.md Step 7 to include a ## Decision Log section in the plan comment body specification. The Decision Log captures:
- Clarifying Questions (Step 4): Question/answer pairs where the answer changed or constrained the plan. Exchanges where the user confirmed a default or said "whatever you think is best" are omitted.
- Architecture Choice (Step 5): The selected approach, rationale for choosing it, and alternatives considered with brief rejection reasons.
- Omission condition: The section is skipped entirely if Step 4 produced no questions AND Step 5 had no meaningful differentiation between approaches.
No new gh CLI call was added -- the Decision Log is embedded in the existing plan comment body, consistent with the inline variant documented in CLAUDE.md's Decision-comment marker sync entry.
Progress: Stage 3 complete
Commit: 4c0adbd — Add cancel-path decision comment to issue-assessment
What was done
Extended the Cancel branch in commands/issue-assessment.md Step 6 to post a <!-- mach10-decisions --> decision comment when the user cancels after viewing the assessment. The comment records:
- That an independent assessment was performed and the user chose not to act
- Condensed Summary from Step 4 (2-3 sentences)
- Condensed Gaps from Step 4 (2-3 sentences)
Guard: The comment is only posted if the Step 4 assessment was presented to the user (not if the session was interrupted before findings were shown).
Size cap: Comment body kept under 15 lines, consistent with the plan specification.
The formatting reminder for #<number> notation was aligned with the existing Approve-path phrasing for consistency.
Progress: Stage 4 complete
Commit: 718863f — Add proceed-as-is and cancel decision comments to issue-plan-review
What was done
Extended commands/issue-plan-review.md Step 5 with <!-- mach10-decisions --> decision comment posting on two user-choice paths:
"Proceed as-is" path:
- Posts a decision comment listing each Critical and Important finding (one sentence per line), noting the user chose to proceed without changes
- Guard: does NOT post if all findings are Suggestions only (proceeding past suggestions is the expected path)
- Size cap: under 15 lines
"Cancel" path:
- Posts a lightweight decision comment with finding counts by severity, noting the session ended without updating or proceeding
- Guard: only posts if findings were presented to the user in the session
- Size cap: 5 lines or fewer
Both paths include the GitHub #<number> auto-link avoidance reminder. Pattern follows the cancel-path decision comment established in Stage 3 (issue-assessment.md).
Progress: Stage 5 complete
Commit: f835053 -- Add skip-posting decision comment to pr-review-validate
What was done
Extended commands/pr-review-validate.md Step 5 "Skip posting" branch to post a <!-- mach10-decisions --> decision comment on the PR when the user declines to post the validation assessment.
Decision comment content:
- That a validation assessment was performed and the user chose not to post
- Finding counts from Step 4 (N genuine, N nitpicks, N false positives, N deferred) -- no individual finding details
- Size cap: 5 lines or fewer
"Modify before posting" path: Explicitly notes that NO separate decision comment is posted -- the modified and posted assessment IS the record.
Includes the GitHub auto-link avoidance reminder for numbered items, consistent with Stages 3-4.
Progress: Stage 6 complete
Commit: 47af05e -- Add deferred-item decision comment to pr-review
What was done
Added a "Persist Deferred-Item Decisions" sub-step to commands/pr-review.md within Step 8, after the deferred-item summary block and before Step 9. After processing deferred findings and displaying CLI output, the command now posts a <!-- mach10-decisions --> comment on the PR documenting each deferred item's disposition:
- Created as issue (with issue number)
- Skipped as duplicate (with existing issue number)
- Skipped by user choice (with one-sentence rationale if provided)
- Not selected by user
Guard: The comment is skipped entirely if zero findings were classified as deferred.
Size cap: Comment body kept under 20 lines, consistent with the plan specification.
This is the only true post-creation decision capture case -- pr-review Step 8 handles deferred items after the review has been posted to GitHub. Includes the GitHub auto-link avoidance reminder for numbered items, consistent with Stages 3-5.
Progress: Stage 7 complete
Commit: e18b5ab -- Bump plugin version to 1.6.0 for decision persistence feature
What was done
Bumped plugin version from 1.5.0 to 1.6.0 in .claude-plugin/plugin.json. Checked README.md for any needed updates -- no changes required since the README documents user-facing behavior and does not reference internal HTML marker conventions.
All 7 stages are now complete. Ready for PR creation.