You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(desktop): import existing work and resume Claude and Codex conversations #8358
I want to bring existing projects and conversations into Superset and continue from where they stopped, without losing their history or confusing two chats that share a folder.
Proposed solution
I built an explicit discovery, preview, selection and import flow in my local fork. Its scope is:
Superset and T3 Code: recorded Claude and Codex native conversations, with their session identity and working folder.
Claude Code profiles and Claude Desktop Code sessions: local native-session discovery and continuation.
Claude JSON/ZIP conversation exports: saved history imported as context into a separate coding conversation, rather than restoration of a native session.
Chats in the same folder remain separate. After a native conversation is continued in Superset, reopening uses its verified latest local history rather than reverting to the original import snapshot. Ambiguous identity or conflicting writers block continuation with an explanation.
This does not synchronize apps or transfer unfinished background work. Codex discovery currently comes through Superset or T3 records; there is no dedicated standalone Codex profile/app scanner.
The account-selection and exact-session recovery foundation is discussed in #7984. I can split this contribution into the shared import flow and source-specific PRs, with separate validation for each source/provider path and sanitized UI recordings. Each extracted branch still needs fresh upstream checks; local-fork testing is not a claim that those branches are ready.
Would this import flow fit Superset's direction, and is there a source or entry point you'd prefer to start with?
Workarounds you've tried
I've been using the local fork to bring existing conversations over and continue them. I'd like to contribute that workflow using Superset's existing workspace and session systems.
This is a feature proposal, not a bug report. The author built a flow in their local fork to find, preview, select and import existing work into Superset. It covers three sources: Claude/Codex sessions recorded by Superset or T3 Code, local Claude Code profiles and Claude Desktop Code sessions, and Claude JSON/ZIP exports. Native sessions would continue in place. Exports would come in as context for a new conversation, not as a restored session. Chats that share a folder stay separate, and continuation is blocked when the session identity is ambiguous or more than one writer is active. They offer to split the work into a shared import flow plus one PR per source, and they ask which source or entry point maintainers want first. Nothing here is broken; the question is whether the feature fits and where it should start.
What already exists in the codebase
The host service already resumes, forks and reads native sessions by id. Today this only covers sessions that Superset itself launched:
Resume by id at launch:packages/host-service/src/trpc/router/agents/agents.ts:62-88 appends the agent config's resumeArgs plus the session id (claude … --resume <id>, codex resume <id>). validateAgentResumeSelection (agents.ts:268-286) rejects agents with no resumeArgs. bindResumedSession (agents.ts:475-492) records the id against the new terminal straight away, because Codex sends no hook until the first turn.
Locating sessions on disk:packages/host-service/src/terminal-agents/harness-sessions/
claude.ts:30-35: claudeProjectDirName copies Claude's project-dir encoding (realpath, NFC, non-alphanumerics become -, then truncate and hash past 200 chars). claude.ts:155-181: lookup that respects CLAUDE_CONFIG_DIR, with a capped scan of projects/.
codex.ts:42-70: finds rollout-<ts>-<id>.jsonl under sessions/YYYY/MM/DD/. When a thread was reverted, the newest rollout wins. It respects CODEX_HOME.
index.ts:16-48: HARNESS_SESSION_STORES and hasHarnessSession, which answer true, false, or null ("can't tell") so a missing session can be refused before launch.
Reading a transcript as context:parseTurns in claude.ts:118-148 and codex.ts:91, readHarnessTranscript (harness-sessions/transcript.ts:68), and the terminalAgents.transcript procedure (trpc/router/terminal-agents/terminal-agents.ts:471-492). This is close to what the "import a Claude export as context" path needs.
Resume candidates and successors:terminalAgents.resume, resumedSuccessor and the resume-candidate query (terminal-agents.ts:440-506). These already handle "reopen uses the latest history, not the original snapshot" for sessions Superset launched.
What's missing: nothing lists sessions that Superset did not launch. Every current lookup starts from a known sessionId (and usually a worktreePath) taken from a terminal binding. There is also no T3 Code or Claude Desktop reader. My searches for t3code, T3 Code, .claude/projects and .codex/sessions only turned up the harness-session code above, tests, plans and marketing pages.
Things to settle before code review
tRPC compatibility: any new discovery or import procedures in packages/host-service fall under packages/trpc/AGENTS.md. Released desktop, mobile and CLI builds still call these procedures.
Cost of a full scan: the current lookups are deliberately capped (MAX_PROJECT_DIRS_SCANNED = 5000, MAX_DIRS_VISITED = 2000) and use the "null is not absence" rule. A listing scanner needs its own limits, and should run on a worker like read-off-loop.ts.
Account/env scoping: the stores read CLAUDE_CONFIG_DIR / CODEX_HOME from the launch env, so a session found under one account may not resume under another. This overlaps with Choose and switch accounts for an individual conversation #7984, which the author cites as the foundation.
Concurrent writers: the proposal blocks continuation when two writers conflict. That should reuse the existing binding and successor data, not a separate import record, so the two cannot drift apart.
i18n: any new UI strings need Lingui macros and translated catalogs (bun run check:i18n).
Suggested direction
If maintainers want this, a small first step could be a read-only discovery procedure in the host service. It would list Claude/Codex sessions for a worktree path using the existing HarnessSessionFiles layout, without a full scan, and hand the chosen id to the existing resumeSessionId launch path. That gives the "pick an existing session and continue it" path for local Claude Code and Codex with little new surface. The export-as-context path, then the T3 Code and Claude Desktop readers, could follow as separate PRs, as the author offers. Whether the feature fits and which source comes first is for maintainers to decide.
Testing a first PR
A bun:test sketch: create a temp CLAUDE_CONFIG_DIR holding projects/<claudeProjectDirName(tmpWorktree)>/<uuid>.jsonl and a temp CODEX_HOME holding sessions/2026/10/09/rollout-…-<uuid>.jsonl. Then check that discovery returns exactly those ids for tmpWorktree and that two sessions in the same folder come back as separate entries. Inject the roots through env, as claude.test.ts / codex.test.ts already do, instead of mocking os.homedir.
The picker keeps distinct conversations in the same folder separate. Adoption records a private checkpoint and immutable provenance. Later opens follow current local history and the terminal successor; an exact existing terminal is focused instead of replaying the initial import.
The isolated Electron recording covers fresh adoption, one exact native-ID launch and reopening the same terminal without a duplicate binding. A disconnected synthetic CLI was used: this is adoption/routing/focus proof, not authenticated transcript replay. Recording · Full qualification.
The final combined suite passed 29 tasks: 15,920 passing tests, zero failures, four skips and eight todo cases, plus lint and all 41 typecheck tasks. Migration regressions verify unique native ownership and all recovery fields through terminal/workspace deletion, reopen and migration reapplication. Hosted workflows still require maintainer approval.
This slice supports native Claude history only. T3 database discovery, Codex adoption, terminal-to-ACP conversion and background-job transfer remain separate work. The original conversation must be exited before a new launch; detected writers are checked, but Claude's process records are not a universal exclusive lock. The account/recovery dependency index is in #7984.
Activity
github-actions commentedon Oct 9, 2026
This is a feature proposal, not a bug report. The author built a flow in their local fork to find, preview, select and import existing work into Superset. It covers three sources: Claude/Codex sessions recorded by Superset or T3 Code, local Claude Code profiles and Claude Desktop Code sessions, and Claude JSON/ZIP exports. Native sessions would continue in place. Exports would come in as context for a new conversation, not as a restored session. Chats that share a folder stay separate, and continuation is blocked when the session identity is ambiguous or more than one writer is active. They offer to split the work into a shared import flow plus one PR per source, and they ask which source or entry point maintainers want first. Nothing here is broken; the question is whether the feature fits and where it should start.
What already exists in the codebase
The host service already resumes, forks and reads native sessions by id. Today this only covers sessions that Superset itself launched:
packages/host-service/src/trpc/router/agents/agents.ts:62-88appends the agent config'sresumeArgsplus the session id (claude … --resume <id>,codex resume <id>).validateAgentResumeSelection(agents.ts:268-286) rejects agents with noresumeArgs.bindResumedSession(agents.ts:475-492) records the id against the new terminal straight away, because Codex sends no hook until the first turn.packages/host-service/src/terminal-agents/harness-sessions/claude.ts:30-35:claudeProjectDirNamecopies Claude's project-dir encoding (realpath, NFC, non-alphanumerics become-, then truncate and hash past 200 chars).claude.ts:155-181: lookup that respectsCLAUDE_CONFIG_DIR, with a capped scan ofprojects/.codex.ts:42-70: findsrollout-<ts>-<id>.jsonlundersessions/YYYY/MM/DD/. When a thread was reverted, the newest rollout wins. It respectsCODEX_HOME.index.ts:16-48:HARNESS_SESSION_STORESandhasHarnessSession, which answer true, false, or null ("can't tell") so a missing session can be refused before launch.parseTurnsinclaude.ts:118-148andcodex.ts:91,readHarnessTranscript(harness-sessions/transcript.ts:68), and theterminalAgents.transcriptprocedure (trpc/router/terminal-agents/terminal-agents.ts:471-492). This is close to what the "import a Claude export as context" path needs.terminalAgents.resume,resumedSuccessorand the resume-candidate query (terminal-agents.ts:440-506). These already handle "reopen uses the latest history, not the original snapshot" for sessions Superset launched.What's missing: nothing lists sessions that Superset did not launch. Every current lookup starts from a known
sessionId(and usually aworktreePath) taken from a terminal binding. There is also no T3 Code or Claude Desktop reader. My searches fort3code,T3 Code,.claude/projectsand.codex/sessionsonly turned up the harness-session code above, tests, plans and marketing pages.Things to settle before code review
packages/host-servicefall underpackages/trpc/AGENTS.md. Released desktop, mobile and CLI builds still call these procedures.MAX_PROJECT_DIRS_SCANNED = 5000,MAX_DIRS_VISITED = 2000) and use the "null is not absence" rule. A listing scanner needs its own limits, and should run on a worker likeread-off-loop.ts.CLAUDE_CONFIG_DIR/CODEX_HOMEfrom the launch env, so a session found under one account may not resume under another. This overlaps with Choose and switch accounts for an individual conversation #7984, which the author cites as the foundation.bun run check:i18n).Suggested direction
If maintainers want this, a small first step could be a read-only discovery procedure in the host service. It would list Claude/Codex sessions for a worktree path using the existing
HarnessSessionFileslayout, without a full scan, and hand the chosen id to the existingresumeSessionIdlaunch path. That gives the "pick an existing session and continue it" path for local Claude Code and Codex with little new surface. The export-as-context path, then the T3 Code and Claude Desktop readers, could follow as separate PRs, as the author offers. Whether the feature fits and which source comes first is for maintainers to decide.Testing a first PR
A
bun:testsketch: create a tempCLAUDE_CONFIG_DIRholdingprojects/<claudeProjectDirName(tmpWorktree)>/<uuid>.jsonland a tempCODEX_HOMEholdingsessions/2026/10/09/rollout-…-<uuid>.jsonl. Then check that discovery returns exactly those ids fortmpWorktreeand that two sessions in the same folder come back as separate entries. Inject the roots throughenv, asclaude.test.ts/codex.test.tsalready do, instead of mockingos.homedir.ozeitis commentedon Oct 11, 2026
The first source-specific implementation is now in two non-draft PRs:
The picker keeps distinct conversations in the same folder separate. Adoption records a private checkpoint and immutable provenance. Later opens follow current local history and the terminal successor; an exact existing terminal is focused instead of replaying the initial import.
The isolated Electron recording covers fresh adoption, one exact native-ID launch and reopening the same terminal without a duplicate binding. A disconnected synthetic CLI was used: this is adoption/routing/focus proof, not authenticated transcript replay. Recording · Full qualification.
The final combined suite passed 29 tasks: 15,920 passing tests, zero failures, four skips and eight todo cases, plus lint and all 41 typecheck tasks. Migration regressions verify unique native ownership and all recovery fields through terminal/workspace deletion, reopen and migration reapplication. Hosted workflows still require maintainer approval.
This slice supports native Claude history only. T3 database discovery, Codex adoption, terminal-to-ACP conversion and background-job transfer remain separate work. The original conversation must be exited before a new launch; detected writers are checked, but Claude's process records are not a universal exclusive lock. The account/recovery dependency index is in #7984.