TeamCreate records wrong leadSessionId in config.json

Resolved 💬 2 comments Opened Apr 9, 2026 by cbockenstette-commits Closed May 23, 2026

Bug

The leadSessionId field written to ~/.claude/teams/<team>/config.json does not match the calling session's actual UUID. This makes cross-session team lookup unreliable.

Steps to Reproduce

  1. Confirm current session UUID (e.g., via ~/.claude/sessions/<pid>.json"sessionId": "44a5bd90-...")
  2. Call TeamCreate(team_name: "my-team", description: "test")
  3. Read ~/.claude/teams/<assigned-name>/config.json
  4. Observe: "leadSessionId": "1ecd8655-..." — different from the actual session UUID

Expected Behavior

leadSessionId should match the session UUID of the caller.

Actual Behavior

leadSessionId is a different UUID (possibly a parent session, pre-compaction UUID, or stale cache value).

Impact

  • Cross-session team lookup (filter config.json by leadSessionId == $CLAUDE_SESSION_ID) returns wrong results
  • Any team registry design that relies on session attribution is broken

Environment

  • Claude Code CLI
  • Observed: 2026-04-08

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗