Skip to content
Automation
Hook

Hooks

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

From plugin
benai-skills
62152 skills17 agents1 hook4 MCP
Install
> /plugin marketplace add naveedharri/benai-skills

Ships with benai-skills. Installing the plugin gets these hooks.

Where it lives

  • hooks/persist-session.shGitHub
    Read the script
    #!/bin/bash
    # persist-session.sh
    # Fires on Stop. Reminds Claude to save meaningful session info to the vault.
    # Routing rules are already in claude.md — this just triggers the behavior.
    
    # Read hook input from stdin
    INPUT=$(cat)
    
    # Prevent infinite loop: if this hook already triggered and Claude is stopping
    # again after acting on it, exit silently.
    if echo "$INPUT" | grep -q '"stop_hook_active"[[:space:]]*:[[:space:]]*true' 2>/dev/null; then
      exit 0
    fi
    
    cat <<'PERSIST'
    
    [VAULT PERSIST]
    Before ending: save anything meaningful from this session to the vault.
    - Session progress → Daily/{date}.md
    - New knowledge → route to the right file (see Knowledge Routing in claude.md)
    - Decisions, learnings, project updates, resources, corrections — all have a home.
    Skip if this was casual chat with nothing worth saving.
    [END VAULT PERSIST]
    
    PERSIST
    
    exit 0
    

Read the script before you install anything that runs on your machine. This is the one part of a plugin that acts without being asked.

Ships withbenai-skills

Expert automation skills for Claude Code, organized by department.

Get the whole plugin