Event Schema#

Every event in Vibetracker follows the VibeEvent schema. This page documents all available fields.

Database Overview#

Storage Location#

Vibetracker stores all events in a SQLite database at:

~/.vibetracker/events.db

Table Structure#

All events are stored in a single events table. This is intentionally designed as a wide table similar to observability and analytics databases (like ClickHouse or TimescaleDB schemas). The wide table design allows you to:

  • Run complex analytical queries across all event types without joins
  • Filter and aggregate on any combination of fields
  • Easily export or sync data without reconstructing relationships

Schema Definition#

CREATE TABLE `events` (
	`id` text PRIMARY KEY NOT NULL,
	`timestamp` text NOT NULL,
	`user_id` text NOT NULL,
	`team_id` text,
	`machine_id` text,
	`session_id` text NOT NULL,
	`event_type` text NOT NULL,
	`source` text NOT NULL,
	`session_cwd` text,
	`session_git_repo` text,
	`session_git_branch` text,
	`session_duration_ms` integer,
	`turn_index` integer,
	`prompt_tokens` integer,
	`completion_tokens` integer,
	`total_tokens` integer,
	`model` text,
	`tool_name` text,
	`tool_name_raw` text,
	`tool_input` text,
	`tool_output` text,
	`tool_duration_ms` integer,
	`tool_success` integer,
	`mcp_server` text,
	`mcp_tool_name` text,
	`file_path` text,
	`file_action` text,
	`file_lines_added` integer,
	`file_lines_removed` integer,
	`bash_command` text,
	`bash_command_output` text,
	`error_message` text,
	`error_code` text,
	`prompt_text` text,
	`agent_id` text,
	`agent_type` text,
	`meta` text,
	`synced_at` text
);

CREATE UNIQUE INDEX `idx_events_dedup` ON `events` (`session_id`, `timestamp`, `event_type`, COALESCE(`tool_name_raw`, ''), COALESCE(`tool_input`, ''));
CREATE INDEX `idx_events_timestamp` ON `events` (`timestamp`);
CREATE INDEX `idx_events_session` ON `events` (`session_id`);
CREATE INDEX `idx_events_synced` ON `events` (`synced_at`);
CREATE INDEX `idx_events_agent` ON `events` (`agent_id`);

Field Reference#

Core Fields#

These fields are present on every event.

FieldTypeDescription
idstringUnique identifier (UUIDv7) for the event
timestampstringISO 8601 timestamp when the event occurred
user_idstringUser identifier from configuration
session_idstringUnique identifier for the coding session
event_typeEventTypeType of event (see below)
sourceAgentSourceWhich agent generated this event

Optional Core Fields#

FieldTypeDescription
team_idstringTeam identifier (if configured)
machine_idstringMachine identifier (if configured)

Event Types#

The event_type field indicates what kind of event occurred:

ValueDescription
session_startA new coding session began
session_endA coding session completed
promptUser submitted a prompt to the agent
turn_startAgent began processing a turn
turn_endAgent completed a turn
tool_callAgent invoked a tool
errorAn error occurred

Agent Sources#

The source field identifies which agentic coding tool generated the event:

ValueDescription
claude_codeAnthropic’s Claude Code CLI
codexOpenAI Codex
geminiGoogle Gemini CLI
opencodeOpenCode
cursorCursor editor
otherOther/unknown source

Session Context Fields#

These fields provide context about the coding session.

FieldTypeDescription
session_cwdstringWorking directory when session started
session_git_repostringGit repository URL or name
session_git_branchstringGit branch name
session_duration_msnumberTotal session duration in milliseconds (on session_end)

Turn and Token Fields#

These fields track AI model usage per turn.

FieldTypeDescription
turn_indexnumberSequential index of the turn within the session (0-based)
prompt_tokensnumberNumber of tokens in the prompt
completion_tokensnumberNumber of tokens in the completion
total_tokensnumberTotal tokens used (prompt + completion)
modelstringModel identifier (e.g., claude-sonnet-4-20250514)

Tool Execution Fields#

These fields are populated on tool_call events.

FieldTypeDescription
tool_nameToolNameNormalized tool name (see below)
tool_name_rawstringOriginal tool name from the agent
tool_inputstringInput/arguments passed to the tool
tool_outputstringOutput returned by the tool
tool_duration_msnumberTime to execute the tool in milliseconds
tool_successbooleanWhether the tool execution succeeded

Tool Names#

The tool_name field is normalized across agent sources:

ValueDescription
bashShell command execution
file_readReading file contents
file_writeWriting/creating files
file_editEditing existing files
file_deleteDeleting files
grepSearching file contents
globFinding files by pattern
list_dirListing directory contents
web_fetchFetching web content
web_searchWeb search queries
taskSpawning subagent tasks
mcp_toolModel Context Protocol tool
otherOther/unknown tool

MCP Server Fields#

These fields are populated when an MCP (Model Context Protocol) tool is invoked.

FieldTypeDescription
mcp_serverstringName of the MCP server
mcp_tool_namestringName of the tool on the MCP server

File Operation Fields#

These fields provide details about file operations.

FieldTypeDescription
file_pathstringPath to the file being operated on
file_actionstringAction type: create, update, or delete
file_lines_addednumberNumber of lines added
file_lines_removednumberNumber of lines removed

Bash Execution Fields#

These fields capture shell command executions.

FieldTypeDescription
bash_commandstringThe shell command that was executed
bash_command_outputstringOutput from the command execution

Error Fields#

These fields are populated on error events.

FieldTypeDescription
error_messagestringHuman-readable error message
error_codestringError code or classification

Prompt Fields#

FieldTypeDescription
prompt_textstringThe user’s prompt text (on prompt events)

Subagent Fields#

These fields track subagent/task spawning.

FieldTypeDescription
agent_idstringUnique identifier for the subagent
agent_typestringType of subagent (e.g., Explore, Bash)

Metadata Fields#

FieldTypeDescription
metaobjectArbitrary JSON metadata
synced_atstringTimestamp when event was synced to remote (if applicable)