# Self-Hosted Routing for Monorepos

**URL:** <https://forum.cursor.com/t/self-hosted-routing-for-monorepos/166117>\
**Category:** Help\
**Tags:** large-codebases, cloud-agents\
**Created:** [July 19, 2026, 2:14pm UTC](https://forum.cursor.com/t/self-hosted-routing-for-monorepos/166117 "2026-07-19T14:14:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![mohitjain](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/mohitjain/32/100229_2.png) [@mohitjain](https://forum.cursor.com/u/mohitjain)\
**Post date:** [July 20, 2026, 8:56am UTC](https://forum.cursor.com/t/self-hosted-routing-for-monorepos/166117/6 "2026-07-20T08:56:05Z")

</div>

Hey @Troy_Gibb,  
There’s a quick reframe here that should unblock you: self-hosted routing isn’t environment-based at all. Environments only configure Cursor-managed cloud VMs. Self-hosted worker pools route purely on labels. Every request carries an auto-derived `repo=<owner/repo>` (from each worker’s git remote) plus an optional `pool=<name>`.

For a monorepo that’s actually the good news. Since all your fleets check out the same repo, they all carry the same `repo=` label, so the repo alone can’t tell them apart. The thing that distinguishes them is the pool name.

1. Give each fleet its own pool name with `--pool-name` (or `CURSOR_WORKER_POOL_NAME` in the helm chart / pod env):

```auto
agent worker --pool --pool-name k8s-general start
agent worker --pool --pool-name ios-minis start
agent worker --pool --pool-name k8s-general-dev start
agent worker --pool --pool-name ios-minis-dev start

```

2. Pick the fleet at trigger time with `pool=<name>`:

- Slack: `@Cursor pool=ios-minis <prompt>`
- Linear: put `pool=ios-minis` in the text of the triggering `@Cursor` comment. It’s read only from that comment, not from the issue description and not from issue/project labels. That’s an intentional boundary so a preset label can’t silently reroute someone else’s run onto your infrastructure.

3. One thing to watch on a monorepo: if you opt into self-hosted without a `pool=` (for example just `self_hosted=true`), the run only needs to match `repo=`, so any of your pools serving that repo can claim it. An iOS job could land on the k8s pool. On a shared-repo setup, always name the pool.

Full reference: [Pool names](https://cursor.com/docs/cloud-agent/self-hosted-pool#pool-names) and [Triggering pool agents](https://cursor.com/docs/cloud-agent/self-hosted-pool#triggering-pool-agents).

The piece that isn’t there yet is routing to the right pool without typing `pool=` every time (a repo or team-level default, or inferring the pool from a Linear label or assignment). That’s exactly the ask in the [thread you linked](https://forum.cursor.com/t/auto-route-worker-pool-from-repo-label-key-linear-cloud-agents/165415), so it’s worth keeping that conversation consolidated there where it carries the most weight with our team.

If you paste your `agent worker` command and a sample Slack/Linear trigger, I’m happy to sanity-check the exact setup.

---

_[View the full topic](https://forum.cursor.com/t/self-hosted-routing-for-monorepos/166117)._
