/happenin:happeninfrom happenin
Use the happenin CLI to capture, query, and dashboard Cursor, Claude Code, and Devin agent events from the local machine.
Ships in happenin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
happenin is a local CLI that captures Cursor, Claude Code, and Devin hook events into a SQLite database and serves a real-time dashboard. All data stays on the user's machine.
This is a cross-agent skill. Any agent that supports SKILL.md files can load it.
If happenin is not installed, install the CLI first:
npm install -g happenin
Or run from source:
nub install
nub run build
The Cursor, Claude Code, and Devin plugins bundle this skill, so installing the plugin is enough for those clients. For any other agent, add it from the repository:
npx skills add YogliB/happenin --skill happenin
For a global install, add the -g flag. You can also copy skills/happenin/SKILL.md from this repository into your agent's skills directory.
happenin install [--cursor] [--claude] [--devin]Shows the supported plugin setup for Cursor, Claude Code, and Devin. The packaged hooks use npx -y happenin record, so the normal setup does not edit user configuration. Use --cursor, --claude, or --devin to show one client only.
Migrating from a pre-plugin install? Remove the old happenin record entries from ~/.cursor/hooks.json and ~/.claude/settings.json by hand (one-time step). Keep every unrelated hook.
happenin record <source> [event]The hook target. It reads a JSON payload from stdin, writes it to ~/.happenin/happenin.db, and prints the required response the agent expects.
<source> — cursor, claude, or devin.[event] — only required for Claude; Cursor and Devin payloads include hook_event_name.Record an event directly by piping JSON to stdin:
echo '{"hook_event_name":"sessionStart","sessionId":"abc123","projectPath":"/path/to/project"}' | happenin record cursor
echo '{"sessionId":"abc123","projectPath":"/path/to/project"}' | happenin record claude SessionStart
echo '{"hook_event_name":"PreToolUse","session_id":"abc123","tool_name":"exec","tool_input":{"command":"ls"}}' | happenin record devin
record extracts common fields from the raw payload before storing it:
| Stored field | Payload keys searched (first match wins) |
|---|---|
event | hook_event_name (Cursor and Devin); otherwise the second CLI argument |
sessionId | sessionId, session_id; for subagentStart also parent_conversation_id, conversation_id |
happenedAt | happenedAt, timestamp, happened_at, time, ts, createdAt, created_at |
projectPath | projectPath, cwd, project_path, workspaceRoot, workspaceRoots, workspace_roots, workspace_root, workspace_path; for devin events, the DEVIN_PROJECT_DIR env var |
filePath | filePath, file_path, path at the top level; otherwise tool_input.file_path/notebook_path/path for Read/Edit/Write/MultiEdit/NotebookEdit/read/edit/write/notebook_edit |
toolName | toolName, tool_name, tool |
skillName | tool_input.skill, only when toolName is Skill or skill |
client | client; defaults to cursor, claude_code, or devin |
subagentId | subagent_id (Cursor subagentStart only) |
subagentType | subagent_type (Cursor subagentStart only) |
transcriptPath | transcript_path (Cursor subagentStart only) |
For Cursor subagentStart payloads, parent_conversation_id and conversation_id are used as sessionId fallbacks so the subagent event groups with the main Cursor session. conversation_id and parent_conversation_id are not used as sessionId fallbacks for any other event.
The entire raw JSON is always stored in the payload column, so any field not extracted is still available.
If the event is a blocking hook, record prints a JSON response to stdout so the agent can continue:
beforeSubmitPrompt → {"continue":true}preToolUse, beforeShellExecution, beforeMCPExecution, beforeReadFile, subagentStart → {"permission":"allow"}UserPromptSubmit, UserPromptExpansion → {"continue":true}PreToolUse, PermissionRequest, SubagentStart, SubagentStop, TaskCreated, TaskCompleted, Stop, WorktreeCreate, WorktreeRemove → {"decision":"approve"}record never writes to stdout for devin events.Other observer hooks produce no stdout output.
record is fail-open: if the database is locked by a concurrent operation (for example, the one-time backfill after an upgrade), it still prints the expected response for a blocking hook, but the event is not written to the database.
happenin import [--force]Imports existing transcripts:
~/.claude/projects/<project>/<session>.jsonl. Each tool_use block in an
assistant message is recorded as its own event with toolName set (and filePath for
Read/Edit/Write/MultiEdit/NotebookEdit, skillName for Skill calls), so tool usage,
skills used, and files touched are queryable. happenin sessions also lists tools, skills, and
files per session, and the dashboard's session detail view shows the same three lists.prompt_history.json and meta.json from ~/.cursor/chats/<hash>/<session>/store.db is skipped because it is encrypted.
After upgrading, run happenin import or happenin dashboard once to migrate the database schema and backfill existing Cursor subagentStart rows with subagentId, subagentType, transcriptPath, and the correct sessionId.
Files are only re-parsed when their modification time changes. Pass --force to clear that tracking and re-import every discovered file from scratch — use this after upgrading happenin to pick up extraction changes for transcripts that were already imported.
happenin query [options]Query captured events and print them as JSON, JSONL, or a summary.
happenin query --source cursor --event sessionStart --limit 10
happenin query --q "subagent" --format jsonl
happenin query --session abc123 --format summary
--source <source> — filter by cursor, claude, or devin.--event <event> — filter by event name.--session <id> — filter by session id (partial match).--q <text> — search event payloads.--since <id> — events with an id greater than <id>.--limit <n> — maximum rows (default 100).--offset <n> — skip the first <n> rows.--format <json|jsonl|summary> — output format (default json).--db <path> — database path.happenin sessions [options]Summarize recorded events grouped by session. Useful for reviewing activity across many sessions and event volumes.
happenin sessions --limit 10
happenin sessions --source cursor --format jsonl
happenin sessions --session abc123 --format summary
--source <source> — filter by cursor, claude, or devin.--event <event> — filter by event name.--session <id> — filter by session id (partial match).--q <text> — search event payloads.--since <id> — events with an id greater than <id>.--limit <n> — maximum sessions (default 100).--offset <n> — skip the first <n> sessions.--format <json|jsonl|summary> — output format (default json).--db <path> — database path.happenin dashboard [--port <port>] [--no-open] [--silent]Starts the local HTTP dashboard. Default port is 8765.
happenin dashboard
happenin dashboard --port 9000 --no-open
Use --no-open or --silent to start without launching the browser.
HAPPENIN_DB — override the SQLite database path. Default: ~/.happenin/happenin.db.NO_COLOR — disable colored help output.happenin install, add the plugin it prints to the agent, and restart the agent.happenin record <source> [event].happenin import.happenin query, happenin sessions, or start happenin dashboard.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub yoglib/happenin --plugin happenin