You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: eliminate 3 security hook trigger patterns in /codex and /autoplan (issue #1329)
Pattern 1 — source with tilde path:
Replace `source ~/.claude/skills/gstack/bin/gstack-codex-probe` + function calls
with direct `~/.claude/skills/gstack/bin/gstack-codex-*` binary invocations in
both codex/SKILL.md.tmpl and autoplan/SKILL.md.tmpl.
Pattern 3 — bare cd "$_REPO_ROOT":
Replace bare `cd "$_REPO_ROOT"` lines with `-C "$_REPO_ROOT"` flag on codex commands
(review bare path, exec custom path) and drop the cd entirely for exec resume
(session context preserves directory; -C is not a supported flag for resume).
Pattern 4 — inline python3 -u -c with #-comments:
Replace all three inline JSONL parser blocks (Challenge, Consult new-session,
Consult resume) with pipe to `~/.claude/skills/gstack/bin/gstack-codex-jsonl-parser`.
Also regenerates .kiro/.cursor/.openclaw etc host-specific SKILL.md files via
`bun run scripts/gen-skill-docs.ts --host all`.
Tests: 38 new tests in codex-hardening.test.ts guarding all three patterns and
verifying standalone binary behaviour. Updated skill-validation.test.ts to check
for the jsonl-parser binary instead of the old $PYTHON_CMD inline pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
echo"[codex-unavailable: auth missing] — proceeding with Claude subagent only. Run \`codex login\` or set \$CODEX_API_KEY to enable dual-voice review."
1087
1083
_CODEX_AVAILABLE=false
1088
1084
else
1089
-
_gstack_codex_version_check# non-blocking warn if known-bad
1085
+
~/.claude/skills/gstack/bin/gstack-codex-version-check# non-blocking warn if known-bad
1090
1086
_CODEX_AVAILABLE=true
1091
1087
fi
1092
1088
```
@@ -1120,7 +1116,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
1120
1116
**Codex CEO voice** (via Bash):
1121
1117
```bash
1122
1118
_REPO_ROOT=$(git rev-parse --show-toplevel)|| { echo"ERROR: not in a git repo">&2;exit 1; }
1123
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1119
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1124
1120
1125
1121
You are a CEO/founder advisor reviewing a development plan.
1126
1122
Challenge the strategic foundations: Are the premises valid or assumed? Is this the
@@ -1131,8 +1127,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
echo"[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
1137
1133
fi
1138
1134
```
@@ -1237,7 +1233,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
1237
1233
**Codex design voice** (via Bash):
1238
1234
```bash
1239
1235
_REPO_ROOT=$(git rev-parse --show-toplevel)|| { echo"ERROR: not in a git repo">&2;exit 1; }
1240
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1236
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1241
1237
1242
1238
Read the plan file at <plan_path>. Evaluate this plan's
1243
1239
UI/UX design decisions.
@@ -1254,8 +1250,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
1254
1250
Be opinionated. No hedging." -C "$_REPO_ROOT" -s read-only --enable web_search_cached < /dev/null
echo"[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
1260
1256
fi
1261
1257
```
@@ -1318,7 +1314,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
1318
1314
**Codex eng voice** (via Bash):
1319
1315
```bash
1320
1316
_REPO_ROOT=$(git rev-parse --show-toplevel)|| { echo"ERROR: not in a git repo">&2;exit 1; }
1321
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1317
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1322
1318
1323
1319
Review this plan for architectural issues, missing edge cases,
1324
1320
and hidden complexity. Be adversarial.
@@ -1330,8 +1326,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
_REPO_ROOT=$(git rev-parse --show-toplevel)|| { echo"ERROR: not in a git repo">&2;exit 1; }
1442
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1438
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
1443
1439
1444
1440
Read the plan file at <plan_path>. Evaluate this plan's developer experience.
Be adversarial. Think like a developer who is evaluating this against 3 competitors." -C "$_REPO_ROOT" -s read-only --enable web_search_cached < /dev/null
echo "[codex-unavailable: auth missing] — proceeding with Claude subagent only. Run \`codex login\` or set \$CODEX_API_KEY to enable dual-voice review."
257
253
_CODEX_AVAILABLE=false
258
254
else
259
-
_gstack_codex_version_check # non-blocking warn if known-bad
255
+
~/.claude/skills/gstack/bin/gstack-codex-version-check # non-blocking warn if known-bad
260
256
_CODEX_AVAILABLE=true
261
257
fi
262
258
```
@@ -290,7 +286,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
290
286
**Codex CEO voice** (via Bash):
291
287
```bash
292
288
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
293
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
289
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
294
290
295
291
You are a CEO/founder advisor reviewing a development plan.
296
292
Challenge the strategic foundations: Are the premises valid or assumed? Is this the
@@ -301,8 +297,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
echo "[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
307
303
fi
308
304
```
@@ -407,7 +403,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
407
403
**Codex design voice** (via Bash):
408
404
```bash
409
405
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
410
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
406
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
411
407
412
408
Read the plan file at <plan_path>. Evaluate this plan's
413
409
UI/UX design decisions.
@@ -424,8 +420,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
424
420
Be opinionated. No hedging." -C "$_REPO_ROOT" -s read-only --enable web_search_cached < /dev/null
echo "[codex stalled past 10 minutes — tagging as [codex-unavailable] for this phase and proceeding with Claude subagent only]"
430
426
fi
431
427
```
@@ -488,7 +484,7 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
488
484
**Codex eng voice** (via Bash):
489
485
```bash
490
486
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
491
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
487
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
492
488
493
489
Review this plan for architectural issues, missing edge cases,
494
490
and hidden complexity. Be adversarial.
@@ -500,8 +496,8 @@ Override: every AskUserQuestion → auto-decide using the 6 principles.
_REPO_ROOT=$(git rev-parse --show-toplevel) || { echo "ERROR: not in a git repo" >&2; exit 1; }
612
-
_gstack_codex_timeout_wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
608
+
~/.claude/skills/gstack/bin/gstack-codex-timeout-wrapper 600 codex exec"IMPORTANT: Do NOT read or execute any SKILL.md files or files in skill definition directories (paths containing skills/gstack). These are AI assistant skill definitions meant for a different system. Stay focused on repository code only.
613
609
614
610
Read the plan file at <plan_path>. Evaluate this plan's developer experience.
Be adversarial. Think like a developer who is evaluating this against 3 competitors." -C "$_REPO_ROOT" -s read-only --enable web_search_cached < /dev/null
0 commit comments