Repository navigation
feat(cli): add Claude Code and Codex session parsing and --discover to ingest-transcript - #2099
suryanshxharma wants to merge 8 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.
…ace redaction Signed-off-by: suryanshxharma <suryanshxharma@gmail.com>
zlareb1
left a comment
There was a problem hiding this comment.
The Unicode whitespace regression is fixed. Quoted passwords with escaped quotes can still reach the uploaded transcript.
| ) | ||
| _SECRET_ASSIGNMENT_RE = re.compile( | ||
| r"""(?a:\b)((?a:[\w.-]){0,64}?(?:password|passwd|secret|secret[_-]?key|token|api[_-]?key""" | ||
| r"""|access[_-]?key|private[_-]?key)(?a:\b)["']?\s*[=:]\s*)("[^"]*"|'[^']*'|[^\s"'\\,;}]+)""", |
There was a problem hiding this comment.
P1 — The quoted value matcher ends at an escaped quote. With a synthetic quoted password containing an escaped quote and a suffix, the suffix remains in the JSONL turn sent to conversation.append. Consume escaped characters inside quoted values and add an outgoing-request test that checks the whole value is removed.


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
Ingests local chat transcripts into conversation storage with client-side redaction; mistakes in parsing or redaction could leak secrets or drop/duplicate turns, but scope is CLI-only with no server auth changes.
Overview
Extends
loom ingest-transcriptso local Claude Code and Codex session.jsonlfiles can be ingested alongside existing JSON and markdown transcripts, and adds--discoverto list sessions under~/.claude/projectsand~/.codex/sessionsgrouped by project (sources, counts, date span, size) without contacting the server.A new
server/cli/_transcripts.pymodule implements read-only parsing: format auto-detection, Claude active-branch/logicalParentUuidhandling, filtering of meta/sidechain/tool-result noise, stripping of injected client XML wrappers on user turns, andredact_secretson JSONL content beforeconversation.append.--namespaceand--fileare optional when--discoveris used; CLI docs and help snapshots are updated, with unit tests covering parsers, discovery, branch logic, and redaction.Reviewed by Cursor Bugbot for commit f752065. Bugbot is set up for automated code reviews on this repo. Configure here.