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
- macOS with Google Chrome installed
- Claude Code (CLI or desktop app)
- A Notion account and a free Notion internal integration
- Node.js 18+
Setup
1. Drop the files into your project
You need three files:
.claude/commands/tab-dump.md, the slash commandscripts/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/integrations → New integration. Name it anything. Capabilities: needs
Insert contentonly. - Copy the Internal Integration Secret (starts with
ntn_orsecret_). - 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
osascriptreads 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.mdcontaining instructions for Claude to follow when invoked. - A Node.js script
scripts/list-tabs.mjsthat usesosascript(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.mjsthat 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. ReadsNOTION_API_KEYandNOTION_PARENT_PAGE_IDfrom env.
Notion database schema:
Name(title), tab page titleURL(url), full URLSummary(rich_text), one-line AI-generated summaryTags(multi_select), 1–3 tags from a fixed set: research, tool, article, docs, video, social, shopping, news, project, miscCaptured(date), timestamp of the runSession(rich_text), optional label
Slash command flow:
- Read
.claude/tab-dump-db-id.jsonto get the database ID. If missing, tell the user to run the init script first. - Run
node scripts/list-tabs.mjsvia Bash, parse the JSON output. - 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).
- For each tab, call the Notion MCP's create-page tool with the schema body. On per-tab failure, log and continue.
- 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 aNOTION_PARENT_PAGE_IDenv 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
osascriptdirectly. 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.

