Back to Skills

cleanup-lists

TomGranot
Updated 2 days ago
8 views
33
11
33
View on GitHub
Communicationaiautomation

About

This Claude Skill audits and cleans up HubSpot lists by identifying and removing unused, empty, or duplicate list definitions. It specifically finds lists with zero members, those not used in workflows or emails, and lists with overlapping criteria. Use this for ongoing HubSpot maintenance to reduce UI clutter and improve system performance.

Quick Install

Claude Code

Recommended
Primary
npx skills add TomGranot/hubspot-admin-skills -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/TomGranot/hubspot-admin-skills
Git CloneAlternative
git clone https://github.com/TomGranot/hubspot-admin-skills.git ~/.claude/skills/cleanup-lists

Copy and paste this command in Claude Code to install this skill

Documentation

Cleanup Lists

Audit HubSpot lists to remove clutter. Unused lists slow down the UI, confuse team members, and can mask the lists that actually matter.

Prerequisites

  • HubSpot API token in .env
  • Python with hubspot-api-client installed via uv
  • Note: Lists API access may return 403 on some plan tiers. If so, perform the audit manually in the UI.

Step-by-Step Instructions

Stage 1: Before — Inventory All Lists

Pull all lists via the API:

from hubspot import HubSpot

api_client = HubSpot(access_token=os.getenv("HUBSPOT_API_TOKEN"))

lists = []
offset = 0
while True:
    response = api_client.crm.lists.lists_api.get_page(offset=offset, limit=100)
    lists.extend(response.results)
    if not response.paging or not response.paging.next:
        break
    offset = response.paging.next.after

For each list, record: list ID, name, type (active/static), member count, created date, last updated date.

Export to CSV for review.

Stage 2: Execute — Identify Candidates for Deletion

Flag lists matching any of these criteria:

  1. Zero members and created more than 30 days ago
  2. Not referenced by any workflow, email, or ad audience
  3. Duplicate names or nearly identical filter criteria
  4. Test/temp lists (names containing "test", "temp", "copy of", "old")
  5. Static lists that have not been updated in 6+ months

Cross-reference with workflows and email campaigns before deleting — a list with zero members might still be used as an enrollment trigger.

Stage 3: After — Delete and Document

  1. Delete confirmed unused lists via the API or UI.
  2. Document what was deleted (list name, ID, reason) in a cleanup log.
  3. Inform team members if any lists they created were removed.

Stage 4: Rollback

  • HubSpot does not have a list recycle bin. Deleted lists cannot be restored.
  • Before deleting, export the list definition (filters/criteria) so it can be recreated if needed.
  • Static lists: export member IDs before deletion if the membership data matters.

Tips

  • Run this quarterly as part of the database cleanup routine.
  • Establish a naming convention going forward (e.g., prefix with team name or purpose).
  • Archive lists by prefixing with "[ARCHIVE]" instead of deleting if you are unsure.

GitHub Repository

TomGranot/hubspot-admin-skills
Path: skills/cleanup-lists
0

Related Skills

himalaya-email-manager

Communication

This Claude Skill enables email management through the Himalaya CLI tool using IMAP. It allows developers to search, summarize, and delete emails from an IMAP account with natural language queries. Use it for automated email workflows like getting daily summaries or performing batch operations directly from Claude.

View skill

imsg

Communication

imsg is a CLI tool for macOS that lets you programmatically interact with iMessage/SMS via the Messages.app. It enables developers to list chats, view message history, watch conversations in real-time, and send messages or attachments. Use this skill to automate messaging tasks or integrate iMessage/SMS functionality into your development workflows.

View skill

internationalization-i18n

Communication

This Claude Skill provides comprehensive guidance for implementing internationalization (i18n) and localization in applications. It covers key tasks like message extraction, translation management, locale-specific formatting, and RTL support using libraries like i18next and gettext. Use it when building multi-language applications or adding localization features for international users.

View skill

wacli

Communication

wacli is a command-line tool that enables WhatsApp messaging, search, and synchronization via the WhatsApp Web protocol. It's primarily used within Clawdis workflows for automated handling but can be called directly to send messages, sync chats, or query history. Key features include QR-based authentication, continuous background syncing, and the ability to send both text and files.

View skill