Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.
TypeScript ai-agentsanthropicclaude-codeclicode-graphcodexcontext-engineeringcursordeveloper-toolsgeminiknowledge-graphllmmcpmcp-serveropen-sourceopenaitree-sitter
fix(cloud): default to Trail cloud at team.trailhq.com
Shrish Dwivedibe16803711dc
diff --git a/src/cli.ts b/src/cli.tsindex 05743edc..1b6f7ef8 100644--- a/src/cli.ts+++ b/src/cli.ts@@ -1334,7 +1334,7 @@ grouped(program.command("init"), GROUP.setup).option("--verbose", "print every file written, the graph build's own output and the closing banner").option("--connect <code>",- "connect this machine to your Trail workspace with the one-time code from app.trailhq.com, and send it a summary of this repo (titles, counts and names; never code)",+ "connect this machine to your Trail workspace with the one-time code from team.trailhq.com, and send it a summary of this repo (titles, counts and names; never code)",).option("--pair <code>", "the pair code from Trail's onboarding page: that page shows this run live, then you review what it found").option("--server <url>", "the Trail that gave the code (default: Trail cloud)")@@ -1987,7 +1987,7 @@ async function runInitCommand(dir: string, opts: InitOptions, progress?: InitPro}/**- * `trail init --connect <CODE>`: the onboarding on app.trailhq.com. Claims the+ * `trail init --connect <CODE>`: the onboarding on team.trailhq.com. Claims the* one-time code (a wrong or spent one stops here, before anything is written),* saves the workspace token where `trail login` keeps it, then runs init as* usual while the page ticks off connected, mapped and learned. At the end,diff --git a/src/cloud/onboarding.ts b/src/cloud/onboarding.tsindex c902e553..43bc9018 100644--- a/src/cloud/onboarding.ts+++ b/src/cloud/onboarding.ts@@ -1,5 +1,5 @@/**- * `trail init --connect <CODE>`: the onboarding on app.trailhq.com.+ * `trail init --connect <CODE>`: the onboarding on team.trailhq.com.** A person signs up on the web, picks "Writing Code", and is shown two* commands: install trail, then `trail init --connect TRL-XXXX-XXXX`. The codediff --git a/src/cloud/workspace.ts b/src/cloud/workspace.tsindex adffb630..08bdd3fe 100644--- a/src/cloud/workspace.ts+++ b/src/cloud/workspace.ts@@ -18,7 +18,7 @@ import { trailHome } from "../notes/home.js";import { readJson, writeJsonAtomic } from "../util/state.js";/** Trail's own front end and API. TRAIL_URL (or the older GRAFT_BRAIN_URL) moves it, for a local or self-hosted Trail. */-export const DEFAULT_TRAIL_URL = "https://app.trailhq.com";+export const DEFAULT_TRAIL_URL = "https://team.trailhq.com";export function trailUrl(env: NodeJS.ProcessEnv = process.env): string {return (env.TRAIL_URL || env.GRAFT_BRAIN_URL || DEFAULT_TRAIL_URL).replace(/\/+$/, "");diff --git a/src/mcp/brains.ts b/src/mcp/brains.tsindex 514941d7..446d899a 100644--- a/src/mcp/brains.ts+++ b/src/mcp/brains.ts@@ -150,7 +150,7 @@ export class BrainProxy {});const text = await res.text();if (notify) return null;- if (res.status === 401 || res.status === 403) throw new Error('your Trail workspace token was not accepted; run `trail init --connect <code>` with a new code from app.trailhq.com');+ if (res.status === 401 || res.status === 403) throw new Error('your Trail workspace token was not accepted; run `trail init --connect <code>` with a new code from team.trailhq.com');if (!res.ok) throw new Error(`the Trail workspace answered ${res.status}`);const sid = res.headers.get('mcp-session-id');if (sid && this.session) this.session.id = sid;@@ -182,7 +182,7 @@ export class BrainProxy {signal: AbortSignal.timeout(this.opts.timeoutMs ?? 15_000),});const text = await res.text();- if (res.status === 401 || res.status === 403) throw new Error('your Trail workspace token was not accepted; run `trail init --connect <code>` with a new code from app.trailhq.com');+ if (res.status === 401 || res.status === 403) throw new Error('your Trail workspace token was not accepted; run `trail init --connect <code>` with a new code from team.trailhq.com');if (!res.ok) throw new Error(`the Trail workspace answered ${res.status}`);const msg = pickReply(res.headers.get('content-type') ?? '', text, id);const protocol = typeof msg?.result?.protocolVersion === 'string' ? msg.result.protocolVersion : '2025-06-18';@@ -217,7 +217,7 @@ export class BrainProxy {async callTool(name: string, args: Record<string, unknown>): Promise<CallResult> {const cloud = this.cloud();if (!cloud) {- return { content: [{ type: 'text', text: 'not connected to a Trail workspace · run `trail init --connect <code>` with the code from app.trailhq.com' }], isError: true };+ return { content: [{ type: 'text', text: 'not connected to a Trail workspace · run `trail init --connect <code>` with the code from team.trailhq.com' }], isError: true };}try {await this.ready(cloud);diff --git a/src/mcp/server.ts b/src/mcp/server.tsindex 0e5ec59b..cee8f459 100644--- a/src/mcp/server.ts+++ b/src/mcp/server.ts@@ -37,7 +37,7 @@ const BRAINS_LINE ="Connected to a Trail workspace: list_brains, get_context, search_rules and get_rules answer from the team's brains (brand, product, conventions, decisions); each result names its brain and rule. Use them for how the team does things, the tools above for the code.";/** What the brains-only server says when this machine isn't connected (any more). */-const NOT_CONNECTED_LINE = 'Not connected to a Trail workspace: run `trail init --connect <code>` with the code from app.trailhq.com to use its brains here.';+const NOT_CONNECTED_LINE = 'Not connected to a Trail workspace: run `trail init --connect <code>` with the code from team.trailhq.com to use its brains here.';function send(msg: object): void {process.stdout.write(`${JSON.stringify(msg)}\n`);diff --git a/test/fake-trail-server.ts b/test/fake-trail-server.tsindex 6ccb1552..1636c0e2 100644--- a/test/fake-trail-server.ts+++ b/test/fake-trail-server.ts@@ -1,5 +1,5 @@/**- * A stand-in for app.trailhq.com's CLI routes, over real HTTP, for the+ * A stand-in for team.trailhq.com's CLI routes, over real HTTP, for the* `init --connect` and MCP proxy tests (and for trying the flow by hand:* `node --import tsx test/fake-trail-server.ts 8787`, then* `TRAIL_URL=http://127.0.0.1:8787 trail init --connect TRL-GOOD-C0DE`).diff --git a/test/trail-connect.test.ts b/test/trail-connect.test.tsindex f33cedd2..5791c240 100644--- a/test/trail-connect.test.ts+++ b/test/trail-connect.test.ts@@ -271,14 +271,14 @@ test("the lookup skips short and generic names: cn has the most callers, the nex});test("the offline line names the Trail it tried once, and the command to connect later carries --server unless it's Trail cloud", () => {- assert.equal(connectAgain("trail init", "TRL-7F2A-K9QD", "https://app.trailhq.com"), "trail init --connect TRL-7F2A-K9QD");+ assert.equal(connectAgain("trail init", "TRL-7F2A-K9QD", "https://team.trailhq.com"), "trail init --connect TRL-7F2A-K9QD");assert.equal(connectAgain("trail init", "TRL-7F2A-K9QD", "https://dev.trailhq.com"), "trail init --connect TRL-7F2A-K9QD --server https://dev.trailhq.com");assert.equal(offlineLine("couldn't reach Trail", "http://localhost:5173", "TRL-7F2A-K9QD", "trail init"),"· couldn't reach Trail at http://localhost:5173 · set this repo up anyway · to connect it later: trail init --connect TRL-7F2A-K9QD --server http://localhost:5173",);assert.match(offlineLine("Trail didn't answer in time", "https://dev.trailhq.com", "TRL-7F2A-K9QD", "trail init"), /^· Trail at https:\/\/dev\.trailhq\.com didn't answer in time · /);- assert.match(offlineLine("Trail answered 502", "https://app.trailhq.com", "TRL-7F2A-K9QD", "trail init"), /^· Trail at https:\/\/app\.trailhq\.com answered 502 · set this repo up anyway · to connect it later: trail init --connect TRL-7F2A-K9QD$/);+ assert.match(offlineLine("Trail answered 502", "https://team.trailhq.com", "TRL-7F2A-K9QD", "trail init"), /^· Trail at https:\/\/team\.trailhq\.com answered 502 · set this repo up anyway · to connect it later: trail init --connect TRL-7F2A-K9QD$/);});/* learnings ---------------------------------------------------------------- */