← all writing
2026-05-12 · 4 min read

Tab Dump — install & build guide

How to install the /tab-dump Claude Code slash command that snapshots open Chrome tabs into Notion, plus the full build brief to recreate it from scratch.

A /tab-dump slash command for Claude Code that snapshots every open Chrome tab into a Notion database — one-line summaries and auto-tags included — so you can close them all without losing context.

macOS only (uses AppleScript to read Chrome tabs).

Part 1 — Install (if you just want to use it)

Prerequisites

Setup

1. Drop the files into your project

You need three files:

  • .claude/commands/tab-dump.md — the slash command
  • scripts/list-tabs.mjs — Chrome tab lister (AppleScript wrapper)
  • scripts/tab-dump-init.mjs — one-time Notion database creator

To make /tab-dump available in every Claude session anywhere on your machine, put tab-dump.md in ~/.claude/commands/ instead — then the scripts can live anywhere you point the command at.

2. Prep Notion

  • Go to notion.so/profile/integrationsNew integration. Name it anything. Capabilities: needs Insert content only.
  • Copy the Internal Integration Secret (starts with ntn_ or secret_).
  • In Notion, open any page where you want "Tab Dumps" to live (a parent page — the database will be created inside it). Click Share → invite your integration. Copy the page ID from the URL (the 32-char hex tail).

3. Create the database (one time)

NOTION_API_KEY=<your-secret> \
NOTION_PARENT_PAGE_ID=<page-id> \
node scripts/tab-dump-init.mjs

You should see Tab Dumps database ready: <db-id>. The ID is cached at .claude/tab-dump-db-id.json (gitignored).

4. Use it

Open Claude Code in the project, type /tab-dump. Claude reads your open Chrome tabs, summarizes them, writes rows to Notion. Then close your tabs without guilt.

First time osascript reads Chrome, macOS will prompt for permission to control Chrome — grant it once.

Part 2 — Build it yourself (the brief)

If you want to recreate this from scratch (or build a variant), paste this brief into a Claude Code session:

Goal: Build a /tab-dump slash command for Claude Code that snapshots every open Chrome tab into a Notion database so I can safely close them.

Architecture:

  • A markdown slash command in .claude/commands/tab-dump.md containing instructions for Claude to follow when invoked.
  • A Node.js script scripts/list-tabs.mjs that uses osascript (AppleScript) to read all open Chrome tabs across all windows and outputs JSON [{title, url}, ...]. macOS only.
  • A Node.js init script scripts/tab-dump-init.mjs that uses the Notion REST API to create a database under a user-specified parent page. Caches the database ID in .claude/tab-dump-db-id.json (gitignored). Idempotent: if cache exists, skip creation. Reads NOTION_API_KEY and NOTION_PARENT_PAGE_ID from env.

Notion database schema:

  • Name (title) — tab page title
  • URL (url) — full URL
  • Summary (rich_text) — one-line AI-generated summary
  • Tags (multi_select) — 1–3 tags from a fixed set: research, tool, article, docs, video, social, shopping, news, project, misc
  • Captured (date) — timestamp of the run
  • Session (rich_text) — optional label

Slash command flow:

  1. Read .claude/tab-dump-db-id.json to get the database ID. If missing, tell the user to run the init script first.
  2. Run node scripts/list-tabs.mjs via Bash, parse the JSON output.
  3. In one batch pass, generate a one-sentence summary and 1–3 tags per tab using only title + URL (don't fetch page content — too slow).
  4. For each tab, call the Notion MCP's create-page tool with the schema body. On per-tab failure, log and continue.
  5. Report "Saved N tabs to Notion. Safe to close."

Important constraints:

  • Notion's REST API does NOT support parent: {type: "workspace", workspace: true} for databases created by internal integrations. The init script must require a NOTION_PARENT_PAGE_ID env var pointing to a page the integration has been explicitly shared with.
  • Chrome MCPs vary wildly across setups. Don't depend on any specific Chrome MCP — use AppleScript via osascript directly. This works on any macOS without extensions or third-party packages.
  • Slash commands in Claude Code live in .claude/commands/<name>.md (project) or ~/.claude/commands/<name>.md (global). The file content is the prompt Claude executes when the command is invoked.

Setup script the user runs:

NOTION_API_KEY=ntn_xxx NOTION_PARENT_PAGE_ID=abc123... node scripts/tab-dump-init.mjs

Use TDD for the init script. Use node:test and native fetch (Node 18+). Make fetch and the cache path injectable so unit tests don't hit the network or filesystem unexpectedly.

That's the whole brief. Drop it into Claude Code and it should produce a working version in one session.

Why this exists

Tab hoarding is a research-tax — every open tab is "I should revisit this." Closing them feels like throwing away unfinished work. Dumping titles + URLs + one-line summaries into a searchable Notion database removes the cost: the context is preserved, the tabs are gone, your browser is fast again.