You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a native pre-turn dynamic context hook for time-sensitive metadata #14814
A native way to inject dynamic context before every user turn in Codex CLI.
A concrete example is current local time / UTC time / timezone, but the same mechanism would also be useful for other runtime metadata.
Why this matters
Some prompts are time-sensitive. Static instructions in AGENTS.md, developer_instructions, or config files are not enough, because the value changes every turn.
Right now, there does not seem to be an official native mechanism for:
pre-turn hooks
dynamic prompt/context injection before each message
automatic MCP calls before each turn
built-in runtime variables like current time
Current workaround
The workaround is to build an external wrapper around codex exec / codex exec resume that injects a time block before every prompt.
This works, but it is not ideal because:
it is not native to the interactive Codex UX
it adds maintenance overhead
it is harder to share and standardize
it feels like something the CLI should support directly
Suggested feature
Any of these would solve the problem:
A native pre_turn_command / pre_prompt_command hook in config
Native dynamic variables such as {{ now_local }}, {{ now_utc }}, {{ timezone }}
A way to auto-run a configured MCP tool before each turn and inject the result into context
Expected benefit
This would help with:
time-aware conversations
reminders and scheduling workflows
dynamic environment metadata
safer handling of prompts that depend on real current time
Related issues
This seems adjacent to, but different from, #3540.
#3540 is about global preamble/instructions not being applied reliably in interactive sessions.
This request is specifically about native per-turn dynamic context injection, which static preambles still would not solve.
Additional information
If this lands, it would remove the need for custom wrapper scripts for a whole class of runtime-sensitive workflows.
Indexed this hook ticket in the umbrella tracker: #21753
Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.
Activity
etraut-openai commentedon Apr 18, 2026
This feature request hasn't received any upvotes in over a month, so I'm going to close it.
oxysoft commentedon May 8, 2026
Indexed this hook ticket in the umbrella tracker: #21753
Goal: collect the scattered Codex hook requests and bugs into one parity matrix for Full Claude Code Hook Parity (29+), while preserving this issue as the detailed thread for its specific behavior.