agentsclimarketplace

Codex hook json sessionstart

Skill whyy9527/codexception/examples/codex-hook-json-sessionstart

Codex-native continuous learning skill for extracting reusable debugging and workflow knowledge into SKILL.md files

Install
npx -y skills add whyy9527/codexception --skill codex-hook-json-sessionstart

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Fix Codex SessionStart hooks that print plain text, invalid JSON, or reminders that do not enter model-visible context. Use when editing ~/.codex/hooks.json, ~/.codex/hooks/*.sh, or a skill-bundled hook script for Codex.

SKILL.md

2.0 KB, as published. Nobody here has run it

Codex Hook JSON SessionStart

Use When

  • A Codex hook is meant to inject reminder context at session start.
  • The hook prints plain text copied from a Claude hook.
  • hooks.json points at a shell script but Codex does not receive the reminder.
  • You are renaming or replacing a hook under ~/.codex/hooks/.

Failure Mechanism

Claude hooks can inject visible plain text. Codex SessionStart hooks should emit structured JSON so Codex can place the reminder in additionalContext. A copied Claude hook may execute successfully while providing no usable Codex context.

Procedure

  1. Read ~/.codex/hooks.json and the referenced hook script.
  2. Make the command point at a real executable under ~/.codex/hooks/.
  3. Have the script emit JSON with:
    • hookSpecificOutput.hookEventName set to SessionStart
    • reminder text in hookSpecificOutput.additionalContext
  4. Keep the hook output short. It should remind Codex to evaluate a skill, not duplicate the whole skill.

Example hook body:

#!/bin/bash
cat << 'EOF'
{
  "hookSpecificOutput": {
    "hookEventName": "SessionStart",
    "additionalContext": "[codexception]\nAfter completing this user request, evaluate whether the work produced reusable knowledge worth preserving as a Codex skill."
  }
}
EOF

Verification

  • ruby -rjson -e 'JSON.parse(File.read(File.expand_path("~/.codex/hooks.json")))'
  • ruby -rjson -e 'JSON.parse(~/.codex/hooks/codexception-activator.sh)'
  • ~/.codex/claude-bridge/validate.sh still passes if bridge-managed files are present.

High-Risk Actions

  • Do not paste the full skill into the hook output.
  • Do not leave stale hook paths after renaming a skill or script.
  • Do not use a Claude plain-text activation banner as the Codex hook body.

Gives 0 of the 12 instructions most skill authoring skills give

Counted across 521 of the 523 authors here whose files we hold, read 2026-08-06

  • keep skill files under 500 linesin 182 of 521, across 89 files
  • use imperative form in instructionsin 101 of 521, across 30 files
  • draft assertions while test runs are in progressin 88 of 521, across 22 files
  • save test cases to evals jsonin 87 of 521, across 21 files
  • create two to three realistic test promptsin 85 of 521, across 20 files
  • write skill descriptions to be pushyin 84 of 521, across 19 files
  • ask questions about edge cases and input formatsin 81 of 521, across 16 files
  • save timing data immediately when runs completein 74 of 521, across 9 files
  • include all trigger conditions in the skill descriptionin 73 of 521, across 7 files
  • capture intent before writing a skillin 70 of 521, across 4 files
  • launch all test runs in a single turnin 68 of 521, across 2 files
  • write the description in third personin 56 of 521, across 19 files

Said here and by no other author read

  • read the hooks configuration and referenced hook script
  • point the command at a real executable script
  • set hookEventName to SessionStart
  • put reminder text in additionalContext
  • keep the hook output short

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.