feat(hooks): add Codex lifecycle snapshots and bounded context - #23
Merged
Merged
Conversation
robinv8
reviewed
Sep 8, 2026
robinv8
left a comment
Member
There was a problem hiding this comment.
Summary
This is a careful, opt-in Codex SessionStart integration that keeps the Claude Code default intact. The shared installer quotes absolute Codex commands, refuses symlinks and foreign scripts, merges without clobbering unrelated hook groups, and the hook fails open, resolves brainRoot, covers startup|resume|clear|compact, and prefix-truncates to 8 KiB of whole UTF-8 rows. Hook tests (19/19) pass locally; remaining nits are generated-text formatting and one jargon comment in the shipped script.
Issue counts by severity
- bugs: 0
- suggestions: 1
- nits: 1
Member
|
Thanks for the Codex hooks — merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex users can now opt into project-local brain context with
brain install-hooks --agent codexand remove it withbrain uninstall-hooks --agent codex. The existing Claude Code default is preserved. Fixes #22.The shared installer preserves unrelated settings and hook commands, rejects foreign scripts and symlinks, and installs one SessionStart handler for startup, resume, clear, and compaction. The hook uses the existing CLI to resolve redirected brains, fails open, and limits Codex execution to five seconds.
Codex snapshots retain complete UTF-8 rows within 8 KiB and direct the agent to fetch the full index when truncated. Codex wiring complements Astra's native notes/history with page references and current-page reads. Installation never changes model settings, enables experiments, or writes memory automatically.
Validation
Compatibility limits
Codex CLI 0.153.4 is the tested supported baseline; older releases were not validated. The hook requires Node 18+ and POSIX sh/awk. Its generated absolute command requires uninstalling before moving a project and reinstalling at the destination.
Live Astra experimental-rollover recall and desktop behavior remain unverified. The available sign-in cannot exercise the launch-gated experiment, and a mock endpoint does not prove native notes/history behavior. The documentation explicitly retains wired instructions and CLI reads as the fallback.