codex - 💡(How to fix) Fix Greeting message hook [1 comments, 2 participants]

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…
GitHub stats
openai/codex#17518Fetched 2026-04-12 13:27:11
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Root Cause

I would like a hook that runs git status after I open codex or run /new, to remind me if I have forgotten to commit my changes (Getting two sets of changes mixed up, is a real pain because you can't restore with git).

RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like a hook that runs git status after I open codex or run /new, to remind me if I have forgotten to commit my changes (Getting two sets of changes mixed up, is a real pain because you can't restore with git).

SessionStart runs only after the prompt is submitted, and its stdout is added to the context. I want the hook's stdout printed to the terminal (and not added to the model's context). I want the hook to run before I prompt.

Additional information

No response

extent analysis

TL;DR

Implement a custom hook that runs git status before the prompt and prints the output to the terminal.

Guidance

  • Investigate the existing hook system in Codex CLI to determine how to create a custom hook that runs before the prompt.
  • Check if there's an existing hook or API that allows running a command and printing its output to the terminal, rather than adding it to the context.
  • Consider using a separate script or command that runs git status and prints the output, which can be called from the custom hook.
  • Look into the SessionStart hook's implementation to understand why its stdout is added to the context and how to avoid this behavior in the custom hook.

Notes

The exact implementation details may depend on the internal workings of the Codex CLI and its hook system, which are not fully specified in the issue.

Recommendation

Apply workaround: Implement a custom hook that runs git status and prints the output to the terminal, as this seems to be the most direct way to achieve the desired functionality.

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