scalpel@labs: ~/glossary/pinned-tab.mdx5 sections

Pinned Tabs and Why Scalpel Leaves Them Alone

A pinned tab is one you have fixed to the left of the tab strip, shrunk to its favicon. People pin the tabs they keep open all day, so Scalpel protects pinned tabs from the automatic sweep by default.

extension: Scalpel Tab Suspenderupdated: 2026-08-14read_time: 2 min
less pinned-tab.mdx

Why it matters

A pinned tab sits at the left of the tab strip and usually stays there. You pin things you check constantly: your email, a chat app, a status dashboard, a music player. If Scalpel suspended those, you'd lose the context you've spent the morning building.

So Scalpel protects pinned tabs by default. This is a reasonable heuristic: if you pinned it, you probably want it running.

How it works

Pinning is a Chrome feature. Right-click a tab and choose "Pin tab", or hit the keyboard shortcut in your browser. The tab shrinks to show only its favicon and moves to the left. Pinned tabs are harder to close by accident.

When Scalpel runs its automatic sweep, it checks each tab. Before it suspends a tab on the timer, it asks Chrome: is this tab pinned? If yes, leave it alone. If no, check the other exclusions (audible, unsaved input, never-suspend list) and suspend if nothing else protects it.

The pinned-tab protection is a toggle in Settings. If you turn it off, pinned tabs are treated like any other tab and can suspend just like the rest. That's rare, but some people pin a lot and want the memory back.

What does not matter

Pinning does not prevent manual suspension. If you click "Suspend now", Scalpel will suspend a pinned tab on purpose. The protection is about the automatic sweep, not about stopping you from doing something intentional.

Pinning a tab does not make it "unsuspendable". It just means Scalpel won't suspend it without your say-so. Restarting the browser will reload a pinned tab if it was suspended before the restart, but restarting won't un-suspend it on its own.

The number of pinned tabs doesn't matter. You can pin ten tabs and all ten are protected. The protection doesn't degrade if you pin more.

Code example

Here's how the pinned-tab check fits into the sweep:

// Get the pinned-tab protection setting
async function shouldProtectPinnedTabs() {
  const { protectPinned } = await chrome.storage.sync.get({ protectPinned: true });
  return protectPinned;
}

// Before suspending a tab, check if it's pinned
async function canSuspendTab(tab) {
  // Check never-suspend list first
  if (await isOnNeverSuspendList(tab.url)) {
    return false; // Protected
  }

  // Check audible tabs
  if (tab.audible) {
    const { protectAudible } = await chrome.storage.sync.get({ protectAudible: true });
    if (protectAudible) return false;
  }

  // Check pinned tabs
  if (tab.pinned) {
    const protect = await shouldProtectPinnedTabs();
    if (protect) return false;
  }

  // Check unsaved form input
  if (await tabHasUnsavedInput(tab.id)) {
    const { protectFormInput } = await chrome.storage.sync.get({ protectFormInput: true });
    if (protectFormInput) return false;
  }

  return true; // No exclusion matched; safe to suspend
}

// During the sweep
async function runSweep() {
  const tabs = await chrome.tabs.query({});
  for (const tab of tabs) {
    const inactive = await getTabInactivityTime(tab.id) > getInactivityTimer();
    const current = tab.active; // Don't suspend the tab you're viewing

    if (inactive && !current && await canSuspendTab(tab)) {
      await chrome.tabs.discard(tab.id);
    }
  }
}

// Manual suspend ignores the protection
async function suspendNow(tabId) {
  const tab = await chrome.tabs.get(tabId);
  // No check for pinned; just suspend it
  await chrome.tabs.discard(tabId);
}

How Scalpel shows it

In the Settings tab, you'll find "Protect pinned tabs" as a toggle, on by default. If you turn it off, Scalpel will treat pinned tabs the same as any other tab. The popup shows a pin icon next to a tab's title if the tab is pinned (Chrome's standard UI).

Sources