Skip to content

Add hook scaffolding support to projio add claude and a new projio claude update-hooks command.

Context

Projio already manages .claude/settings.json for per-project sandboxing (allowedTools, path-scoped Edit/Write). Hooks are the missing piece — Claude Code supports hooks in the same settings file but projio doesn't generate them.

Requirements

  1. Extend projio add claude (in src/projio/init.py) to also scaffold a hooks section in .claude/settings.json
  2. Add projio claude update-hooks CLI command (alongside existing update-permissions) that regenerates hooks from projio.toml config
  3. Default hook templates to scaffold:
  4. PostToolUse on Edit/Write → project-specific lint command (if defined in projio.toml)
  5. PostToolUse on note_create → indexio build trigger
  6. PreToolUse on Bash → optional safety guard (log or block dangerous patterns)
  7. Hooks should be configurable in projio.toml under a [claude.hooks] section
  8. update-hooks should be idempotent like update-permissions

Implementation notes

  • Look at existing _scaffold_claude_settings() and update_claude_permissions() in init.py for patterns
  • Hook format in settings.json: {"hooks": {"PostToolUse": [{"matcher": "Edit|Write", "command": "..."}]}}
  • Keep hooks minimal by default — don't add hooks the project doesn't need

Source context: worklog

Worklog (worklog): Personal meta-tracking and coordination space

Recent commits:

28708f6 Update
5001ad2 Fix /read: send as .txt attachment so it opens natively on iOS/Android
2dd6e15 Fix /read: send large files as document attachments for full-content access on mobile

README:

Worklog

Arash's coordination space. Tracks projects, generates status reports, and sends notifications - without holding any datasets or scientific outputs.

Quick start

pip install -e .          # core (registry + status)
pip install -e ".[bot]"   # optional: telegram bot

Com

  • [[issue-arash-20260328-193353-406929.md]] — Both touch projio CLI subcommand infrastructure — silent CLI bug and hook scaffolding both affect the same projio command surface
  • [[issue-arash-20260327-141525-036428.md]] — Both are projio feature requests that extend the project setup/init layer (git-annex PATH injection vs hook scaffolding in projio add claude)