Safari history

From mvanhorn/printing-press-library · View interactive version

Safari history is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. Query local Safari browsing history with zero network access: search, visit checks, domain/activity reports, timelines, graphs, dwell estimates, and profile summaries. Trigger phrases: "what have I been browsing", "search my safari history", "what was that page I saw", "what sites do I visit most",

How to use this skill

Skill file

pp-safari-history

Prerequisites: Install the CLI

This skill drives the safari-history-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer:

```bash

npx -y @mvanhorn/printing-press-library install safari-history --cli-only

```

  1. Verify: safari-history-pp-cli --version
  2. Ensure $GOPATH/bin (or $HOME/go/bin) is on $PATH.

If the npx install fails before this CLI has a public-library category, install Node or use the category-specific Go fallback after publish.

If --version reports "command not found" after install, the install step did not put the binary on $PATH. Do not proceed with skill commands until verification succeeds.

safari-history-pp-cli reads Safari's local History.db, snapshots it to ~/.cache/safari-history/, builds an offline full-text index, and answers questions about your browsing. Read-only, zero network — nothing leaves the machine. Requires macOS Full Disk Access to read ~/Library/Safari/History.db. Every command supports --json and --select, and the same surface is exposed as MCP tools (all read-only) via safari-history-pp-cli mcp.

When to use

Historical Safari browsing activity from ~/Library/Safari/History.db: recall pages, check if you visited a site, rank domains, and generate time/profile reports.

Anti-triggers

Categorization (for agents)

The domains static category map is coarse, and Safari has no journeys clusters — so for real topic categorization, read the --json titles/URLs and infer topics yourself. Agent inference is the only path to vault-quality topics here.

Setup

safari-history-pp-cli sync
safari-history-pp-cli doctor

If Safari DB access fails, grant terminal Full Disk Access (System Settings -> Privacy & Security -> Full Disk Access).

Core commands

iCloud tabs (synced open tabs from other devices)

icloud-tabs reads synced iCloud tabs — the open tabs from your other Apple devices — directly from Safari's CloudTabs.db (separate from History.db; does not require sync).

Accumulating archive (history that outlives Safari's pruning)

Safari prunes old history; the opt-in archive keeps a durable archive.db that accumulates across syncs.

Off by default and additive — plain sync is unchanged.

Agent notes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.