Advanced / Specialized
Slack automation
Slack's web app is just a big web app — chrome-use drives it like any other page:
connect to an already-logged-in session, read an accessibility snapshot to get elements with @ref,
then check unreads, jump to channels, search conversations, and extract messages. Everything runs through a real browser,
never touching the Slack API, and needing no OAuth, webhooks, or bot tokens.
skills get slack.
Quick start
chrome-use drives your already-logged-in real Chrome through the extension, so Slack's login is reused and you never open a debug port (Chrome 136+ pops "Allow remote debugging?" on every connect to one — see How It Works). Just have it open the Slack web app.
# Drive your logged-in real Chrome via the extension; open the Slack web app (login reused)
$ chrome-use open https://app.slack.com
# Grab an interactive snapshot to see what's on the page
$ chrome-use snapshot -i
snapshot -i to get elements with refs → click a tab, expand a group, or enter a channel →
read data or run an action → screenshot when you need evidence. Re-snapshot after every navigation,
because refs change as the page changes.
Check unread messages
Unreads are scattered across a few places: the "More unreads" button at the top of the sidebar, the unread roundup in the Activity tab, and channel names shown in bold / with a badge. Snapshot first to locate refs, then check them one by one.
# Continuing on the Slack tab opened above
$ chrome-use snapshot -i
# Open the Activity tab to see the unread roundup (ref may differ each time)
$ chrome-use click @e14
$ chrome-use wait 1000
$ chrome-use screenshot activity-unreads.png
# Or expand the sidebar's "More unreads"
$ chrome-use click @e21
$ chrome-use wait 500
$ chrome-use screenshot expanded-unreads.png
To count how many unread channels there are, expand the unread group and count the treeitems:
# After expanding unreads, each treeitem with a channel name counts as one unread
$ chrome-use snapshot -i | grep -c "treeitem"
Navigate to a channel
After snapshotting, find the channel name in the sidebar list (e.g. engineering, product-design)
and click its treeitem ref. Once inside the channel, use wait --load networkidle to let the content finish loading before acting.
$ chrome-use snapshot -i
# Click the channel's treeitem (example ref — go by your own snapshot)
$ chrome-use click @e94
$ chrome-use wait --load networkidle
# Scroll down in the message area to load more history
$ chrome-use scroll down 500
$ chrome-use screenshot channel-messages.png
chrome-use scroll down 300 --selector ".p-sidebar".
Search conversations
Using Slack's built-in search is the easiest path: click the search button, type the keyword, hit Enter, and wait for results to load.
$ chrome-use snapshot -i
$ chrome-use click @e5 # search button
$ chrome-use fill @e_search "keyword"
$ chrome-use press Enter
$ chrome-use wait --load networkidle
$ chrome-use screenshot search-results.png
Extract data
For programmatic parsing, use a JSON snapshot to get a machine-readable accessibility tree; for a single element's text, use get text.
For more systematic extraction patterns, see Extract data.
# Export the whole accessibility tree as JSON for easy parsing
$ chrome-use snapshot --json > slack-snapshot.json
# Get the plain text of a specific message / element
$ chrome-use get text @e_message_ref
# Current page URL and title, to keep as a reference
$ chrome-use get url
$ chrome-use get title
When parsing the JSON, watch for how these fields map:
| What you want | Where to find it in the snapshot |
|---|---|
| Channel name | the name field of a treeitem (sub-channels are level=2) |
| Message content | listitem / document elements |
| Username | button elements carrying user info |
| Timestamp | link elements carrying time info |
Common refs & sidebar structure
The Slack sidebar is roughly: Threads / Huddles / Drafts & sent / Directories, followed by group headers (Starred, Channels, etc.) with channel treeitems under them, then Direct Messages, Apps, and a "More unreads" button at the bottom. The refs below are common locations, for reference only — go by your own snapshot.
Home tab (usually).
Direct messages tab.
Activity tab, showing the unread count.
Search button.
Expands the unread channel list (changes each time).
@e14 and @e21 written in the docs are just typical values; they change with the session and page state.
Always snapshot -i before you click — don't hard-code refs.
Debugging
This stealth fork disables console/error capture by default — to use console / errors,
start the session with AGENT_BROWSER_CAPTURE_CONSOLE=1, otherwise they return empty.
# You must first start the session with AGENT_BROWSER_CAPTURE_CONSOLE=1
$ chrome-use console
$ chrome-use errors
# When stuck, check the current page state
$ chrome-use get url
$ chrome-use get title
$ chrome-use screenshot page-state.png
Caveats
- Pure browser automation: it doesn't go through the Slack API, so there's no OAuth, webhooks, or bot tokens involved.
- Session-bound: screenshots and snapshots are all tied to the current browser session.
- May get rate-limited: Slack throttles overly dense actions — add a
sleep 1orwaitbetween commands to let the UI catch up. - Only your own workspace: you can't automate across workspaces.