Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Related but different issues (different causes): #31677, #29153, #27163 and #27581.
Area
apps/server
Steps to reproduce
- Create a Claude Code transcript at
<claude-home>/projects/<slug>/fake-session-0001.jsonl:- Lines 1 and 2 are
queue-operationrecords with nocwdfield. - Line 3 is a
userrecord with a top-levelcwdpointing to an existing<project-folder>. Its message content is an array with a text block and an image block whose base64datais about 1.1 MiB (fake bytes are fine). - Line 4 is an
assistanttext reply.
- Lines 1 and 2 are
- Set the file mtime to within the last 30 days.
- Run T3 Code's import scan for that project (the "import recent threads" path, which calls
AgentSessionScanner.recentThreads). - Observe that the session is not listed.
- Control: the same file with the image at about 900 KiB is listed.
Fake-data generator (fake strings only):
import json, base64, os, time
def make(path, cwd, image_bytes):
os.makedirs(os.path.dirname(path), exist_ok=True)
fake_image = base64.b64encode(b"\0" * image_bytes).decode()
lines = [
{"type": "queue-operation", "operation": "enqueue", "sessionId": "fake-session-0001"},
{"type": "queue-operation", "operation": "dequeue", "sessionId": "fake-session-0001"},
{"type": "user", "cwd": cwd, "sessionId": "fake-session-0001",
"message": {"role": "user", "content": [
{"type": "text", "text": "fake prompt"},
{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": fake_image}}]}},
{"type": "assistant", "sessionId": "fake-session-0001",
"message": {"role": "assistant", "content": [{"type": "text", "text": "fake reply"}]}},
]
with open(path, "w") as f:
f.write("\n".join(json.dumps(l) for l in lines) + "\n")
os.utime(path, (time.time(), time.time()))
# make("<claude-home>/projects/<slug>/fake-session-0001.jsonl", "<project-folder>", 825 * 1024) # ~1.1 MiB base64Expected behavior
The session appears in the import list. A large first message should not hide the project folder.
Actual behavior
The session is dropped silently, with no warning. readCwd in apps/server/src/project/AgentSessionScanner.ts reads at most MAX_TRANSCRIPT_SCAN_BYTES = 1024 * 1024 (line 74 on origin/main commit c768764). When the line holding cwd is bigger than that, the transcript returns null and is skipped.
Evidence: a 7-case reproducer run on origin/main c768764 gives 5 passes and 2 failures. Raising MAX_TRANSCRIPT_SCAN_BYTES to 8 MiB makes all 7 pass (checked on commit 59651c1).
| Case | Session listed on origin/main c768764 | Session listed with 8 MiB scan limit |
|---|---|---|
| Short text prompt | pass | pass |
2 MiB record after the cwd line |
pass | pass |
| Image at about 256 KiB | pass | pass |
| Image at about 512 KiB | pass | pass |
| Image at about 900 KiB | pass | pass |
| Image at about 1.1 MiB | fail | pass |
| Image at about 2 MiB | fail | pass |
Impact
Minor bug or occasional failure
A session that never appears is a clear case, but the number of affected sessions is unknown.
Version or commit
T3 Code desktop 0.1.11 (build commit 59651c1). Also reproduced on origin/main c768764.
Environment
macOS (Darwin 27.2.0), T3 Code desktop beta 0.1.11, Claude Code CLI version unknown.
Logs or stack traces
None needed.
Workaround
Run claude --resume <session-id> from the project folder in a terminal, or start a new T3 thread and paste a summary.
Activity
killlilwinters commentedon Nov 25, 2026
This isn't fully fixed. The repro above put
cwdbeforemessagein the first user record, but real Claude Code (2.1.317) writesmessagefirst. With a large pasted image,cwdstill lands past the 1 MiB scan window, so the session is still dropped on v0.1.12, which includes #41446.Open PR #42640 handles that order: a 2 MiB
message-before-cwdtest fails on v0.1.12 and passes on its head.