Skip to content

Fresh Claude JSONL can be ignored when created before tailer snapshot #308

Closed

Description

@Juliusolsson05

Problem

A fresh Claude pane can create its root JSONL transcript in the narrow window after the PTY process is spawned but before Agent Code / claude-code-headless has finished wiring the fresh-session directory watcher.

The old fresh-session tailer snapshots existing files and ignores them. If the new transcript lands before that snapshot, it is classified as pre-existing and ignored forever. Agent Code can then keep receiving proxy/semantic traffic while committed JSONL remains disconnected and providerSessionId never becomes durable.

Scope

This is the narrow attach race called out in #290. It does not claim to solve every disconnected-transcript case where Claude never writes the expected root JSONL at all.

Acceptance

  • Agent Code captures a timestamp before spawning a fresh Claude PTY.
  • claude-code-headless can treat JSONL files with mtime/ctime after that timestamp as fresh-session candidates.
  • Normal resume behavior is unchanged.

Related: #290, #283.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions