Repository navigation
Description
Problem Statement
Problem Statement
I'm trying to find a saved review for one branch. ocr session list gives me the latest 20 sessions from every branch in the repo. The branch isn't in the table, either. So now I'm opening sessions one by one to figure out which run I actually want.
And if I've done enough reviews on other branches? The session I'm looking for doesn't even make the list. Great. Time to raise the limit and go digging.
We already save gitBranch in the session metadata. Can we let the CLI filter on it?
Proposed Solution
Add --branch <name> to ocr session list and its existing aliases:
ocr session list --branch feat/my-feature
ocr session list --branch feat/my-feature --limit 5
ocr session list --repo /path/to/repo --branch main --jsonThe details that matter:
- Match the saved branch name exactly, including case.
- Filter before applying
--limit. Otherwise, we still miss older matching sessions, which is the whole problem. - Keep newest-first ordering and support both table and JSON output.
- Leave the current behavior alone when
--branchis omitted or empty. - Skip sessions without a recorded branch when filtering.
- If nothing matches, include the requested branch in the text message and return
[]in JSON. - Use the saved metadata. An archived checkout or a deleted branch should still be searchable.
This helps find a session. Whether that session can actually be resumed is still up to the existing resume checks.
Alternatives Considered
I can use --limit 0 --json and pipe the output through jq. That works. It also means bringing another tool into a task where the CLI already has the information it needs. Filtering the default 20 results won't reliably work, either; the matching session might already have been cut off.
A branch column would help me read the list, but wouldn't stop other branches from pushing the session I want out of it.
Automatically using the current branch would change the default behavior and require a usable Git checkout. I'd keep this explicit: ask for a branch, get that branch's sessions.
Affected Area
CLI / Commands, Documentation
Additional Context
If this sounds good, please assign the issue to me, I'll open a PR by tomorrow
Activity