explicit-identity

Explicit Identity Across Boundaries

⭐2.2kstars🔀157forks📁View on GitHub🕐Updated Jan 10, 2026⬇️1downloads

When & Why to Use This Skill

This Claude skill establishes a robust architectural pattern for maintaining explicit identity across process and asynchronous boundaries. By mandating the use of unique identifiers (UUIDs) instead of relying on volatile temporal states like 'latest' or 'current,' it effectively eliminates race conditions and ensures precise data attribution and state management in complex, multi-step agentic workflows.

Use Cases

  • Eliminating race conditions when spawning child processes by passing explicit --session-id flags rather than relying on the system's most recent execution state.
  • Ensuring accurate telemetry and observability by mapping specific UUIDs to trace spans (e.g., Braintrust), preventing the accidental mixing of data between different user sessions or execution turns.
  • Maintaining context integrity in asynchronous programming where the execution environment or 'current' context may change before an await or callback operation completes.
  • Standardizing state file storage by using full UUIDs for correlation, ensuring that long-running tasks can reliably reconnect to the correct historical data.
nameexplicit-identity
descriptionExplicit Identity Across Boundaries
user-invocablefalse

Explicit Identity Across Boundaries

Never rely on "latest" or "current" when crossing process or async boundaries.

Pattern

Pass explicit identifiers through the entire pipeline. "Most recent" is a race condition.

DO

  • Pass --session-id $ID when spawning processes
  • Store IDs in state files for later correlation
  • Use full UUIDs, not partial matches
  • Keep different ID types separate (don't collapse concepts)

DON'T

  • Query for "most recent session" at execution time
  • Assume the current context will still be current after await/spawn
  • Collapse different ID types:
    • session_id = Claude Code session (human-facing)
    • root_span_id = Braintrust trace (query key)
    • turn_span_id = Braintrust turn within session

Example

// BAD: race condition at session boundaries
spawn('analyzer', ['--learn'])  // defaults to "most recent"

// GOOD: explicit identity
spawn('analyzer', ['--learn', '--session-id', input.session_id])

Source Sessions

  • 1c21e6c8: Defined session_id vs root_span_id distinction
  • 6a9f2d7a: Fixed wrong-session attribution via explicit passing
  • a541f08a: Confirmed pattern prevents race at session boundaries