codex - 💡(How to fix) Fix Capture Git and PR Metadata in Session Files

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

Today the session JSONL includes cwd, timestamps, and conversation data, but no git or PR identifiers. That means any linkage to a branch, commit, or PR has to be inferred later from the current state of the local repo or GitHub, which is inherently lossy because branches move, PRs close, and repositories change over time. The request is for Codex CLI to capture immutable repository context at session start, and optionally refresh selected fields during the session.

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

cli

What feature would you like to see?

Today the session JSONL includes cwd, timestamps, and conversation data, but no git or PR identifiers. That means any linkage to a branch, commit, or PR has to be inferred later from the current state of the local repo or GitHub, which is inherently lossy because branches move, PRs close, and repositories change over time. The request is for Codex CLI to capture immutable repository context at session start, and optionally refresh selected fields during the session.

Suggested fields in session_meta:

  • repo_root
  • git_branch
  • git_commit_sha
  • git_commit_short_sha
  • git_remote_url
  • github_pr_number nullable
  • github_pr_url nullable
  • github_pr_title nullable

Behavior:

  • Populate git fields whenever cwd is inside a git repo.
  • Populate PR fields when a PR can be resolved from the current branch or commit.
  • Fail soft when git/GitHub context is unavailable.
  • Prefer capturing this at session creation so exported data reflects the session’s actual historical context rather than current repo state.

Why it matters:

  • Enables reliable joins between Codex sessions and PRs/commits in BigQuery or other analytics systems.
  • Makes debugging and auditing easier.
  • Preserves historically accurate context for long-lived or later-exported sessions.

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Capture Git and PR Metadata in Session Files