Add session gap context when using --continue flag

Status Open
Maintainer reply None cached
Activity 0 comments · opened Aug 12, 2026

Problem

When using claude --continue, Claude has no way to distinguish between a message sent 5 seconds ago and one sent 8 hours ago. The continued context makes it appear like one continuous conversation, so Claude:

  • Says "good night" when the user just woke up
  • References "the test that's running" when it finished hours ago
  • Treats the session as mid-task when the user is starting fresh

Proposed Fix

When --continue is used, inject a single line into the context:

Session resumed via --continue. Gap: 8h 12m. Last active: 2026-08-12 05:00 AM.

The system already knows:

  • Previous session ended at timestamp X (last message)
  • New session started at timestamp Y (--continue invocation)
  • Delta = Y - X

This is a one-line injection. No UX change, no new flags, no configuration. Just temporal awareness for the model.

Impact

Without this, every --continue session starts with Claude confused about timing, which gets passed on to the user as awkward or incorrect responses. With it, Claude can naturally adjust tone ("good morning" vs "good night") and context ("picking up from yesterday" vs "continuing from a moment ago").

View original on GitHub ↗