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:

  1. Reads the hook payload from stdin.
  2. Pulls out session metadata: session ID and event type.
  3. Runs an agent-specific extractor for the relevant fields.
  4. 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/repo from the git remote).
  5. Writes a JSONL line to the local log file.
  6. 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

HookEventExtra fieldsWhat Pheebs is looking at
SessionStart session_startedstart_source, modelHow are sessions starting: fresh, resumed, or after a clear?
PostModelSwitch model_switchedfrom_model, to_model, switch_sourceDo developers move between models mid-session, and what prompted the move?
UserPromptSubmit prompt_submittedprompt_lengthHow 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_expandedcommand_name, expansion_type, command_sourceWhich slash commands / skills are being expanded?
SubagentStart subagent_spawnedagent_type, agent_idHow often are subagents being delegated to, and what kind?
SubagentStop subagent_completedagent_type, agent_id, stop_hook_activeHow do subagent runs end?
PostToolUse tool_use_completedtool_name, duration_msWhich tools are used and how long do they take?
PostToolUseFailure tool_use_failedtool_name, duration_ms, is_interruptWhich tools fail, and how much back-and-forth follows?
PreCompact (auto) context_compactedtrigger_typeHow deep do sessions get before the context overflows?
PreCompact (manual) context_compactedtrigger_typeAre developers manually compacting, or only hitting the limit?
TaskCreated task_createdtask_id, task_subject, teammate_nameAre background tasks being used, and by whom?
TaskCompleted task_completedtask_id, task_subject, teammate_nameAre background tasks part of the workflow?
Stop turn_endedstop_hook_active, background_task_count, session_cron_countWhen do turns end, and what's running in the background?
SessionEnd session_endreasonWhen and why do sessions end?

Cursor

HookEventExtra fieldsWhat Pheebs is looking at
sessionStart session_startedis_background_agent, effort, fast_modeHow are sessions starting, are background agents involved, and how is the model configured?
beforeSubmitPrompt prompt_submittedmodel, composer_mode, command_name, prompt_length, effort, fast_mode, rule_attachment_countWhat 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_spawnedagent_type, agent_id, subagent_model, is_parallel_workerHow often are subagents being delegated to?
subagentStop subagent_completedagent_type, status, subagent_duration_ms, tool_call_countHow do subagent runs end?
beforeShellExecution tool_invokedtool_nameWhat tools is the agent reaching for?
afterShellExecution tool_use_completedtool_name, duration_msHow long do tool calls take?
beforeMCPExecution tool_invokedtool_nameAre MCP tools part of the workflow?
afterMCPExecution tool_use_completedtool_name, duration_msHow reliable are MCP tool calls?
afterFileEdit tool_use_completedtool_nameHow often does the agent edit files?
postToolUseFailure tool_use_failedtool_name, failure_type, is_interruptWhich tools fail, and why?
preCompact context_compactedtrigger_type, context_usage_percent, context_tokensHow deep do sessions get before compaction?
stop turn_endedstatus, loop_count, effort, fast_modeWhen do turns end, and how many loops did they take?
sessionEnd session_endreason, session_duration_ms, is_background_agentWhen and why do sessions end?

Cursor events also capture conversation_id, generation_id, cursor_version, loop_count, and token counts where available.

Codex

HookEventExtra fieldsWhat Pheebs is looking at
SessionStart session_startedmodel, start_source, permission_modeHow are sessions starting, and with what model?
UserPromptSubmit prompt_submittedmodel, command_name, prompt_length, permission_modeHow 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_spawnedagent_id, agent_typeHow often are subagents being delegated to?
SubagentStop subagent_completedagent_id, agent_type, stop_hook_activeHow do subagent runs end?
PreToolUse tool_invokedtool_name, tool_pattern, permission_modeWhat tools does Codex reach for?
PostToolUse tool_use_completedtool_name, tool_pattern, permission_modeDo tool calls succeed?
PermissionRequest permission_requestedtool_name, permission_type, approvedHow often does the sandbox ask for permission?
PreCompact context_compactedtrigger_typeHow deep do sessions get before compaction?
PostCompact compaction_completedtrigger_typeWhat happens after compaction?
Stop turn_endedmodel, input_tokens, output_tokens, duration_ms, stop_hook_active, permission_modeTurn 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.