René's URL Explorer Experiment
Title: Add /_/* redirect route by claude[bot] · Pull Request #4523 · triggerdotdev/trigger.dev · GitHub
Open Graph Title: Add /_/* redirect route by claude[bot] · Pull Request #4523 · triggerdotdev/trigger.dev
X Title: Add /_/* redirect route by claude[bot] · Pull Request #4523 · triggerdotdev/trigger.dev
Description: Requested by Chris Arderne · Slack thread
Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — every dashboard URL contains the org, project and environment slugs, so you have to tell people to navigate there by hand.
After: /_/apikeys resolves the signed-in user's current organization, project and environment and redirects to /orgs/{org}/projects/{project}/env/{env}/apikeys. Deeper segments are preserved (/_/runs/run_abc123) and the query string is passed through. If you're not signed in, login happens first and you land on the deeplink afterwards. The preserved suffix drops . and .. segments in both their plain and escaped spellings, so a crafted URL can't escape the resolved environment path.
The /_/ prefix matches how Supabase spells the same idea.
How
New loader-only route apps/webapp/app/routes/[_].$.ts, modelled on the existing redirect-only routes (orgs.$organizationSlug.projects.$projectParam.apikeys.ts, orgs.$organizationSlug.projects.v3.$.ts):
requireUser (app/services/session.server.ts) — already redirects to /login?redirectTo=…, so the deeplink survives login.
SelectBestEnvironmentPresenter.call({ user }) resolves org + project + environment from dashboard preferences, falling back to the most recently updated project and the user's dev/prod environment.
The suffix is resolved by resolveDeeplinkPage against ENV_PAGE_TARGETS in app/utils/deeplinkPages.ts, which mirrors the environment layout's routes (_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.*).
An unrecognised first segment redirects to the environment root — a user-supplied path is never used as the redirect target. The query string survives either way, so /_, /_/nonsense and /_/tasks all behave alike.
A user with pending invites goes to invitesPath() first, mirroring _app._index/route.tsx — a deeplink is exactly the URL a new invitee is sent, and without this they were offered organization creation while their invite sat unaccepted.
If the user has no projects the presenter throws, and we branch to newProjectPath / newOrganizationPath exactly like _app._index/route.tsx does.
The suffix is read from new URL(request.url).pathname rather than the splat param, which React Router decodes. The dashboard writes a task id containing a slash as group/my-task, and the decoded param split that into two segments that matched no route. Segments are passed through as they arrived — re-encoding would turn / into %2F.
Why the filename is [_].$.ts
The brackets are Remix's character escape, and they're load-bearing. In the flat-route convention a segment beginning with _ is a pathless layout that contributes nothing to the URL, so a plain _.$.ts would mount this route at /* and swallow the entire site.
createRoutePath skips a segment only when the cooked and the raw spelling both start with _:
// skip pathless layout segments
if (segment.startsWith("_") && rawSegment.startsWith("_")) {
continue;
}
For [_].$ the escape parser yields segment = "_" but rawSegment = "[_]", so the skip doesn't fire and the segment survives as a literal. Running the repo's own routes directory through flatRoutes() on @remix-run/dev 2.17.5 confirms it:
{ file: "routes/[_].$.ts", id: "routes/[_].$", path: "_/*", parentId: "root" }
The same entry appears in the production server build's route manifest, no route-path collisions are reported across the other 482 routes, and nothing else in the app claims /_ or anything under it. No route file used […] escaping before this one, so the test asserts the resulting pattern (/_/*) directly rather than leaving it implicit.
One consequence: the prefix comparison in deeplinkSuffix no longer folds case. It used to, because React Router compiles route paths with the i flag and /Deeplink/apikeys really did reach the loader — but _ has no case, so the fold became dead code. Page-name folding stays, since /_/APIKeys still has a route to agree with.
Why the map has two paths per entry
Most names are a page in their own right. Three segments under the environment layout are not — they exist only as the parent of param or child routes, so a bare URL matches no route and would 404:
name
bare URL resolves
landing
prefix for deeper segments
tasks
no (only tasks.dashboard, tasks.{standard,scheduled}.$taskParam, tasks.stream)
the environment root
tasks
waitpoints
no (only waitpoints.tokens[.$waitpointParam])
waitpoints/tokens
waitpoints/tokens
metrics
no (only metrics.$dashboardKey, metrics.custom.$dashboardId)
— dropped
—
So each entry carries a landing used for a bare /_/ and a prefix that deeper segments hang off; for an ordinary page both are just the name. The two differ only where the page and the things underneath it live in different places: the task list is the environment root (that route is the env _index, titled "Tasks") while task detail pages are under /tasks. A single "prefix the target" rule would fix waitpoints and break tasks. metrics is left out entirely — it's only a legacy 301 shim to dashboards with no page of its own, so it falls back to the environment root rather than being given an invented target. A suffix that already spells out a path under the prefix is kept as written, so the shorthand /_/waitpoints/waitpoint_123 and the longhand /_/waitpoints/tokens/waitpoint_123 agree.
ENV_PAGE_META in app/components/navigation/favoritePages.tsx looked like the natural source for this list, but it only lists segments that need an icon and a label — tasks, agents and settings get theirs from special cases when resolving page metadata — and it says nothing about whether a segment resolves on its own. The route files answer both questions, so they are the source of truth.
No /deeplink/ alias. The route hasn't shipped, so nothing links to the old spelling and there's no compatibility to preserve. Keeping both would mean two route files and a two-valued prefix constant for no gain.
No project-picker fallback page. The presenter always resolves something for a user with at least one project, and the zero-project case already has a well-defined destination (create project / create org), so an intermediate "which project did you mean?" page would never be shown in practice.
✅ Checklist
I have followed every step in the contributing guide
The PR title follows the convention.
I ran and tested the code works
Testing
pnpm run format, pnpm run lint:fix, pnpm run typecheck --filter webapp and pnpm run build --filter webapp are clean — the build matters here because the route filename is what produces the URL. Not yet exercised against a running dashboard — worth clicking through /_/apikeys, /_/tasks, /_/waitpoints, /_/runs?statuses=COMPLETED_SUCCESSFULLY, /_/runs/run_…, /_/nonsense and /_ while signed out and signed in.
app/utils/deeplinkPages.test.ts reads the environment layout's route files and enforces the invariants that keep the map honest:
every landing page resolves to a real route — a leaf route or an _index child, since a param route like metrics.$dashboardKey isn't somewhere you can arrive without the param;
every deep link that can actually be made resolves, walking the real child routes under each prefix rather than probing one synthetic segment (names whose children are all literal, like settings/general and alerts/new, need that);
every segment that resolves on its own has a deeplink name, so a new page can't be quietly forgotten;
the mounted path really is /_/*, asserted with matchPath against the prefix constant the loader strips — the one invariant with no in-repo precedent to lean on.
Deliberate exclusions are named in the test: _index (the environment root, which tasks already points at) and queues_ (Remix's layout-opt-out spelling of queues, not a distinct URL). Failures name the offending entry.
Traversal is covered in both spellings, because the two escapes behave differently and it's worth knowing which layer stops each. / survives in pathname, so an escaped slash inside an id stays one segment. .. does not: WHATWG normalises it to .. and resolves it, so /_/runs/../../etc reaches the loader as /etc — outside the prefix, and treated as no suffix. Individually, a segment is dropped when it is ./.., when it decodes to one, or when it isn't decodable. Both parser behaviours are asserted rather than assumed. The redirect loader itself is still untested: there is no existing pattern for testing a redirect-only Remix loader in this repo.
Changelog
Short links like /_/apikeys now take you straight to that page in your current project and environment (.server-changes/deeplink-routes.md).
Generated by Claude Code
Open Graph Description: Requested by Chris Arderne · Slack thread
Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — every dash...
X Description: Requested by Chris Arderne · Slack thread
Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — ev...
Opengraph URL: https://github.com/triggerdotdev/trigger.dev/pull/4523
X: @github
direct link
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:5f3140ac-8b54-a11a-bc5e-f54fbd48f0e5 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | ECF6:18D292:185695:22AA6A:6AFAF69B |
| html-safe-nonce | 2d3710a75ad321d7b5cd62cdc4a64cc9b0f104117234b536aabad8de0467a872 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Y2OjE4RDI5MjoxODU2OTU6MjJBQTZBOjZBRkFGNjlCIiwidmlzaXRvcl9pZCI6IjIzMTQyMjc1MzQ0OTQ2Mjc0ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5fc381cb04c005a99d4954ad9b1ecb344793021c694e041a8090f42f73c1c3df |
| hovercard-subject-tag | pull_request:4222696556 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///pull_requests/show/files |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| twitter:image | https://avatars.githubusercontent.com/in/1236702?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1236702?s=400&v=4 |
| og:image:alt | Requested by Chris Arderne · Slack thread
Before: there's no stable URL you can put in docs, an email or a Slack message that lands someone on their own project's API keys page — every dash... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 54f7a6886649661c85eee945cca0773566bfb4065370e0429b7c8f7204184650 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/triggerdotdev/trigger.dev git https://github.com/triggerdotdev/trigger.dev.git |
| octolytics-dimension-user_id | 95297378 |
| octolytics-dimension-user_login | triggerdotdev |
| octolytics-dimension-repository_id | 572570113 |
| octolytics-dimension-repository_nwo | triggerdotdev/trigger.dev |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 572570113 |
| octolytics-dimension-repository_network_root_nwo | triggerdotdev/trigger.dev |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cf8450eb633ec589502c42ff6f4072e40db65da3 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Skip to content | https://github.com/triggerdotdev/trigger.dev/pull/4523/files#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4523%2Ffiles |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftriggerdotdev%2Ftrigger.dev%2Fpull%2F4523%2Ffiles |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=triggerdotdev%2Ftrigger.dev |
| Reload | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| Reload | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| Reload | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| triggerdotdev | https://github.com/triggerdotdev |
| trigger.dev | https://github.com/triggerdotdev/trigger.dev |
| Code | https://github.com/triggerdotdev/trigger.dev |
| Issues203 (203) | https://github.com/triggerdotdev/trigger.dev/issues |
| Pull requests67 (67) | https://github.com/triggerdotdev/trigger.dev/pulls |
| Discussions | https://github.com/triggerdotdev/trigger.dev/discussions |
| Actions | https://github.com/triggerdotdev/trigger.dev/actions |
| Projects | https://github.com/triggerdotdev/trigger.dev/projects |
| Security and quality39 (39) | https://github.com/triggerdotdev/trigger.dev/security |
| Insights | https://github.com/triggerdotdev/trigger.dev/pulse |
| Sign up for GitHub
| https://github.com/signup?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose |
| terms of service | https://docs.github.com/terms |
| privacy statement | https://docs.github.com/privacy |
| Sign in | https://github.com/login?return_to=%2Ftriggerdotdev%2Ftrigger.dev%2Fissues%2Fnew%2Fchoose |
| carderne | https://github.com/carderne |
| main | https://github.com/triggerdotdev/trigger.dev/tree/main |
| deeplink-route | https://github.com/triggerdotdev/trigger.dev/tree/deeplink-route |
|
Conversation
44
| https://github.com/triggerdotdev/trigger.dev/pull/4523 |
|
Commits
12
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits |
|
Checks
44
| https://github.com/triggerdotdev/trigger.dev/pull/4523/checks |
|
Files changed
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
|
Add /_/* redirect route
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files#top |
|
Show all changes
12 commits
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
|
d2efe29
Add /deeplink/* redirect route
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/d2efe29456c7bb230c5a93b7e75b3bae3adea073 |
|
e326919
Harden the deeplink suffix against traversal and delimiter injection
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/e326919772f8fb1fa615ad76e5c2fcb76f1c333f |
|
a1fa385
Derive deeplink allowlist from the environment route segments
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/a1fa3858a76442da96948e92cc5320bc9b4d0ea7 |
|
cf24f03
Add a test that the deeplink allowlist matches the environment routes
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/cf24f034b06a5535001d339349e64eec360e3d16 |
|
c72f501
Send deeplinks whose own segment has no page to a page that exists
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/c72f50109716d19b684289b060f7145cafc2b880 |
|
90577d2
Give deeplink targets a separate landing path and deep prefix
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/90577d28590566284a3ed2627c784d1f8d060eb4 |
|
1660450
Read the deeplink suffix from the pathname, and honour pending invites
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/16604509b4c4d5746692dd0150a28dff6d203538 |
|
71c6d3c
Match a deeplink's prefix and page name the way the router does
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/71c6d3c9e044f2e86cad456899ac62ec37b510d9 |
|
6b2e0f9
Compare a written-out deeplink prefix with its case folded too
claude Aug 6, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/6b2e0f97e52b1a085c29987f3f89f84a02d98dfe |
|
f93a892
Serve deeplinks from /_ instead of the deeplink literal
claude Aug 7, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/f93a89278e4e12cd5fcee13df8b4b5147acf271d |
|
3de75c1
Assert the deeplink route's path from Remix's own route manifest
claude Aug 7, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/3de75c10090729ecf469280e7ceb4348c8a8779c |
|
f505054
Cut the deeplink route's comments back to what the code can't say itself
claude Aug 7, 2026
| https://github.com/triggerdotdev/trigger.dev/pull/4523/commits/f5050541797194b22dc1333f1461778b9638820c |
|
Clear filters
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
|
deeplink-routes.md
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-bfb3cee0c02b4b0f1111eb7e84087007af5d6395140e3045cf2849fff9e91dd5 |
|
[_].$.ts
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-df472a0a20c6da56cc62056f19205132666bfb9c4e9e752c9f20aac23258515e |
|
deeplinkPages.test.ts
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-9b4e1a5f02d9dc2bf42b86616b30d2e2e4528c30043c2dd81287f899e3df05d7 |
|
deeplinkPages.ts
| https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-843bf93e256d89fd4c3c296f54498279d5e92038ebc583b4b0fa352b693ce061 |
| .server-changes/deeplink-routes.md | https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-bfb3cee0c02b4b0f1111eb7e84087007af5d6395140e3045cf2849fff9e91dd5 |
|
View file
| https://github.com/triggerdotdev/trigger.dev/blob/f5050541797194b22dc1333f1461778b9638820c/.server-changes/deeplink-routes.md |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4523/{{ revealButtonHref }} |
| apps/webapp/app/routes/[_].$.ts | https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-df472a0a20c6da56cc62056f19205132666bfb9c4e9e752c9f20aac23258515e |
|
View file
| https://github.com/triggerdotdev/trigger.dev/blob/f5050541797194b22dc1333f1461778b9638820c/apps/webapp/app/routes/%5B_%5D.%24.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4523/{{ revealButtonHref }} |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| apps/webapp/app/utils/deeplinkPages.test.ts | https://github.com/triggerdotdev/trigger.dev/pull/4523/files#diff-9b4e1a5f02d9dc2bf42b86616b30d2e2e4528c30043c2dd81287f899e3df05d7 |
|
View file
| https://github.com/triggerdotdev/trigger.dev/blob/f5050541797194b22dc1333f1461778b9638820c/apps/webapp/app/utils/deeplinkPages.test.ts |
|
Open in desktop
| https://desktop.github.com |
| https://github.co/hiddenchars |
| https://github.com/triggerdotdev/trigger.dev/pull/4523/{{ revealButtonHref }} |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
| Please reload this page | https://github.com/triggerdotdev/trigger.dev/pull/4523/files |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
Viewport: width=device-width
URLs of crawlers that visited me.