Skip to content

feat(epic-loop): run the hook loop on Claude Code, not just Codex#1

Open
usulpro wants to merge 1 commit into
mainfrom
claude/hook-loop-code-HNumM
Open

feat(epic-loop): run the hook loop on Claude Code, not just Codex#1
usulpro wants to merge 1 commit into
mainfrom
claude/hook-loop-code-HNumM

Conversation

@usulpro
Copy link
Copy Markdown
Owner

@usulpro usulpro commented May 31, 2026

Add dual-platform support so the same skill drives the techlead/engineer
Stop-hook loop on either Codex or Claude Code (one platform per session).

The loop engine is unchanged: Codex and Claude Code share the same Stop
continuation contract ({ "decision": "block", "reason": }), the
same hook-config entry shape, and the same stdin payload fields. Only the
platform-specific setup/detection branches:

  • platform helpers in lib/common.mjs: detectPlatform (auto via CLAUDECODE /
    config presence, overridable with --platform), hookConfigRelativePath,
    readCurrentClaudeSession (session id = transcript filename under
    ~/.claude/projects/), and readLastAssistantMessage which
    falls back to the transcript tail on Claude Code (no last_assistant_message
    in its Stop payload)
  • install-hooks / doctor target .claude/settings.json (deep-merged, no
    feature flag) for Claude Code and keep .codex/hooks.json for Codex
  • bind-session --current and debug detect the platform
  • hook.mjs is invoked with --platform; handleHook threads it into the
    engineer-report capture
  • expose the skill at .claude/skills/epic-loop as a symlink to the single
    source in .agents/skills/epic-loop so Claude Code discovers it without a
    duplicated copy
  • docs: SKILL.md, hooks-and-session-routing.md, and README cover both platforms

https://claude.ai/code/session_0157kdfjwZJmDd1mx7S93TyT

Add dual-platform support so the same skill drives the techlead/engineer
Stop-hook loop on either Codex or Claude Code (one platform per session).

The loop engine is unchanged: Codex and Claude Code share the same Stop
continuation contract ({ "decision": "block", "reason": <prompt> }), the
same hook-config entry shape, and the same stdin payload fields. Only the
platform-specific setup/detection branches:

- platform helpers in lib/common.mjs: detectPlatform (auto via CLAUDECODE /
  config presence, overridable with --platform), hookConfigRelativePath,
  readCurrentClaudeSession (session id = transcript filename under
  ~/.claude/projects/<encoded-cwd>), and readLastAssistantMessage which
  falls back to the transcript tail on Claude Code (no last_assistant_message
  in its Stop payload)
- install-hooks / doctor target .claude/settings.json (deep-merged, no
  feature flag) for Claude Code and keep .codex/hooks.json for Codex
- bind-session --current and debug detect the platform
- hook.mjs is invoked with --platform; handleHook threads it into the
  engineer-report capture
- expose the skill at .claude/skills/epic-loop as a symlink to the single
  source in .agents/skills/epic-loop so Claude Code discovers it without a
  duplicated copy
- docs: SKILL.md, hooks-and-session-routing.md, and README cover both platforms

https://claude.ai/code/session_0157kdfjwZJmDd1mx7S93TyT
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