diff --git a/.codex/config.toml b/.codex/config.toml new file mode 100644 index 0000000..1b58f8f --- /dev/null +++ b/.codex/config.toml @@ -0,0 +1,2 @@ +[features] +codex_hooks = true diff --git a/.codex/hooks.json b/.codex/hooks.json index 63366df..4bbedc0 100644 --- a/.codex/hooks.json +++ b/.codex/hooks.json @@ -2,8 +2,15 @@ "hooks": { "SessionStart": [ { - "type": "command", - "command": "echo 'CAVEMAN MODE ACTIVE. Rules: Drop articles/filler/pleasantries/hedging. Fragments OK. Short synonyms. Pattern: [thing] [action] [reason]. [next step]. Not: Sure! I would be happy to help you with that. Yes: Bug in auth middleware. Fix: Code/commits/security: write normal. User says stop caveman or normal mode to deactivate.'" + "matcher": "startup|resume", + "hooks": [ + { + "type": "command", + "command": "echo 'CAVEMAN MODE ACTIVE. Rules: Drop articles/filler/pleasantries/hedging. Fragments OK. Short synonyms. Pattern: [thing] [action] [reason]. [next step]. Not: Sure! I would be happy to help you with that. Yes: Bug in auth middleware. Fix: Code/commits/security: write normal. User says stop caveman or normal mode to deactivate.'", + "timeout": 5, + "statusMessage": "Loading caveman mode" + } + ] } ] } diff --git a/CLAUDE.md b/CLAUDE.md index d61ccb6..fdf686a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -152,7 +152,7 @@ How caveman reaches each agent type: | Agent | Mechanism | Auto-activates? | |-------|-----------|----------------| | Claude Code | Plugin (hooks + skills) or standalone hooks | Yes — SessionStart hook injects rules | -| Codex | Plugin in `plugins/caveman/` with `hooks.json` | Yes — SessionStart hook | +| Codex | Plugin in `plugins/caveman/` plus repo `.codex/hooks.json` and `.codex/config.toml` | Yes on macOS/Linux — SessionStart hook | | Gemini CLI | Extension with `GEMINI.md` context file | Yes — context file loads every session | | Cursor | `.cursor/rules/caveman.mdc` with `alwaysApply: true` | Yes — always-on rule | | Windsurf | `.windsurf/rules/caveman.md` with `trigger: always_on` | Yes — always-on rule | @@ -196,4 +196,4 @@ To reproduce: `uv run python benchmarks/run.py` (needs `ANTHROPIC_API_KEY` in `. - README most important file for user-facing impact. Optimize for non-technical readers. Preserve caveman voice. - Benchmark and eval numbers must be real. Never fabricate or estimate. - CI workflow commits back to main after merge. Account for when checking branch state. -- Hook files must silent-fail on all filesystem errors. Never let hook crash block session start. \ No newline at end of file +- Hook files must silent-fail on all filesystem errors. Never let hook crash block session start. diff --git a/README.md b/README.md index c7cc226..c8ef707 100644 --- a/README.md +++ b/README.md @@ -197,12 +197,19 @@ Uninstall: `bash hooks/uninstall.sh` or `powershell -File hooks\uninstall.ps1` **macOS / Linux:** 1. Clone repo → Open Codex in the repo directory → `/plugins` → Search "Caveman" → Install +2. Repo-local auto-start is already wired by `.codex/hooks.json` + `.codex/config.toml` **Windows:** 1. Enable symlinks first: `git config --global core.symlinks true` (requires Developer Mode or admin) 2. Clone repo → Open VS Code → Codex Settings → Plugins → find "Caveman" under local marketplace → Install → Reload Window +3. Codex hooks are currently disabled on Windows, so use `$caveman` to start manually -This repo also ships `.codex/hooks.json`, so caveman auto-activates while you run Codex inside this repo. The installed plugin gives you `$caveman`; if you want always-on behavior in other repos too, add the same SessionStart hook there. +This repo also ships `.codex/hooks.json` and enables hooks in `.codex/config.toml`, so caveman auto-activates while you run Codex inside this repo on macOS/Linux. The installed plugin gives you `$caveman`; if you want always-on behavior in other repos too, copy the same `SessionStart` hook there and enable: + +```toml +[features] +codex_hooks = true +```