Skip to content

feat(codex): add Bash PostToolUse graph guidance#211

Merged
zzet merged 2 commits into
zzet:mainfrom
blankanswer:feat/codex-posttooluse-bash-guidance
Jul 1, 2026
Merged

feat(codex): add Bash PostToolUse graph guidance#211
zzet merged 2 commits into
zzet:mainfrom
blankanswer:feat/codex-posttooluse-bash-guidance

Conversation

@blankanswer

@blankanswer blankanswer commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Install a Codex PostToolUse hook for Bash alongside the existing Codex SessionStart / PreToolUse hooks.
  • Route Codex PostToolUse Bash events through a small normalization layer when the command is grep-family, then reuse the existing runPostToolUse / postGrep enrichment path.
  • Keep Codex soft-only: only emit hookSpecificOutput.additionalContext; no deny, stop, suppress, or input rewrite.
  • Preserve user hooks, keep hook installation idempotent, and continue respecting --no-hooks.
  • Document the Codex Bash PostToolUse hook.

Design notes

  • This intentionally handles only grep-family Bash output.
  • Broader Bash output enrichment such as cat / sed / awk / source-read output, apply_patch, and MCP tool names are left for later PRs.
  • Codex uses its dedicated dispatcher, so Claude, Gemini, and Antigravity hook behavior remains unchanged.
  • The installed hook uses the portable command form: gortex hook --agent=codex --mode=enrich. Unlike the SessionStart text hook, this does not rely on POSIX-only shell output, so this PR does not add a command_windows override.

Out of scope

  • apply_patch
  • MCP tool-name matching
  • cat / sed / awk / general Bash output enrichment
  • deny / enforcement behavior
  • input rewrite
  • output suppression
  • Claude / Gemini / Antigravity behavior changes

Tests

  • go test ./internal/agents/codex
  • go test ./internal/hooks
  • go test ./cmd/gortex
  • git diff --check

Related to #206

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants