Explicit Identity

by parcadeid07ff4b06b62No license3.9K starsListed Oct 8, 2026Updated Oct 8, 2026Repository updated 8 months ago

Explicit Identity Across Boundaries

Instructions onlySoftware Development
AI-generated overview

A coding pattern guide for passing explicit identifiers across process and async boundaries instead of relying on "latest" lookups.

What it does
This skill documents a software design pattern: pass explicit identifiers such as session IDs through an entire pipeline rather than querying for the "most recent" value at execution time. It lists practices to follow and avoid, distinguishes different identifier types (session_id, root_span_id, turn_span_id), and shows a short TypeScript example contrasting a race-prone spawn call with an explicit-ID version. It also cites source sessions that established or confirmed the pattern.
When to use it
Use it when writing or reviewing code that spawns processes, awaits async work, or correlates traces and sessions, and where "latest" or "current" lookups could attribute work to the wrong context. It is guidance for developers rather than an executable tool.
Requirements
None beyond the agent; it is instructions only and ships no scripts.

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

typescript
// BAD: race condition at session boundariesspawn('analyzer', ['--learn'])  // defaults to "most recent"
// GOOD: explicit identityspawn('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

Source and attribution

Source:parcadei/continuous-claude-v3in.claude/skills/explicit-identityat commitd07ff4b

License: No license

Content belongs to its original authors. SourceWeft indexes it from a public repository.

Report or request removal