feat(web): group onboarding project import by repository #10493
Mergedt3dotgg(GitHub profile, opens in a new tab)merged 6 commits into
main fromrefs/pull/10493/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- docs/user/welcome-wizard.md line 57OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -46,6 +46,12 @@46464747 ## Import your projects484849-T3 Code finds directories that Claude Code or Codex has used. The default50-selection includes projects active within the last 30 days. Use the checkboxes51-to include older projects or change the selection.49+T3 Code finds directories that Claude Code or Codex has used. Git repositories50+are listed first, newest activity on top, with the GitHub repository name when51+the origin is on GitHub. Clones of the same repository share one group.52+Directories that are not git repositories sit under "Other folders".53+54+The default selection includes git repositories active within the last 30 days55+with at least three conversations. Use the checkboxes, or "Select all" and56+"Select none", to change the selection. Linked git worktrees, Codex scratch57+directories, Downloads, and temporary directories are not offered.docs/user/welcome-wizard.md lines 50 to 50OutdatedResolvedby t3dotgg(GitHub profile, opens in a new tab)@@ -46,6 +46,5 @@46464747 ## Import your projects484849-T3 Code finds directories that Claude Code or Codex has used. The default50-selection includes projects active within the last 30 days. Use the checkboxes51-to include older projects or change the selection.49+T3 Code finds directories that Claude Code or Codex has used. Git repositories50+are listed first, newest activity on top, with the GitHub repository name whenpackages/shared/src/git.ts line 162OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -143,3 +143,20 @@143143 return normalized;144144 }145145146+/**147+ * Read `remote.origin.url` from raw `.git/config` text. Avoids spawning git148+ * for callers that only need the origin, such as project discovery scans.149+ */150+export function parseOriginUrlFromGitConfig(configText: string): string | null {151+ let inOrigin = false;152+ for (const rawLine of configText.split(/\r?\n/)) {153+ const line = rawLine.trim();154+ if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) continue;155+ if (line.startsWith("[")) {156+ inOrigin = /^\[\s*remote\s+"origin"\s*\]$/i.test(line);157+ continue;158+ }159+ if (!inOrigin) continue;160+ const match = /^url\s*=\s*(.+)$/i.exec(line);161+ if (match?.[1]) {162+ const url = match[1].trim();docs/user/welcome-wizard.md lines 51 to 51OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -46,6 +46,6 @@46464747 ## Import your projects484849-T3 Code finds directories that Claude Code or Codex has used. The default50-selection includes projects active within the last 30 days. Use the checkboxes51-to include older projects or change the selection.49+T3 Code finds directories that Claude Code or Codex has used. Git repositories50+are listed first, newest activity on top, with the GitHub repository name when51+the origin is on GitHub. Clones of the same repository share one group.apps/server/src/project/AgentSessionScanner.ts line 702OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -664,3 +683,20 @@664683 return `path:${normalizeProjectPathForComparison(realPath)}`;665684 });666685686+ /**687+ * Git identity of a directory, or the reason it has none. Reads `.git`688+ * directly instead of spawning git so a scan over hundreds of candidates689+ * stays cheap. A `.git` file means a linked worktree, which onboarding690+ * skips: its history belongs to the main checkout.691+ */692+ const readGitIdentity = Effect.fn("AgentSessionScanner.readGitIdentity")(function* (693+ directory: string,694+ ): Effect.fn.Return<695+ | { readonly _tag: "Repository"; readonly git: AgentSessionProjectCandidate["git"] }696+ | { readonly _tag: "Worktree" }697+ | { readonly _tag: "NotGit" }698+ > {699+ const gitPath = path.join(directory, ".git");700+ const gitStats = yield* statOption(gitPath);701+ if (Option.isNone(gitStats)) return { _tag: "NotGit" } as const;702+ if (gitStats.value.type !== "Directory") return { _tag: "Worktree" } as const;
- apps/server/src/project/AgentSessionScanner.test.ts lines 873 to 874OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -855,3 +863,12 @@855863 }),856864 );857865866+ it.effect("excludes Codex scratch directories and Downloads", () =>867+ Effect.gen(function* () {868+ const path = yield* Path.Path;869+ const fileSystem = yield* FileSystem.FileSystem;870+ const claudeHomePath = yield* makeTempDir("t3code-claude-home-");871+ const codexHomePath = yield* makeTempDir("t3code-codex-home-");872+ const home = NodeOS.homedir();873+ const scratch = path.join(home, "Documents", "Codex", "2026-09-01", "t3code-scanner-test");874+ const downloads = path.join(home, "Downloads", "t3code-scanner-test");apps/server/src/project/AgentSessionScanner.ts line 702OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -664,3 +683,20 @@664683 return `path:${normalizeProjectPathForComparison(realPath)}`;665684 });666685686+ /**687+ * Git identity of a directory, or the reason it has none. Reads `.git`688+ * directly instead of spawning git so a scan over hundreds of candidates689+ * stays cheap. A `.git` file means a linked worktree, which onboarding690+ * skips: its history belongs to the main checkout.691+ */692+ const readGitIdentity = Effect.fn("AgentSessionScanner.readGitIdentity")(function* (693+ directory: string,694+ ): Effect.fn.Return<695+ | { readonly _tag: "Repository"; readonly git: AgentSessionProjectCandidate["git"] }696+ | { readonly _tag: "Worktree" }697+ | { readonly _tag: "NotGit" }698+ > {699+ const gitPath = path.join(directory, ".git");700+ const gitStats = yield* statOption(gitPath);701+ if (Option.isNone(gitStats)) return { _tag: "NotGit" } as const;702+ if (gitStats.value.type !== "Directory") return { _tag: "Worktree" } as const;packages/shared/src/git.ts line 156OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -143,3 +143,14 @@143143 return normalized;144144 }145145146+/**147+ * Read `remote.origin.url` from raw `.git/config` text. Avoids spawning git148+ * for callers that only need the origin, such as project discovery scans.149+ */150+export function parseOriginUrlFromGitConfig(configText: string): string | null {151+ let inOrigin = false;152+ for (const rawLine of configText.split(/\r?\n/)) {153+ const line = rawLine.trim();154+ if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) continue;155+ if (line.startsWith("[")) {156+ inOrigin = /^\[\s*remote\s+"origin"\s*\]$/i.test(line);packages/shared/src/git.ts lines 160 to 163OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -143,3 +143,21 @@143143 return normalized;144144 }145145146+/**147+ * Read `remote.origin.url` from raw `.git/config` text. Avoids spawning git148+ * for callers that only need the origin, such as project discovery scans.149+ */150+export function parseOriginUrlFromGitConfig(configText: string): string | null {151+ let inOrigin = false;152+ for (const rawLine of configText.split(/\r?\n/)) {153+ const line = rawLine.trim();154+ if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) continue;155+ if (line.startsWith("[")) {156+ inOrigin = /^\[\s*remote\s+"origin"\s*\]$/i.test(line);157+ continue;158+ }159+ if (!inOrigin) continue;160+ const match = /^url\s*=\s*(.+)$/i.exec(line);161+ if (match?.[1]) {162+ const url = match[1].trim();163+ return url.length > 0 ? url : null;
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- packages/shared/src/git.ts lines 182 to 184OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -145,0 +164,21 @@164+ if (!quoted && (char === "#" || char === ";")) break;165+ out += char;166+ }167+ return out.trim();168+}169+170+/**171+ * Read the primary remote URL from raw `.git/config` text without spawning172+ * git. Prefers `remote.origin.url` and falls back to the first remote so173+ * clones made with `git clone --origin <name>` still resolve.174+ */175+export function parseOriginUrlFromGitConfig(configText: string): string | null {176+ let section: string | null = null;177+ let originUrl: string | null = null;178+ let firstRemoteUrl: string | null = null;179+ for (const rawLine of configText.split(/\r?\n/)) {180+ const line = rawLine.trim();181+ if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) continue;182+ const header = /^\[\s*remote\s+"([^"]+)"\s*\]$/i.exec(line);183+ if (header) {184+ section = header[1] ?? null;packages/shared/src/git.ts lines 179 to 179OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -145,0 +159,21 @@159+ }160+ if (char === '"') {161+ quoted = !quoted;162+ continue;163+ }164+ if (!quoted && (char === "#" || char === ";")) break;165+ out += char;166+ }167+ return out.trim();168+}169+170+/**171+ * Read the primary remote URL from raw `.git/config` text without spawning172+ * git. Prefers `remote.origin.url` and falls back to the first remote so173+ * clones made with `git clone --origin <name>` still resolve.174+ */175+export function parseOriginUrlFromGitConfig(configText: string): string | null {176+ let section: string | null = null;177+ let originUrl: string | null = null;178+ let firstRemoteUrl: string | null = null;179+ for (const rawLine of configText.split(/\r?\n/)) {
- packages/shared/src/git.ts line 188OutdatedResolvedby coderabbitai[bot](GitHub profile, opens in a new tab)@@ -145,0 +168,21 @@168+}169+170+/**171+ * Read the primary remote URL from raw `.git/config` text without spawning172+ * git. Prefers `remote.origin.url` and falls back to the first remote so173+ * clones made with `git clone --origin <name>` still resolve.174+ */175+export function parseOriginUrlFromGitConfig(configText: string): string | null {176+ let section: string | null = null;177+ let originUrl: string | null = null;178+ let firstRemoteUrl: string | null = null;179+ // A trailing backslash continues the value on the next line.180+ const joined = configText.replace(/\\\r?\n[ \t]*/g, "");181+ for (const rawLine of joined.split(/\r?\n/)) {182+ const line = rawLine.trim();183+ if (line.length === 0 || line.startsWith("#") || line.startsWith(";")) continue;184+ // Both `[remote "origin"]` and the legacy `[remote.origin]` form, with an185+ // optional trailing comment.186+ const header = /^\[\s*remote(?:\s+"([^"]+)"|\.([^\]\s]+))\s*\](?:\s*[#;].*)?$/i.exec(line);187+ if (header) {188+ section = header[1] ?? header[2] ?? null;
- @@ -145,0 +161,21 @@161+ quoted = !quoted;162+ continue;163+ }164+ if (!quoted && (char === "#" || char === ";")) break;165+ out += char;166+ }167+ return out.trim();168+}169+170+/**171+ * Read the primary remote URL from raw `.git/config` text without spawning172+ * git. Prefers `remote.origin.url` and falls back to the first remote so173+ * clones made with `git clone --origin <name>` still resolve.174+ */175+export function parseOriginUrlFromGitConfig(configText: string): string | null {176+ let section: string | null = null;177+ let originUrl: string | null = null;178+ let firstRemoteUrl: string | null = null;179+ // A trailing backslash continues the value on the next line.180+ const joined = configText.replace(/\\\r?\n[ \t]*/g, "");181+ for (const rawLine of joined.split(/\r?\n/)) {
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.


Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Baseline:
b717537· PR result:03e2e22· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.