codex - 💡(How to fix) Fix Pre and PostCompact hooks [2 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#17148Fetched 2026-04-09 08:01:51
View on GitHub
Comments
2
Participants
2
Timeline
8
Reactions
0
Timeline (top)
labeled ×4commented ×2unlabeled ×2
RAW_BUFFERClick to expand / collapse

What variant of Codex are you using?

CLI

What feature would you like to see?

Like in the title: hooks that are covered . When working in claude code it was quite efficient to gather a full conversation transcript, prepare it and feed it directly the conversation transcript (stripped from unnecessary parts) to keep the conversation flow going on. There are also other uses: prompt injecting summarization agent with additional instructions on how the conversation should be shaped in the summary without the need to adjust the summarization prompt.

Both of these uses are possible when having proper injections. However, there are other lifecycle possibilities, like: reinjecting AGENTS.md after summarization (for better alignment after summarization), reminders etc.

Additional information

Pull request that can easily be re-targeted at openai/codex: https://github.com/jmarianski/codex/pull/1

There are other hooks that are important in the lifecycle of an application, however most are already covered: SubAgentStart is replaced with SessionStart for an agent (however it would be nice to give some kind of distinction: subagents may need different message on SessionStart than a main agent (so that they are less talkative, or more talkative - if we would like to adjust that behavior)), pre and post tool use hooks are there, same as stop hook.

extent analysis

TL;DR

Implementing hooks for conversation transcript injection and other lifecycle events can enhance the functionality of Codex.

Guidance

  • Review the provided pull request (https://github.com/jmarianski/codex/pull/1) to understand the proposed implementation of hooks in Codex.
  • Consider the potential use cases for hooks, such as injecting conversation transcripts, summarization agents, and reminders, to determine the required functionality.
  • Evaluate the existing hooks in Codex, including SubAgentStart, SessionStart, pre and post tool use hooks, and stop hook, to identify areas for improvement or expansion.
  • Investigate the possibility of introducing distinctions between subagents and main agents, such as custom messages on SessionStart, to enhance flexibility.

Example

No explicit code example is provided, as the issue focuses on the concept of implementing hooks rather than specific code implementation.

Notes

The implementation of hooks may require modifications to the Codex architecture and should be carefully evaluated to ensure compatibility and functionality.

Recommendation

Apply workaround: Implement the proposed hooks as outlined in the provided pull request, as this seems to be a targeted solution to the requested feature.

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