Claude Code Plugin
Session hooks and skills for Claude Code.
The Claude Code plugin adds session lifecycle hooks and user-invocable skills on top of the MCP tools.
Installation
claude plugin add /path/to/HUSK/plugins/claude-codeOr copy the plugins/claude-code/ directory into your project manually.
Configuration
The plugin needs HUSK_URL and HUSK_KEY environment variables. The easiest way to set them up is with the CLI:
npx @huskai/cli initThis writes credentials to ~/.husk/credentials.json and sets the env vars in your shell profile. The /husk-init skill can also do this interactively from within Claude Code.
Hooks
SessionStart
Runs when a Claude Code session begins.
- Checks if HUSK is reachable via
GET /health - If not, attempts to start it with
npx husk
PostToolUse / UserPromptSubmit / Stop
Observation hooks that stream session activity to HUSK in real time. Each hook fires observation.sh, which:
- Reads hook JSON from stdin and resolves credentials (env vars or
~/.husk/credentials.json) - POSTs to
/hooks/observationwith session ID, event type, tool name, and a content snippet - Checks the
uncompressed_countin the response - When count reaches the compression threshold (default 20), returns
additionalContexttelling the LLM to run thecompress_sessionprompt
This enables client-side compression — the LLM summarizes its own observations without needing a server-side LLM. See Compression modes.
SessionEnd
Runs when a session ends (or errors). Receives session event JSON on stdin, notifies the server via /hooks/session-end, and POSTs a summary to /ingest with:
session_id,cwd,session_end_reasongit_remote(auto-detected from the working directory)scope: "session"
Credentials are resolved from env vars or ~/.husk/credentials.json.
This creates a session memory so you can pick up where you left off next time.
Skills
/husk-init
Interactive first-time setup wizard. Walks you through:
- Setting the server URL
- Verifying connectivity
- Logging in with admin credentials
- Creating a machine API key
- Writing
HUSK_URLandHUSK_KEYto your shell profile
/husk-search
Search HUSK memories inline. Automatically scopes to the current project via git remote.
/husk-search how does the auth middleware work/husk-remember
Save a memory to HUSK. Automatically determines the right scope (session, project, or global).
/husk-remember the deploy script requires Node 20+What it adds beyond MCP
| Capability | MCP | Plugin |
|---|---|---|
| Search & remember | ✅ | ✅ (also via skills) |
| Observation streaming | ❌ | ✅ |
| Client-side compression | ❌ | ✅ |
| Session auto-ingest | ❌ | ✅ |
| Auto-start server | ❌ | ✅ |
| Setup wizard | ❌ | ✅ |