whoami

Installation
SKILL.md

Who Am I

Report how another session can reach this one: harness, session ID, working directory, transcript, resume command, PID, and git branch.

Rules

  1. Read the ID from the environment, never guess it. Each harness sets it in the shell tool's env:

    Harness Detect by Session ID Transcript Resume PID
    Claude Code CLAUDECODE=1 $CLAUDE_CODE_SESSION_ID ~/.claude/projects/*/<id>.jsonl claude -r <id> $CLAUDE_PID
    pi PI_CODING_AGENT=true $PI_SESSION_ID $PI_SESSION_FILE pi --session <id> none
    OpenCode OPENCODE=1 none — see rule 2 none (stored in SQLite) opencode -s <id> $OPENCODE_PID

    Resolve the Claude Code transcript with the glob rather than rebuilding the encoded directory name. Omit any field marked none, and omit the pi transcript when PI_SESSION_FILE is unset (ephemeral session).

  2. For OpenCode, take the newest session for the current directory. OpenCode sets no session-ID env var. Run opencode session list --format json -n 10 and pick the most recently updated entry whose directory equals $PWD. The live session updates on every turn, so it is usually the newest. If two sessions in this directory updated within the last few minutes, say the ID is ambiguous and list both.

  3. Print only the env vars you need. Never dump the whole environment; it holds API keys.

Installs
23
GitHub Stars
1
First Seen
6 days ago