Skip to content

Checkpoint condensation fails with multiple concurrent Claude Code sessions in the same repo #338

@BootstrapBits

Description

@BootstrapBits

What happened?

Description:

When running multiple Claude Code sessions concurrently in the same repository, entire explain --commit returns checkpoint not found even though the Entire-Checkpoint trailer is correctly added to the commit message.

Root cause from logs:

The prepare-commit-msg hook assigns the checkpoint to whichever session it picks up first, not necessarily the session that initiated the commit. When the committing session's stop hook fires, it can't condense because the checkpoint is owned by a different session. The owning session is
still active and never triggers condensation for that checkpoint.

Timeline from entire.log (debug level):

  1. Session A (6737af9d) and Session B (e957b8f7) are both active in the same repo
  2. Session B makes a commit → prepare-commit-msg adds trailer with checkpoint_id: cf48d3b5aba2 but assigns it to Session A (session_id: 6737af9d)
  3. post-commit transitions both sessions to active_committed
  4. Session B's stop hook fires → transitions to idle but does not condense (checkpoint belongs to Session A)
  5. Session A remains active → never triggers condensation for this checkpoint
  6. Result: entire explain --commit 16faa2c → checkpoint not found: cf48d3b5aba2

No "checkpoint saved" or "session condensed" log entry ever appears for this checkpoint ID.

Expected behavior:

The checkpoint should be assigned to the session that initiated the commit, and condensation should succeed regardless of how many concurrent sessions exist.

Environment:

  • entire CLI (latest as of 2026-02-14)
  • Strategy: manual-commit
  • Agent: claude-code
  • macOS Darwin 24.6.0

Logs:

# Session e957b8f7 (the session that made the commit) starts its turn
  {"time":"2026-02-14T21:53:24.977588-06:00","level":"INFO","msg":"user-prompt-submit","session_id":"89b205c3-927d-480e-9f9f-510f550dd136","component":"hooks","agent":"claude-code","hook":"user-prompt-submit","hook_type":"agent","model_session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400"}
  {"time":"2026-02-14T21:53:25.046271-06:00","level":"INFO","msg":"phase transition","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"session","event":"TurnStart","from":"idle","to":"active"}

  # Session e957b8f7 commits — but prepare-commit-msg assigns checkpoint to session 6737af9d (a DIFFERENT session)
  {"time":"2026-02-14T21:54:19.747721-06:00","level":"INFO","msg":"prepare-commit-msg: agent commit trailer added","session_id":"6737af9d-b4d9-40bf-bffe-1bd76ac6da70","component":"checkpoint","strategy":"manual-commit","source":"message","checkpoint_id":"cf48d3b5aba2"}

  # Both sessions transition to active_committed
  {"time":"2026-02-14T21:54:20.017467-06:00","level":"INFO","msg":"phase transition","session_id":"6737af9d-b4d9-40bf-bffe-1bd76ac6da70","component":"session","event":"GitCommit","from":"active","to":"active_committed"}
  {"time":"2026-02-14T21:54:20.046374-06:00","level":"INFO","msg":"phase transition","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"session","event":"GitCommit","from":"active","to":"active_committed"}

  # Session e957b8f7's stop hook fires — transitions to idle but NO condensation happens
  # (no "checkpoint saved" or "session condensed" log entry)
  {"time":"2026-02-14T21:54:30.338077-06:00","level":"INFO","msg":"stop","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"hooks","agent":"claude-code","hook":"stop","hook_type":"agent","model_session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400"}
  {"time":"2026-02-14T21:54:30.444141-06:00","level":"INFO","msg":"phase transition","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"session","event":"TurnEnd","from":"active_committed","to":"idle"}

  # Session 6737af9d (which "owns" checkpoint cf48d3b5aba2) remains active — never condenses
  # Next activity is a completely new prompt on a different session
  {"time":"2026-02-14T21:55:05.133735-06:00","level":"INFO","msg":"user-prompt-submit","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"hooks","agent":"claude-code","hook":"user-prompt-submit","hook_type":"agent","model_session_id":"89b205c3-927d-480e-9f9f-510f550dd136"}
  {"time":"2026-02-14T21:55:05.22709-06:00","level":"INFO","msg":"phase transition","session_id":"89b205c3-927d-480e-9f9f-510f550dd136","component":"session","event":"TurnStart","from":"","to":"active"}

entire status at the time showed 3 concurrent sessions:

Active Sessions:
/Users/myuser/projects/myorg/myproject (main)
[Claude Code] 89b205c started just now
[Claude Code] 6737af9 started 9m ago, active just now
[Claude Code] e957b8f started 13m ago, active 1m ago

Result: entire explain --commit 16faa2c → checkpoint not found: cf48d3b5aba2

Steps to reproduce

  1. entire enable --agent claude-code
  2. Open two Claude Code sessions in the same repo (claude in two terminals)
  3. In session B, make a code change, commit, and push
  4. Run entire explain --commit
  5. Result: checkpoint not found:

Entire CLI version

Entire CLI 0.4.2 (2a9998e) Go version: go1.25.6 OS/Arch: darwin/arm64

OS and architecture

Darwin 24.6.0 arm64

Agent

Claude Code

Strategy

manual-commit (default)

Terminal

Ghostty 1.2.3

Logs / debug output

# Session e957b8f7 (the session that made the commit) starts its turn
  {"time":"2026-02-14T21:53:24.977588-06:00","level":"INFO","msg":"user-prompt-submit","session_id":"89b205c3-927d-480e-9f9f-510f550dd136","component":"hooks","agent":"claude-code","hook":"user-prompt-submit","hook_type":"agent","model_session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400"}
  {"time":"2026-02-14T21:53:25.046271-06:00","level":"INFO","msg":"phase transition","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"session","event":"TurnStart","from":"idle","to":"active"}

  # Session e957b8f7 commits — but prepare-commit-msg assigns checkpoint to session 6737af9d (a DIFFERENT session)
  {"time":"2026-02-14T21:54:19.747721-06:00","level":"INFO","msg":"prepare-commit-msg: agent commit trailer added","session_id":"6737af9d-b4d9-40bf-bffe-1bd76ac6da70","component":"checkpoint","strategy":"manual-commit","source":"message","checkpoint_id":"cf48d3b5aba2"}

  # Both sessions transition to active_committed
  {"time":"2026-02-14T21:54:20.017467-06:00","level":"INFO","msg":"phase transition","session_id":"6737af9d-b4d9-40bf-bffe-1bd76ac6da70","component":"session","event":"GitCommit","from":"active","to":"active_committed"}
  {"time":"2026-02-14T21:54:20.046374-06:00","level":"INFO","msg":"phase transition","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"session","event":"GitCommit","from":"active","to":"active_committed"}

  # Session e957b8f7's stop hook fires — transitions to idle but NO condensation happens
  # (no "checkpoint saved" or "session condensed" log entry)
  {"time":"2026-02-14T21:54:30.338077-06:00","level":"INFO","msg":"stop","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"hooks","agent":"claude-code","hook":"stop","hook_type":"agent","model_session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400"}
  {"time":"2026-02-14T21:54:30.444141-06:00","level":"INFO","msg":"phase transition","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"session","event":"TurnEnd","from":"active_committed","to":"idle"}

  # Session 6737af9d (which "owns" checkpoint cf48d3b5aba2) remains active — never condenses
  # Next activity is a completely new prompt on a different session
  {"time":"2026-02-14T21:55:05.133735-06:00","level":"INFO","msg":"user-prompt-submit","session_id":"e957b8f7-19c9-46e1-b1cf-c623f5ed8400","component":"hooks","agent":"claude-code","hook":"user-prompt-submit","hook_type":"agent","model_session_id":"89b205c3-927d-480e-9f9f-510f550dd136"}
  {"time":"2026-02-14T21:55:05.22709-06:00","level":"INFO","msg":"phase transition","session_id":"89b205c3-927d-480e-9f9f-510f550dd136","component":"session","event":"TurnStart","from":"","to":"active"}

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions