refactor(okf): use --bare mode in wiki maintenance hook - #912
Conversation
Replace env-var recursion guards and --strict-mcp-config with --bare, which skips hooks, auto-memory, and CLAUDE.md discovery natively. Load okf skill explicitly via --plugin-dir. Add --permission-mode acceptEdits and --exclude-dynamic-system-prompt-sections for unattended runs. Narrow first-run memory window from 3 days to 1 day.
There was a problem hiding this comment.
Code Review
This pull request simplifies the okf-wiki-maintenance.sh script by removing recursion-prevention environment variables, shortening the first-run fallback search window for recent memories to one day, and updating the claude -p execution flags. Feedback suggests dynamically resolving the plugin directory relative to the script's location instead of hardcoding it to ~/.claude/skills/okf, as the deployment path may vary under chezmoi.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| --effort low \ | ||
| --permission-mode acceptEdits \ | ||
| --allowed-tools "Read,Write,Edit,Glob,Grep" \ | ||
| --plugin-dir "${HOME}/.claude/skills/okf" \ |
There was a problem hiding this comment.
Hardcoding the plugin directory to ~/.claude/skills/okf can cause failures because this repository uses chezmoi with private_dot_agents, which deploys the skill to ~/.agents/skills/okf instead of ~/.claude/skills/okf.
To make this robust and independent of the installation path, we can dynamically resolve the skill's root directory relative to the script's location.
| --plugin-dir "${HOME}/.claude/skills/okf" \ | |
| --plugin-dir "$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)" \ |
|
Warning Review limit reached
Next review available in: 13 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe OKF wiki maintenance hook now runs without the previous disable guard, uses a shorter first-run journal lookback, and invokes Claude with revised permissions, tools, plugin, session, and prompt configuration. ChangesOKF wiki maintenance flow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@chezmoi/private_dot_agents/skills/okf/hooks/executable_okf-wiki-maintenance.sh`:
- Line 61: Update the plugin directory argument in the hook script to use
CLAUDE_PLUGIN_ROOT when available, with a fallback that resolves the script’s
own relative directory; remove the hardcoded ${HOME}/.claude/skills/okf path
while preserving the existing plugin invocation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: efede4cb-21c1-4688-8119-cb4bc04cd298
📒 Files selected for processing (1)
chezmoi/private_dot_agents/skills/okf/hooks/executable_okf-wiki-maintenance.sh
- Restore first-run memory window to -mtime -3 to avoid perpetual no-op on fresh installs where all journals are >24h old - Add --strict-mcp-config to prevent MCP server startup side effects - Guard against missing OKF plugin dir before invoking claude - Log claude output to .okf-wiki-maintenance.log instead of /dev/null; log failures with timestamp for diagnosability - Extract OKF_PLUGIN and LOG_FILE vars to top of script - Bump --effort low to medium and update prompt to iterate all topics per run for multi-document throughput
Summary
MEMSEARCH_DISABLE,OKF_WIKI_DISABLE,MEMSEARCH_NO_WATCH) and--strict-mcp-configwith--bare, which natively skips hooks, auto-memory, and CLAUDE.md discovery--plugin-dirsince--bareskips auto plugin loading--permission-mode acceptEditsfor unattended file edits without prompts--exclude-dynamic-system-prompt-sectionsfor better prompt cache reuse across daily runsTest plan
Summary by CodeRabbit
Bug Fixes
Improvements