Repository navigation
Conversation
M3 — scanner and converters (packages/teamcode/src/import/): - scanner: discovers ~/.claude/projects/<slug>/<sessionId>.jsonl (plus the sessions/ and subagents/ layouts) and ~/.codex/sessions/**/rollout-*.jsonl - parser/claude-code: typed view of the Claude Code JSONL (one line per content block, tool results as user lines, telemetry lines skipped) - parser/codex: typed view of Codex rollouts (enveloped and legacy layouts) - normalizer: pure mapping to Session.Info + MessageV2.WithParts; assistant blocks grouped by message.id, tool_result folded into ToolPart state, synthetic step-start/step-finish carrying usage, deterministic ids in the id.ts layout so re-import is a set difference on id - storage: idempotent, incremental upsert through the existing drizzle tables; refreshes only the newest existing message (late tool results); creates a project row when the transcript cwd matches no worktree - origin: claude / codex / teamcode derived from the version column (claude-code@<v>, codex@<v>); no schema change M4 — TS surface: - `teamcode import --from claude-code|codex [--session <prefix>] [--dry-run] [--json]` on the existing import command; `import <file>` behaviour unchanged - origin column in the TUI session dialog and in `teamcode session list` - `external_session` tool: list sessions by origin/search and read a transcript (prompts, text, reasoning, tool calls) from an active session Tests: test/import/* with JSONL fixtures (sanitized Claude Code sample, subagent transcript, invented Codex rollout) covering parser, normalizer, ids, scanner, storage idempotency/incremental re-import, orchestrator and the tool. Spike document in docs/rewrite/spec-m3-m4-import-spike.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014qrCGqHYZnWc7uAVroctQF
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Issue for this PR
Closes #
Type of change
What does this PR do?
M3 adds
packages/teamcode/src/import: a scanner for~/.claude/projectsand~/.codex/sessions, parsers for Claude Code JSONL and Codex rollouts, a pure normalizer toSession.Info+MessageV2with deterministic ids, and an idempotent incremental storage writer through the existing drizzle tables.M4 adds
teamcode import --from claude-code|codex, an origin column (claude / codex / teamcode) in the TUI session list and inteamcode session list, and theexternal_sessiontool for reading imported sessions from an active session.Origin is derived from the
versioncolumn (claude-code@<v>,codex@<v>), so there is no schema change or migration.Spike/design notes are in
docs/rewrite/spec-m3-m4-import-spike.md.How did you verify your code works?
bun run typecheckclean.bun test test/import: 35 pass (JSONL fixtures included). Fullbun testof packages/teamcode: 2740 tests, 3 environment-dependent failures that also fail on the base commit (two rely on chmod 0o444 denying writes, which root ignores; one timing-sensitive compaction test passes alone).Screenshots / recordings
CLI/TUI text-only change, no screenshot.
Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_014qrCGqHYZnWc7uAVroctQF