#2264·LifeOS

Interceptor CleanupTabs.sh closes the operator's own tabs: it closes every non-active tab in the pinned context, not only tabs Interceptor opened

Author: MatiasBarbozaCreated Sep 29, 2026Updated Sep 30, 2026

Version

LifeOS 7.40.4 (clean tag) · Interceptor skill · interceptor CLI 1.0.19 (browser-only install)

What is broken

Tools/CleanupTabs.sh closes every non-active tab in the pinned context, including tabs the operator opened themselves. The skill's delegation recipe tells every agent to run it as its final action, so an agent following the recipe closes the operator's own tabs.

The script was written for a dedicated test profile, where every tab is disposable. But the pinned context is whatever INTERCEPTOR_TEST_CONTEXT_ID names, and the skill supports driving a real, signed-in profile (it's the whole point of "real sessions"). The only guard is the Default/INTERCEPTOR_WORKING_PROFILE_IDS deny-list (fixed in #1802), and a list of profile names can't tell an operator's tab from an agent's tab inside an allowed profile.

On one real profile with 61 open tabs, --dry-run selected 60 of them. Only 1 had been opened by Interceptor.

Where (file:line)

  • skills/Interceptor/Tools/CleanupTabs.sh:95-136: lists tabs from the plain-text interceptor tabs output and closes every non-active one. The header (line 13) says: "Close all non-active tabs in the test context".
  • skills/Interceptor/SKILL.md, "Delegating to Agents": "FINAL action after your work is done and evidence captured: run CleanupTabs.sh".

Repro on a clean tree (no browser touched)

A fake interceptor goes first on PATH. It reports three tabs: one active and two others, none opened by Interceptor. It logs every tab close.

bash
set -uo pipefail
TREE="$1"; T="$(mktemp -d)"; trap 'rm -rf "$T"' EXIT
mkdir -p "$T/bin" "$T/home/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Interceptor"
echo 'INTERCEPTOR_TEST_CONTEXT_ID="test-ctx"' > "$T/home/.claude/LIFEOS/USER/CUSTOMIZATIONS/SKILLS/Interceptor/preferences.env"
# Three tabs, as `interceptor tabs` prints them: 1 = active (operator's), 2 = operator's own
# ungrouped tab, 3 = operator's own ungrouped tab. None was opened by Interceptor.
cat > "$T/bin/interceptor" <<'FAKE'
#!/usr/bin/env bash
case "$1" in
  contexts) echo "[0] → contexts"; echo "test-ctx" ;;
  tabs) echo "[0] → tab_list"
        printf '* 1  https://mail.example/  Inbox\n  2  https://docs.example/  My doc\n  3  https://bank.example/  Bank\n' ;;
  tab)  [[ "$2" == close ]] && echo "closed tab $3" >> "$CLOSED_LOG" ;;
esac
FAKE
chmod +x "$T/bin/interceptor"
HOME="$T/home" PATH="$T/bin:$PATH" CLOSED_LOG="$T/closed" \
  bash "$TREE/LifeOS/install/skills/Interceptor/Tools/CleanupTabs.sh"
echo "--- tabs closed by CleanupTabs.sh:"; cat "$T/closed" 2>/dev/null || echo "(none)"
bash
git clone --depth 1 --branch v7.40.4 https://github.com/danielmiessler/LifeOS.git lifeos-clean
bash repro.sh lifeos-clean

Negative control (unpatched 7.40.4)

CleanupTabs.sh: closed 2 tab(s), kept 1 (context test-ctx).
--- tabs closed by CleanupTabs.sh:
closed tab 2
closed tab 3

Tabs 2 and 3 belong to the operator. Expected result: nothing closed.

Suggested fix

interceptor tabs --json (1.0.x) marks each tab with managed and group. Tabs inside a group Interceptor created (--group / INTERCEPTOR_GROUP) are managed: true, and everything else is managed: false, group: null. Close only managed tabs, add --group <label> so an agent cleans only its own group (a parallel agent's tabs survive), and close nothing if the JSON can't be parsed. The recipe then says: open with --group <label>, finish with CleanupTabs.sh --group <label>.

We run a patch that does exactly this. On the same fake: it closes only the grouped tab, closes nothing when no tab is grouped, and keeps the active tab of a group. On the real 61-tab profile it closed only the one grouped tab it opened, and the rest of the tab list came out identical, verified by comparing tab ids before and after. Happy to open a PR if useful.

Related: #1802 (deny-list parse in this script), #2065 (Capture.sh --out).