Skip to content

pr detail: strip Claude Code attribution footer from PR descriptions #200

@ooloth

Description

@ooloth

Why

Every agent-generated PR description ends with a --- separator followed by a Generated by Claude Code (https://claude.ai/code/session_...) line. This appears on every PR and consumes 3 lines of visible space without adding review-relevant information.

Current state

The PR body is rendered verbatim via crate::markdown::from_str(raw_body) in ui/tui/src/render/mod.rs (line 709). The Generated by Claude Code footer and preceding --- separator are included in the rendered output on every agent-authored PR.

Ideal state

  • Lines matching the pattern Generated by Claude Code (with or without a trailing URL) are stripped from the PR body before rendering
  • The --- horizontal rule immediately preceding that line is also stripped if it would otherwise be the last visible content in the body
  • All other body content is unaffected
  • The stripping happens in the render path, not in the domain or fetch path (the raw body is preserved in the data model)

Out of scope

  • Stripping attribution from comment bodies
  • Removing other footers or boilerplate patterns

Starting points

  • ui/tui/src/render/mod.rsrender_pr_detail() body rendering at lines 703–711

QA plan

  1. Open any agent-generated PR in the TUI detail view (e.g. hub PR claude: remove external rust.md reference from Rust Conventions #160 or workflows/implement: filter claude stderr before forwarding to caller #159) — expect no Generated by Claude Code line or trailing --- separator at the bottom of the description
  2. Press G to jump to the bottom of the description section — expect the last visible content to be ## Related links or similar substantive content, not the attribution footer
  3. Open a PR with a manually written description that happens to end with --- — expect the --- to still render (the strip only applies when the line immediately follows the attribution pattern)
  4. Open a PR with no attribution footer — expect no change to the rendering

Done when

The Generated by Claude Code attribution line and its preceding separator are absent from the rendered PR detail body.

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