addyosmani / addyosmani/agent-skills

SessionStart hook exits with code 1 on native Windows Codex (bash/jq-only hook)

Open
#475 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
93.8k
Forks
10k
Avg merge
3d 15h
Merged PRs (30d)
23

Description

## Summary

The bundled `SessionStart` hook exits with code 1 when this plugin is used from Codex Desktop on native Windows.

The individual skills still load and remain usable, but Codex displays a plugin hook failure notification at session start and the `using-agent-skills` context is not injected.

## Current behavior

The current `hooks/hooks.json` only defines a POSIX `command`. It invokes `hooks/session-start.sh`, which requires Bash and `jq`, and resolves paths through Claude-specific environment variables.

There is no Windows-specific `commandWindows` handler.

## Reproduction

Environment:

- Codex Desktop on native Windows
- agent-skills plugin 0.6.6
- No working WSL distribution
- `bash` resolves to the Windows WSL launcher
- `jq` is not installed

Steps:

1. Enable the agent-skills plugin in Codex Desktop.
2. Start or resume a session.
3. Observe: `SessionStart plugin hook exited with code 1`.

A direct invocation of the resolved `bash.exe` also exits with code 1 because WSL cannot create a Linux instance.

## Expected behavior

Native Windows users should either:

- receive the same meta-skill context through a Windows-native hook; or
- have this optional hook skip cleanly without displaying a failure.

Installing WSL and `jq` should not be required merely to use the plugin from native Windows Codex.

## Suggested fix

Add a Windows-specific `commandWindows` handler, as supported by Codex hooks, using PowerShell without Bash or `jq`. Keep the existing POSIX command for macOS/Linux.

A Windows regression test would also prevent recurrence.

Codex hook reference: https://learn.chatgpt.com/docs/hooks

## Impact

Low severity but persistent UX issue:

- project work, builds, tests, and individual skills are unaffected;
- automatic `using-agent-skills` context injection fails;
- the warning appears at session start and looks more serious than the actual impact.

Editing the installed plugin cache is not a durable workaround because plugin updates or cache refreshes can overwrite it.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.