Repository navigation
feat(cli): add Claude Code and Codex session parsing and --discover to ingest-transcript - #2099
suryanshxharma wants to merge 7 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
left a comment
There was a problem hiding this comment.
JSONL upload needs client-side redaction. The three commits on this head also need the required DCO sign-offs.
zlareb1
left a comment
There was a problem hiding this comment.
The transcript command breaks the unit test for agent token refusal. The failure reproduces on the exact CI merge. Failed job
zlareb1
left a comment
There was a problem hiding this comment.
The prepared-bot integration failure reproduces on clean main. General health can report ready while the web process still reads recording mode, so the bot identity endpoint refuses provisioning. The same test passes when the fixture waits for that process’s enforced heartbeat. Failed job · Repair #2106
zlareb1
left a comment
There was a problem hiding this comment.
The streaming retirement test hits the same entry timeout on clean main when an event-loop turn pauses. The repair puts that test on the existing private clock. Failed job · Repair #2112
…o ingest-transcript Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
…SONL error Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
…k token before args Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
a620e69 to
db04f2d
Compare
zlareb1
left a comment
There was a problem hiding this comment.
The new head redacts JSONL uploads, streams discovery by file, and checks the agent token before reading the file arguments. The Unicode redaction finding still applies on this head. Reuse the Python SDK redactor’s word-boundary behavior and cover it in the outgoing-request test.
Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
| s = _JWT_RE.sub("[redacted]", s) | ||
| s = _BEARER_RE.sub(r"\1 [redacted]", s) | ||
| s = _BASIC_AUTH_RE.sub(r"\1 [redacted]", s) | ||
| return _URL_CREDENTIALS_RE.sub(r"\1[redacted]@", s) |
There was a problem hiding this comment.
URL redaction eats ordinary paths
Medium Severity
_URL_CREDENTIALS_RE is documented as matching the client redactor, but its userinfo class is [^\s/@\"'] and therefore allows /. A normal URL whose path contains : and a later @ is treated as credentials and rewritten to scheme://[redacted]@... before the turn is stored.
Reviewed by Cursor Bugbot for commit 7084797. Configure here.
Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Reviewed by Cursor Bugbot for commit 0e67ef9. Configure here.
Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
zlareb1
left a comment
There was a problem hiding this comment.
The ASCII word boundary fixes the previous Unicode-adjacency case. The same flag also disables Unicode whitespace matching and lets formatted credentials reach the outgoing import.
| re.IGNORECASE | re.ASCII, | ||
| ) | ||
| _JWT_RE = re.compile(r"\beyJ[\w-]{0,512}\.[\w-]{1,8192}\.[\w-]{0,1024}", re.ASCII) | ||
| _BEARER_RE = re.compile(r"\b(Bearer)\s+[^\s\"'\\]+", re.IGNORECASE | re.ASCII) |
There was a problem hiding this comment.
P1 — With re.ASCII on the whole expression, Bearer followed by a non-breaking space and a credential no longer matches. The assignment and Basic auth patterns have the same regression. Scope ASCII to the boundary with (?a:\b), keep Unicode whitespace matching, and exercise the outgoing request with a non-breaking space.


Part 1 of #2078 (formats and read-only discovery).
server/cli/_transcripts.pyto parse Claude Code (~/.claude/projects/*/*.jsonl) and Codex (~/.codex/sessions/**/*.jsonl) session transcripts without modifying the source files.--discovertoloom ingest-transcriptto list local sessions grouped by project (sources, session count, date range, total size) without writing anything.loom ingest-transcript --fileto accept.jsonlsession files in addition to.jsonand.md.--discover, and updated CLI snapshots anddocs/reference/cli.md.Follow-up PR 2 will add project-level batch import (
--newest N), client-side secret redaction, retention/recording checks,source_class="imported"with session timestamps, and the SessionStart primer offer.Note
Medium Risk
CLI-only changes that read local chat logs and redact secrets before upload, but mis-redaction or over-stripping injected tags could still leak or lose conversation content sent to Loom.
Overview
Extends
loom ingest-transcriptso local Claude Code and Codex session.jsonlfiles can be parsed and ingested, and adds read-only--discoverto list sessions grouped by project without contacting the server.A new
server/cli/_transcripts.pymodule scans default~/.claude/projectsand~/.codex/sessionspaths, auto-detects JSONL format, walks Claude’s active message branch (rewinds/sidechains/compaction), strips IDE-injected XML wrappers from user turns, and skips tool-result/meta noise.--discoverprints per-project source mix, session count, date span, and size;--fileon.jsonl** turns are redacted client-side (tokens, keys, JWTs, caller token) beforeconversation.append.--namespace/--fileare optional when using--discover.CLI reference, help snapshots, and unit tests cover parsing, discovery, branch logic, and redaction.
Reviewed by Cursor Bugbot for commit 95304b3. Bugbot is set up for automated code reviews on this repo. Configure here.