activity-record
Activity Record stores normalized local activity facts in a SQLite database located at `~/.Arkloop/activity-record/activity.db`, covering browser history across Chrome, Safari, and Chromium variants, screen time, shell commands, Bluetooth devices, keyboard and mouse input, window focus, clipboard activity, and optional Screenpipe integration. Query this data using bounded SQL with explicit time ranges or LIMIT clauses to retrieve timestamped activity events with metadata for personal analytics or system monitoring.
git clone --depth 1 https://github.com/qqqqqf-q/Arkloop /tmp/activity-record && cp -r /tmp/activity-record/src/plugins/activity-recorder/skills/activity-record ~/.claude/skills/activity-recordSKILL.md
# Activity Record
Activity Record stores normalized local activity facts in:
```bash
~/.Arkloop/activity-record/activity.db
```
Use bounded SQL queries. Always include a time range or `LIMIT`.
## Tables
### `activity_events`
| Column | Description |
|--------|-------------|
| `occurred_at` | RFC3339 timestamp |
| `source` | Source key (see Sources below) |
| `source_event_id` | Stable dedup key |
| `app` | App or profile name |
| `window_title` | Active window title when available |
| `url` | URL when available |
| `action` | Event action |
| `title` | Short event title |
| `text` | Longer text when available |
| `metadata_json` | Source-specific JSON |
| `ref_kind`, `ref_key` | Optional reference pointer |
### `source_cursors`
Incremental sync state per source. Diagnostics only.
### `activity_refs`
Optional reference files.
## Sources and Actions
### `chrome` — Chromium Browser History
Covers Chrome, Chrome Canary, Chromium, Edge, Brave. Multi-profile.
| Action | Title | Metadata |
|--------|-------|----------|
| `visited` | Page title | `profile`, `duration_sec`, `foreground_sec` |
| `downloaded` | Filename | `profile`, `path`, `size_bytes`, `mime_type` |
| `searched` | Search term | `profile`, `normalized_term` |
### `safari` — Safari History (macOS)
| Action | Title | Metadata |
|--------|-------|----------|
| `visited` | Page title | `domain`, `visit_count`, `load_successful`, `score` |
### `screentime` — macOS Screen Time (knowledgeC.db)
| Action | Title | Metadata |
|--------|-------|----------|
| `app_used` | App name | `bundle_id`, `source_bundle`, `device_id`, `duration_sec` |
| `screen_on` | "screen on" | `duration_sec` |
| `screen_off` | "screen off" | `duration_sec` |
| `notification_received` | App name | `bundle_id` |
| `media_used` | App name | `bundle_id`, `duration_sec`, `url`, `media_url` |
| `media_playing` | Track title or app | `bundle_id`, `duration_sec`, `playing`, `artist`, `album`, `genre` |
| `web_used` | Domain | `bundle_id`, `web_domain`, `duration_sec` |
| `bluetooth_connected` | Device name | `device_name`, `device_type`, `is_apple_audio_device`, `duration_sec` |
| `bluetooth_disconnected` | Device name | Same as above |
### `shell` — Shell Command History
Reads `~/.zsh_history` and `~/.bash_history`. Deduplicated by command hash.
| Action | Title | Metadata |
|--------|-------|----------|
| `command` | Command (truncated) | `shell`, `line_num`. Full command in `text` column. |
### `codex` — Claude Code Sessions
| Action | Title | Metadata |
|--------|-------|----------|
| `prompted` | Prompt text | `session_id`, `cwd` |
| `received` | Response text | `session_id`, `cwd`, `model` |
### `window` — Active Window Tracking (daemon)
| Action | Title | Metadata |
|--------|-------|----------|
| `focused` | "App - Window Title" | `duration_sec`, `pid` |
| `idle_start` | "idle" | `idle_threshold_sec` |
| `idle_end` | "idle" | — |
### `keyboard` — Keystroke Counting (daemon)
| Action | Title | Metadata |
|--------|-------|----------|
| `keystroke_count` | "N keystrokes in App" | `count`, `interval_sec`, `app`, `window_title` |
### `mouse` — Mouse Activity (daemon)
| Action | Title | Metadata |
|--------|-------|----------|
| `mouse_activity` | "N clicks, N scrolls in App" | `clicks`, `scrolls`, `interval_sec`, `app`, `window_title` |
### `clipboard` — Clipboard Changes (daemon)
| Action | Title | Metadata |
|--------|-------|----------|
| `clipboard_changed` | Content preview | `length`. Full text in `text` column when enabled. |
### `ax` — Screen Content via Accessibility Tree (daemon, macOS)
Captures visible text from the focused window by walking the macOS accessibility tree. No screen capture or OCR involved — zero WindowServer overhead.
| Action | Title | Metadata |
|--------|-------|----------|
| `ax_snapshot` | "App - Window Title" | `element_count`, `text_length`, `walk_duration_ms`, `content_hash`, `pid`, `truncated`, `truncation_reason` |
Text content: full visible text from the focused window is stored in the `text` column. Content is deduplicated by SHA-256 hash — identical screens do not produce repeated events.
Browser URL: extracted via `AXDocument` attribute when the focused app is a browser. Available in the `url` column.
Excluded apps: password managers (1Password, Bitwarden, KeePassXC, LastPass, Dashlane, Keychain Access) and incognito/private browsing windows are skipped entirely.
### `audio` — Microphone Transcription (daemon)
Transcribes microphone speech via an OpenAI-compatible API. Each segment passes an RMS gate, voice-activity detection, and music filtering before transcription, so only segments containing speech are stored.
| Action | Title | Metadata |
|--------|-------|----------|
| `audio_transcription` | Transcript preview | `duration_sec`, `device`, `language`, `model`. Full transcript in `text` column. |
Text content: the full transcript of each speech segment is stored in the `text` column. Overlapping words between consecutive segments are deduplicated.
## Examples
Recent activity across all sources:
```sql
SELECT occurred_at, source, action, title, url
FROM activity_events
ORDER BY occurred_at DESC
LIMIT 50;
```
What apps were used today (Screen Time):
```sql
SELECT title AS app, COUNT(*) AS sessions,
SUM(json_extract(metadata_json, '$.duration_sec')) AS total_sec
FROM activity_events
WHERE source = 'screentime' AND action = 'app_used'
AND occurred_at >= datetime('now', '-1 day')
GROUP BY title ORDER BY total_sec DESC
LIMIT 20;
```
Recent browser searches:
```sql
SELECT occurred_at, title AS search_term, url
FROM activity_events
WHERE source = 'chrome' AND action = 'searched'
AND occurred_at >= datetime('now', '-7 days')
ORDER BY occurred_at DESC
LIMIT 50;
```
Recent shell commands:
```sql
SELECT occurred_at, text AS command
FROM activity_events
WHERE source = 'shell' AND action = 'command'
ORDER BY occurred_at DESC
LIMIT 30;
```
Bluetooth device connections:
```sqlQuery the user's screen recordings, audio, UI elements, and usage analytics via the local Screenpipe REST API at localhost:3030. Use when the user asks about their screen activity, meetings, apps, productivity, media export, retranscription, or connected services.
Check Screenpipe health status, process state, and diagnose common issues
Retrieve and analyze Screenpipe CLI backend logs and desktop app logs for debugging
Drive real macOS applications through the CUA Driver MCP server when the user asks to inspect, operate, or automate visible desktop UI.