Skip to main content

image

CI Python License PyPI

Turn long Claude Code sessions into reviewer-ready pull request descriptions.

pr-narrator reads your Claude Code transcript, combines it with your git diff, and generates a structured PR description grounded in the actual session.

For short sessions, asking Claude in-session works fine. For long sessions, context gets compacted and the rationale disappears from active memory. pr-narrator reads the raw transcript on disk, so it works from the full session, uncompacted.

Installation

uv tool install pr-narrator

Requires claude, git, and gh on your PATH.

Usage

pr-narrator inspect latest          # show what's in the most recent session
pr-narrator synthesize latest       # generate a PR description
pr-narrator create latest           # synthesize and open a draft PR

To work from a specific session:

pr-narrator synthesize from 02ff271d

The session ID is a UUID prefix; pr-narrator matches the shortest unambiguous prefix.

Example

Given a branch where you added retry logic to an HTTP client, plus a Claude Code session where you discussed why you chose exponential backoff over a fixed delay and rejected adding the tenacity dependency, pr-narrator synthesize latest produces:

> ## What changed
>
> Adds exponential backoff retry to `http_client.py` for transient 5xx responses. Three retries with 100ms / 400ms / 1.6s delays.
>
> ## Approach
>
> Wraps the existing `request()` method rather than introducing a new client class — keeps the call sites unchanged.
>
> ## Considered & rejected
>
> - **A third-party retry library (tenacity).** Adds a dependency for what is ~30 lines of code.
> - **Fixed-delay retry.** Doesn't help with thundering-herd scenarios.
>
> ## Risk
>
> Low. Existing call sites are unchanged.

Options

--paranoid          broaden redaction to include home paths, env-shaped lines,
                    private IPs, emails, and high-entropy tokens
--strict            fail synthesis if the model's frontmatter is incomplete
--dry-run           preview the PR without posting (create only)
--debug             print prompt, raw response, and redactions to stderr
--no-frontmatter    omit the YAML metadata block
--no-draft          open as a regular PR instead of a draft (create only)
--base BRANCH       base branch for the diff (default: main)

pr-narrator <command> --help for the full list.

How it works

pr-narrator parses Claude Code's per-session JSONL files into typed events, compresses them into a deterministic timeline, captures the branch diff, runs both through a redactor, and asks claude -p to render markdown plus YAML frontmatter for downstream review bots.

Inputs and outputs pass through a redactor; see SECURITY.md and CONTRIBUTING.md.

Development

git clone https://github.com/nagstler/pr-narrator
cd pr-narrator
uv sync --all-extras
uv run pytest
uv run pr-narrator --help

See CONTRIBUTING.md for branch naming, commit conventions, and the release process.

License

Apache License 2.0.

Metadata

Release files for pr-narrator 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pr-narrator 0.1.0
File Size Uploaded
pr_narrator-0.1.0.tar.gz 119.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pr-narrator 0.1.0
File Interpreter ABI Platform
pr_narrator-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 151.5 kB

Release files / pr_narrator-0.1.0.tar.gz

Download URL pr_narrator-0.1.0.tar.gz
Size 119.8 kB
Tags Source
SHA-256 checksum
How to use checksums
03ca8667c2513e75c948500601823f5abe618594f3b3b38d72d93c91bf671d9d
BLAKE2b-256 checksum
How to use checksums
6794501cab3943731107ac0be4888493383717742df6a21fa7f611aa90e03945
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 2, 2026.

Transparency log

Release files / pr_narrator-0.1.0-py3-none-any.whl

Download URL pr_narrator-0.1.0-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e5df7a8e2a43c4e4e55e1d802a6f44b6dd6fe69e055b44abb9bae85a09a45f0
BLAKE2b-256 checksum
How to use checksums
d97ce0737815c458aaec1f0395f02904a1331ceb657d35b302c561b5b34115df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page