Skip to content

feat: PreToolUse hook for CLI-first multi-tool support#17

Merged
pszymkowiak merged 1 commit into
mainfrom
feat/pretool-hook
Mar 12, 2026
Merged

feat: PreToolUse hook for CLI-first multi-tool support#17
pszymkowiak merged 1 commit into
mainfrom
feat/pretool-hook

Conversation

@pszymkowiak
Copy link
Copy Markdown
Contributor

Summary

  • New icm-pretool.sh PreToolUse hook: auto-allows icm CLI commands in Claude Code (no permission prompts)
  • icm init --mode hook now installs both PreToolUse (auto-allow) + PostToolUse (auto-extract)
  • Updated skill/CLI instructions to prefer CLI over MCP
  • Enhanced CLAUDE.md template with full command reference (store, recall, update, health, feedback)

Why

The MCP server is fragile across tools. CLI is universal — works with claude, codex, gemini, vibe, opencode, wshm, and any tool that can run bash. The PreToolUse hook makes CLI usage seamless (no permission prompts), just like RTK does for token savings.

Architecture

AI Tool (any) → runs `icm store/recall/...` via bash
                       ↓
PreToolUse hook fires → detects `icm` command → auto-allow
                       ↓
Command executes without permission prompt
                       ↓
PostToolUse hook fires → auto-extracts context every 15 calls

Test plan

  • icm init --mode hook installs both hooks in settings.json
  • icm commands auto-allowed (no permission prompt in Claude Code)
  • PostToolUse auto-extraction still works
  • Non-icm commands unaffected

Like RTK's hook system, ICM now installs a PreToolUse hook that
auto-allows `icm` CLI commands in Claude Code (no permission prompts).

Changes:
- New icm-pretool.sh: PreToolUse hook (matcher: Bash, auto-allow icm)
- icm init --mode hook now installs both PreToolUse + PostToolUse hooks
- Updated CLI/skill instructions to prefer CLI over MCP
- Enhanced CLAUDE.md template with full command reference

This makes ICM CLI-first: works with all AI tools (claude, codex,
gemini, vibe, opencode) without requiring MCP support.
@pszymkowiak pszymkowiak merged commit f6f32c7 into main Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant