Skip to content
Development
Hook

Hooks

What cocoindex-code runs automatically, and when. A hook is a command Claude Code fires at a fixed moment, without you asking for it.

From plugin
cocoindex-code
2.7k1 skill2 hooks1 MCP
Install
> /plugin marketplace add cocoindex-io/cocoindex-code
> /plugin install cocoindex-code@cocoindex-code

Ships with cocoindex-code. Installing the plugin gets these hooks.

What fires, and when

SessionStart

Fires once when a session begins, and again after a context compaction. It is where a plugin sets up its environment, or restores state the compaction dropped.

  • root="${CLAUDE_PROJECT_DIR:-${GROK_WORKSPACE_ROOT:-}}"; [ -z "$root" ] && root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"; command -v ccc >/dev/null && test -d "$root/.cocoindex_code" && (cd "$root" && ccc index) 2>/dev/null || true

PostToolUse

  • MatchesEdit|Write|MultiEdit|search_replaceroot="${CLAUDE_PROJECT_DIR:-${GROK_WORKSPACE_ROOT:-}}"; [ -z "$root" ] && root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"; command -v ccc >/dev/null && test -d "$root/.cocoindex_code" && (cd "$root" && ccc index) 2>/dev/null || true
Read hooks/hooks.json
Ships withcocoindex-code

A super light-weight embedded code search engine CLI (AST based) that just works - improves speed and efficiency for coding agent ๐ŸŒŸ Star if you like it!

Get the whole plugin
Stats
2,713
Stars
217
Forks
Active
Maintenance
Python
Language
Apache-2.0
License
9d ago
Last commit
7mo ago
Created

Repo: cocoindex-io/cocoindex-code