reference
What Pheebs captures
Every hook Pheebs registers, the event it produces, and the fields in the event, for all three agents.
Every event carries the same base shape. The ai_tool field says which agent produced it, and the extra fields vary by event.
{
"timestamp": "2026-03-13T14:30:00.000Z",
"source": "hook",
"event": "context_compacted",
"developer": "dev_01H8X",
"codebase": "Eversynced/pheebs",
"ai_tool": "claude_code",
"session_id": "abc123",
"trigger_type": "auto"
}How a line gets written
When a hook fires, Pheebs:
- Reads the hook payload from stdin.
- Pulls out session metadata: session ID and event type.
- Runs an agent-specific extractor for the relevant fields.
- Works out who you are (the id behind your token, or a hashed git email when no token is set) and what repo you are in (
org/repofrom the git remote). - Writes a JSONL line to the local log file.
- Sends it to the backend at
POST <endpoint>/ingest, authenticated with your token. The backend stamps your identity from the token. With no token set, the backend request is skipped and only the local log is kept.
Claude Code
| Hook | Event | Extra fields | What Pheebs is looking at |
|---|---|---|---|
SessionStart | session_started | start_source, model | How are sessions starting: fresh, resumed, or after a clear? |
PostModelSwitch | model_switched | from_model, to_model, switch_source | Do developers move between models mid-session, and what prompted the move? |
UserPromptSubmit | prompt_submitted | prompt_length | How much context is front-loaded up front? prompt_length is the prompt's character count (the prompt text itself is never stored). Size thresholds are applied downstream when charting. |
UserPromptExpansion | command_expanded | command_name, expansion_type, command_source | Which slash commands / skills are being expanded? |
SubagentStart | subagent_spawned | agent_type, agent_id | How often are subagents being delegated to, and what kind? |
SubagentStop | subagent_completed | agent_type, agent_id, stop_hook_active | How do subagent runs end? |
PostToolUse | tool_use_completed | tool_name, duration_ms | Which tools are used and how long do they take? |
PostToolUseFailure | tool_use_failed | tool_name, duration_ms, is_interrupt | Which tools fail, and how much back-and-forth follows? |
PreCompact (auto) | context_compacted | trigger_type | How deep do sessions get before the context overflows? |
PreCompact (manual) | context_compacted | trigger_type | Are developers manually compacting, or only hitting the limit? |
TaskCreated | task_created | task_id, task_subject, teammate_name | Are background tasks being used, and by whom? |
TaskCompleted | task_completed | task_id, task_subject, teammate_name | Are background tasks part of the workflow? |
Stop | turn_ended | stop_hook_active, background_task_count, session_cron_count | When do turns end, and what's running in the background? |
SessionEnd | session_end | reason | When and why do sessions end? |
Cursor
| Hook | Event | Extra fields | What Pheebs is looking at |
|---|---|---|---|
sessionStart | session_started | is_background_agent, effort, fast_mode | How are sessions starting, are background agents involved, and how is the model configured? |
beforeSubmitPrompt | prompt_submitted | model, composer_mode, command_name, prompt_length, effort, fast_mode, rule_attachment_count | What models/modes are used, which slash commands / skills are invoked, how much context is front-loaded, and are rules attached to the prompt? command_name is derived from a leading /command and prompt_length is the prompt's character count. The prompt text itself is never stored. rule_attachment_count counts attachments whose type is rule. The attachment's file_path is never read. |
subagentStart | subagent_spawned | agent_type, agent_id, subagent_model, is_parallel_worker | How often are subagents being delegated to? |
subagentStop | subagent_completed | agent_type, status, subagent_duration_ms, tool_call_count | How do subagent runs end? |
beforeShellExecution | tool_invoked | tool_name | What tools is the agent reaching for? |
afterShellExecution | tool_use_completed | tool_name, duration_ms | How long do tool calls take? |
beforeMCPExecution | tool_invoked | tool_name | Are MCP tools part of the workflow? |
afterMCPExecution | tool_use_completed | tool_name, duration_ms | How reliable are MCP tool calls? |
afterFileEdit | tool_use_completed | tool_name | How often does the agent edit files? |
postToolUseFailure | tool_use_failed | tool_name, failure_type, is_interrupt | Which tools fail, and why? |
preCompact | context_compacted | trigger_type, context_usage_percent, context_tokens | How deep do sessions get before compaction? |
stop | turn_ended | status, loop_count, effort, fast_mode | When do turns end, and how many loops did they take? |
sessionEnd | session_end | reason, session_duration_ms, is_background_agent | When and why do sessions end? |
Cursor events also capture conversation_id, generation_id, cursor_version, loop_count, and token counts where available.
Codex
| Hook | Event | Extra fields | What Pheebs is looking at |
|---|---|---|---|
SessionStart | session_started | model, start_source, permission_mode | How are sessions starting, and with what model? |
UserPromptSubmit | prompt_submitted | model, command_name, prompt_length, permission_mode | How often are prompts submitted, which slash commands / skills are invoked, and how much context is front-loaded? command_name is derived from a leading /command and prompt_length is the prompt's character count. The prompt text itself is never stored. |
SubagentStart | subagent_spawned | agent_id, agent_type | How often are subagents being delegated to? |
SubagentStop | subagent_completed | agent_id, agent_type, stop_hook_active | How do subagent runs end? |
PreToolUse | tool_invoked | tool_name, tool_pattern, permission_mode | What tools does Codex reach for? |
PostToolUse | tool_use_completed | tool_name, tool_pattern, permission_mode | Do tool calls succeed? |
PermissionRequest | permission_requested | tool_name, permission_type, approved | How often does the sandbox ask for permission? |
PreCompact | context_compacted | trigger_type | How deep do sessions get before compaction? |
PostCompact | compaction_completed | trigger_type | What happens after compaction? |
Stop | turn_ended | model, input_tokens, output_tokens, duration_ms, stop_hook_active, permission_mode | Turn length and token usage. |
OpenTelemetry
For agents with native OpenTelemetry export (Claude Code and Codex), pheebs init also configures OTLP export through the backend's /otel proxy, authenticated with your token. This gives metrics and logs alongside the hook events, and the client never holds an observability credential of its own.
OTel activates only once both an endpoint and a token are set. Skip it with pheebs init --no-otel.
What is not here
No source code, no file contents, no file paths, no command strings, and no prompt text.