tracker_session_diff
Compare project tracker changes since a specific timestamp to identify new tasks, updates, and completed work at session start.
Instructions
Show what changed since a given timestamp. Returns aggregated summary with counts by action and entity type, plus highlights of key changes. Call this at the start of a session to understand what happened since the last one.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| since | Yes | ISO 8601 datetime — show changes after this time (e.g. "2026-02-21T15:00:00") |
Implementation Reference
- src/tools/activity.ts:105-148 (handler)The handler function 'handleSessionDiff' that processes the 'tracker_session_diff' tool request by querying the activity log and aggregating the results.
function handleSessionDiff(args: Record<string, unknown>) { const db = getDb(); const since = args.since as string; const rows = db .prepare('SELECT * FROM activity_log WHERE created_at >= ? ORDER BY created_at ASC') .all(since) as Array<Record<string, unknown>>; const now = new Date().toISOString().replace('T', ' ').slice(0, 19); // Aggregate by action const summary: Record<string, number> = { created: 0, updated: 0, status_changed: 0, deleted: 0 }; // Aggregate by entity_type -> action const byEntity: Record<string, Record<string, number>> = {}; const highlights: string[] = []; for (const row of rows) { const action = row.action as string; const entityType = row.entity_type as string; summary[action] = (summary[action] ?? 0) + 1; if (!byEntity[entityType]) { byEntity[entityType] = { created: 0, updated: 0, status_changed: 0, deleted: 0 }; } byEntity[entityType][action] = (byEntity[entityType][action] ?? 0) + 1; // Pick out highlights: status changes, creates, and deletes if (action === 'status_changed' || action === 'created' || action === 'deleted') { if (row.summary) highlights.push(row.summary as string); } } return { since, until: now, total_changes: rows.length, summary, by_entity_type: byEntity, highlights, activity: rows, }; } - src/tools/activity.ts:32-47 (schema)Tool definition and schema for 'tracker_session_diff' in the definitions array.
{ name: 'tracker_session_diff', description: 'Show what changed since a given timestamp. Returns aggregated summary with counts by action and entity type, plus highlights of key changes. Call this at the start of a session to understand what happened since the last one.', annotations: { title: 'Session Diff', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { since: { type: 'string', description: 'ISO 8601 datetime — show changes after this time (e.g. "2026-02-21T15:00:00")', }, }, required: ['since'], }, }, - src/tools/activity.ts:241-245 (registration)Tool registration mapping 'tracker_session_diff' to 'handleSessionDiff'.
export const handlers: Record<string, ToolHandler> = { activity_log: handleActivityLog, tracker_session_diff: handleSessionDiff, task_batch_update: handleTaskBatchUpdate, };