# --from-pr Flag

> It lists the sessions that worked on one pull request.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** claude --from-pr, --from-pr

## Think of it like

It is like you find all the notes with the same star on them.

## Definition

--from-pr shows the list of sessions that worked on one pull request. Give it the pull request's number or its link. It takes links from GitHub, GitLab and Bitbucket. When Claude opens a pull request, the session is linked to it by itself, so this finds the session that wrote the code.

## Example

A reviewer asks Jack why a change was made. He runs claude --from-pr 418, opens the session that wrote it, and asks Claude to explain its choice.

## Example code

```bash
claude --from-pr 123
```

List the sessions linked to pull request 123.

## Why it matters

The chat behind a pull request often says best why the code looks the way it does.

## Common mistake

Expecting it to find a pull request you opened by hand. Only sessions where Claude made the pull request are linked.

## Three principles

- **Number or link.** GitHub, GitLab, Bitbucket.
- **Linked by itself.** When Claude opens it.
- **A short list.** Just that pull request.

## Related terms

- [--resume Flag](https://learn.benibix.com/term/ai/resume-flag)
- [Pull Request](https://learn.benibix.com/term/development/pull-request)
- [Claude Code Session](https://learn.benibix.com/term/ai/claude-code-session)

## Taught in

- [Resume, Branch and Rename](https://learn.benibix.com/learn/ai-claude-code-commands/resume-branch-and-rename): Claude Code Commands, 4/17

![Set a name or ID when you start, then use it with --resume or --from-pr to come back.](https://learn.benibix.com/diagrams/flag-find-session.svg)

---

Source: https://learn.benibix.com/term/ai/from-pr-flag
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
