Repository navigation
feat(import): add basou import claude-code for native transcripts - #16
Merged
Merged
Conversation
Derive Basou sessions from Claude Code native transcripts (~/.claude/projects/<encoded-cwd>/*.jsonl) after the fact, rather than wrapping a live process. Sessions produced in any Claude Code surface (desktop, IDE, CLI) write the same transcript to disk, so they can be captured for provenance without changing how the tool is launched. - New pure transform (transcript-importer.ts) maps message-level records to Basou events, then reuses the existing importSessionFromJson pipeline (id minting, path sanitization, schema validation unchanged). - Derives session_started/ended, command_executed (Bash -> bash -c) and file_changed (Edit/Write/NotebookEdit). Events are ordered by occurred_at because transcripts are not timestamp-sorted on disk. - Adds the additive `claude-code-import` session source.kind. - Flags: --all, --session <id>, --project <path>, --dry-run, --json. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Adds
basou import claude-code: derive Basou sessions from Claude Code'snative transcripts (
~/.claude/projects/<encoded-cwd>/*.jsonl) after thefact, rather than wrapping a live process with
basou run.Sessions produced in any Claude Code surface — desktop app, IDE, or CLI —
write the same native transcript to disk, so this lets them be captured for
provenance without changing how the tool is launched.
How
transcript-importer.ts) maps a transcript'smessage-level records to Basou's provenance events, then hands the result
to the existing
importSessionFromJsonpipeline — id minting, pathsanitization and schema validation are reused unchanged.
session_started/session_ended,command_executed(fromBashtool uses, recorded asbash -c "<line>"), andfile_changed(fromEdit/Write/NotebookEdit). Events are sorted byoccurred_atbecause transcripts are not timestamp-ordered on disk.
claude-code-importsessionsource.kind.--all,--session <id>,--project <path>,--dry-run,--json.Out of scope (future)
Approval / decision / task derivation, and other vendors' native logs.
Tests
ordering of unsorted records, skip-empty, malformed-record tolerance.
and error paths.
🤖 Generated with Claude Code