taylorhbuilds.
repos / browser access for agents

cdpidletabs

Close idle Chrome tabs over the DevTools protocol. Dry-run by default.

group
browser access for agents
language
Python
licence
MIT
updated
install
pending
github
TayHCode/cdpidletabs ↗

readme summary

from the source repository; its own licence applies. up to two introductory paragraphs. sensitive-shaped strings are marked [removed].

Each run queries a Chrome DevTools Protocol (CDP) endpoint for page tabs and compares each tab's title and URL with the previous run. When that pair has stayed unchanged for the configured threshold, the script reports the tab as idle; with --close, it asks Chrome to close it. It runs in dry-run mode by default, protects the first real page in Chrome’s list, and skips URLs matching --keep patterns.

Check python3 --version. If Python is missing or older than 3.8, install a supported Python 3 through your distribution's package manager. You can run python3 close_idle_tabs.py directly; neither pip nor a virtual environment is required.

what it does

Each run queries a Chrome DevTools Protocol endpoint for page tabs and compares each tab's title and URL with the previous run. Tabs unchanged for the configured threshold are reported as idle; with --close, it asks Chrome to close them. It protects the first real page and skips URLs matching --keep patterns.

why it helps run agents

Long agent sessions pile up tabs. Run it on a timer next to cdp-setup-kit to keep shared browsers lean.

requirements

  • Python 3.8+, standard library only
  • Chrome started with remote debugging

install

condensed from the source readme. follow it for full, current instructions.

From the cloned repository, check the options first:

python3 close_idle_tabs.py --help

With CDP_ENDPOINT set, report tabs unchanged for ten minutes while keeping a docs path open:

python3 close_idle_tabs.py --idle-seconds 600 --keep 'https://example.com/docs/*'

The first run records tab state; run it repeatedly at a shorter interval than the threshold. Review the dry-run output, then add --close. The README includes example systemd user units for scheduled runs.

similar projects

similar open-source projects on github
projecthow it compares
greatsuspender/thegreatsuspenderA classic browser extension that suspends tabs to free memory. Extensions act inside a human's browser; cdpidletabs works from outside over CDP, suited to agent-controlled Chrome.
AnNOtis/close-idle-tabsA browser extension with a button to close inactive tabs. Manual and in-browser, not schedulable from a server.

based on each public repository, reviewed 2026-10-13. not a ranking.

related docs