Get focus heatmap (hour × weekday grid)
get_focus_heatmapReveals when you usually work by returning a 168-cell weekly grid of active seconds. Filter by app, project, or tag to see patterns that hourly or weekday averages miss.
Instructions
Returns a dense 168-cell grid (7 weekdays × 24 hours) of active foreground seconds. Reveals when you usually do specific kinds of work — patterns the marginal hour-of-day and weekday distributions can't show. Optional app / project / tag filters narrow the heatmap to a single activity (e.g. 'when do I usually code in Cursor?'); the tag is matched by name (case-insensitive) or id, and include_descendants rolls up a parent tag's whole subtree. Cells array is in (weekday, hour) order so cells[w*24 + h] indexes directly. 0=Sunday in weekday.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app | No | Restrict to a single app (canonical name) | |
| tag | No | Restrict to entries carrying this tag (name, case-insensitive, or numeric id) | |
| device | No | Restrict to a single device. Pass 'current' (or 'this') for the local machine, a device UUID from get_device_breakdown, or a platform name like 'darwin', 'win32', 'browser-extension'. Omit or pass 'all' for no device filter. | |
| period | No | today | yesterday | week | month | year | a single date YYYY-MM-DD | an inclusive date range YYYY-MM-DD..YYYY-MM-DD | month |
| project | No | Restrict to a single project (exact match) | |
| include_descendants | No | Roll up the tag's whole subtree (the tag plus all of its nested child tags) instead of only its directly-assigned time. Use for a parent tag whose time lives in its children. Default false. |