An auto-switch rule ties one or more domains to a folder. Open a matching site and the bar switches to that folder automatically; leave, and it falls back to whatever you’d picked manually.
Create a rule
Settings → Auto-switch → Add rule: list one or more domains, an optional path pattern (* for one segment, ** for several — so a rule can target just /docs/** rather than an entire domain), and pick a folder. A tester field lets you paste a URL and confirm the rule actually matches before you save it. Rules can also be created directly from the bar’s slot right-click menu.
Good to know
Auto-switch belongs to the Advanced bar. Classic shows one folder, so it has no rules (see Advanced vs Classic).
Rules can be as specific as you like: Docs and Slides, for example, can be two separate rules on the same domain, split only by path pattern.
When more than one rule matches a page, the most specific one wins: a rule with a path pattern beats a plain domain rule, and a longer domain beats a shorter one (api.example.com over example.com).
If you click a numbered button while a rule is steering the bar, your click wins in that tab on that site and the star goes dark. Click the star to hand control back to the rule.
Google Sheets is excluded from the bar by default, so a rule for a spreadsheet address will not show a bar there. See Hide the bar on some sites to change that.
Excluded sites win over rules — if a site is on your excluded list, the bar stays hidden there even if a rule also targets it. See Hide the bar on some sites.