12 issue files documenting features needed to replace shell scripts: Claude Code hooks: - 001: core ai session (state management) - 002: core ai context (fact capture) - 003: core ai hook (command validation) - 004: core qa debug (debug statement detection) Data collection: - 005: core collect github (issues/PRs archive) - 006: core collect bitcointalk (forum threads) - 007: core collect market (CMC/CoinGecko) - 008: core collect papers (whitepapers) - 009: core collect excavate (project archaeology) - 010: core collect process (HTML→MD) - 011: core collect dispatch (event hooks) 000: Overview tracking issue These will be submitted to host-uk/core when rate limit resets. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1.7 KiB
1.7 KiB
feat(ai): Add hook validation for Claude Code PreToolUse
Summary
Add core ai hook subcommands to validate commands and file operations for Claude Code hooks.
Required Commands
core ai hook validate-command <cmd> # Check if command is safe/allowed
core ai hook validate-file <path> # Check if file creation is allowed
core ai hook post-commit # Check for uncommitted work after commit
Current Shell Scripts Being Replaced
claude/hooks/prefer-core.sh- Blocks dangerous commands, enforces core CLIclaude/scripts/block-docs.sh- Blocks random .md file creationclaude/scripts/post-commit-check.sh- Warns about uncommitted work
Command Validation Rules
Block these patterns:
rm -rf/rm -r(except node_modules, vendor, .cache, dist, build)mv/cpwith wildcardsxargswith rm/mv/cpfind -execwith file operationssed -i(in-place editing)grep -l | ...(mass file targeting)perl -i,awk > file
Redirect to core:
go test/build/fmt/mod→ suggestcore go *golangci-lint→ suggestcore go lintcomposer test→ suggestcore php test./vendor/bin/pint→ suggestcore php fmtphp artisan serve→ suggestcore php dev
File Validation Rules
Allow:
README.md,CLAUDE.md,AGENTS.md,CONTRIBUTING.md,CHANGELOG.md,LICENSE.md- Files in
docs/directory
Block:
- Other
.mdfiles (suggest using README.md or docs/)
Output Format (JSON for hooks)
{"decision": "approve"}
{"decision": "block", "message": "Use `core go test` instead of raw go test"}
{"decision": "warn", "message": "3 files remain uncommitted after commit"}