oh-my-customcodex 0.3.9 → 0.3.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/templates/.claude/hooks/hooks.json +2 -2
- package/templates/.claude/hooks/scripts/claude-sensitive-path-guard.sh +9 -5
- package/templates/.claude/rules/MUST-agent-design.md +20 -0
- package/templates/manifest.json +2 -2
package/dist/cli/index.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -83,14 +83,14 @@
|
|
|
83
83
|
"description": "Schema-based tool input validation — Phase 1 advisory only"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
|
-
"matcher": "tool == \"Bash\" && tool_input.command matches \"\\\\.claude/\"",
|
|
86
|
+
"matcher": "(tool == \"Bash\" && tool_input.command matches \"\\\\.claude/\") || ((tool == \"Write\" || tool == \"Edit\") && tool_input.file_path matches \"\\\\.claude/\")",
|
|
87
87
|
"hooks": [
|
|
88
88
|
{
|
|
89
89
|
"type": "command",
|
|
90
90
|
"command": "bash .codex/hooks/scripts/claude-sensitive-path-guard.sh"
|
|
91
91
|
}
|
|
92
92
|
],
|
|
93
|
-
"description": "Block Bash writes into .claude/ sensitive paths before Claude Code permission prompts fire"
|
|
93
|
+
"description": "Block Bash/Write/Edit writes into .claude/ sensitive paths before Claude Code permission prompts fire"
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"matcher": "tool == \"Bash\"",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Block
|
|
2
|
+
# Block tool write operations targeting .claude/ sensitive paths.
|
|
3
3
|
# Claude Code can surface a sensitive-file permission prompt before allow rules
|
|
4
4
|
# or bypassPermissions are evaluated, so fail fast before the command runs.
|
|
5
5
|
|
|
@@ -8,11 +8,15 @@ set -euo pipefail
|
|
|
8
8
|
command -v jq >/dev/null 2>&1 || exit 0
|
|
9
9
|
|
|
10
10
|
input=$(cat)
|
|
11
|
+
tool=$(echo "$input" | jq -r '.tool // .tool_name // ""')
|
|
11
12
|
cmd=$(echo "$input" | jq -r '.tool_input.command // ""')
|
|
13
|
+
file_path=$(echo "$input" | jq -r '.tool_input.file_path // ""')
|
|
12
14
|
|
|
13
|
-
if [
|
|
14
|
-
echo "$
|
|
15
|
-
|
|
15
|
+
if [[ "$tool" =~ ^(Write|Edit)$ ]] && [[ "$file_path" =~ \.claude/ ]]; then
|
|
16
|
+
echo "[Hook] BLOCKED: $tool targeting .claude/ sensitive path" >&2
|
|
17
|
+
echo "[Hook] File: $file_path" >&2
|
|
18
|
+
echo "[Hook] Sensitive-path prompts can override allow rules. Use the repo's managed sync/update path or perform this change interactively." >&2
|
|
19
|
+
exit 2
|
|
16
20
|
fi
|
|
17
21
|
|
|
18
22
|
targets_claude=0
|
|
@@ -32,7 +36,7 @@ fi
|
|
|
32
36
|
if [ "$targets_claude" -eq 1 ] && [ "$writes_claude" -eq 1 ]; then
|
|
33
37
|
echo "[Hook] BLOCKED: Bash write targeting .claude/ sensitive path" >&2
|
|
34
38
|
echo "[Hook] Command: $cmd" >&2
|
|
35
|
-
echo "[Hook]
|
|
39
|
+
echo "[Hook] Sensitive-path prompts can override allow rules. Use the repo's managed sync/update path or perform this change interactively." >&2
|
|
36
40
|
exit 2
|
|
37
41
|
fi
|
|
38
42
|
|
|
@@ -235,6 +235,26 @@ Skills persist output to `.codex/outputs/sessions/{YYYY-MM-DD}/{skill-name}-{HHm
|
|
|
235
235
|
**Rules**: Opt-in per skill, final subagent writes with a file-write API that creates missing parent directories (R010 compliance), do not pre-create session output directories with Bash, .codex/outputs/ is git-untracked, no indexing required.
|
|
236
236
|
-->
|
|
237
237
|
|
|
238
|
+
## Sensitive Path Handling
|
|
239
|
+
|
|
240
|
+
Claude Code treats `.claude/` and `templates/.claude/` as sensitive directories across Bash, Write, and Edit operations. The sensitive-path check runs above `bypassPermissions` and explicit allow rules, so allow rules do not override the sensitive-path check.
|
|
241
|
+
|
|
242
|
+
This Codex port uses `.codex/` as the active runtime surface, but packaged compatibility templates still live under `templates/.claude/`. Any automation that writes those templates must account for Claude Code permission prompts.
|
|
243
|
+
|
|
244
|
+
| Path pattern | Sensitive in Claude Code? | Affected operations |
|
|
245
|
+
|--------------|---------------------------|---------------------|
|
|
246
|
+
| `.claude/**` | Yes | Bash writes, Write, Edit |
|
|
247
|
+
| `templates/.claude/**` | Yes | Bash writes, Write, Edit |
|
|
248
|
+
| `.codex/**` | No | Normal Codex runtime writes; still follow R010/R017 |
|
|
249
|
+
| `.codex/outputs/**` and `.claude/outputs/**` | Treat as constrained artifact paths | Use file-write APIs that create parents; do not pre-create with Bash |
|
|
250
|
+
|
|
251
|
+
Recommended practice:
|
|
252
|
+
|
|
253
|
+
1. Prefer Write/Edit in an interactive session, or managed sync/update paths, over Bash copy/mkdir/tee writes for `.claude/` and `templates/.claude/`.
|
|
254
|
+
2. Keep allow rules only as defensive documentation; do not rely on them to suppress sensitive-path prompts.
|
|
255
|
+
3. Do not run unattended Claude Code release automation that writes `templates/.claude/**` unless the workflow can handle interactive approval.
|
|
256
|
+
4. In this Codex port, update `.codex/...` source files and their `templates/.claude/...` mirrors deliberately instead of bulk-copying with shell commands.
|
|
257
|
+
|
|
238
258
|
## Separation of Concerns
|
|
239
259
|
|
|
240
260
|
| Location | Purpose | Contains |
|
package/templates/manifest.json
CHANGED