whoami
Use when the user asks for the current session's ID (e.g., "/whoami", "what's your session id", "who are you") so another agent session can find or message this one. Works in Claude Code, pi, and OpenCode.
How do I install this agent skill?
npx skills add https://github.com/lwlee2608/agent-skills --skill whoamiIs this agent skill safe to install?
- Gen Agent Trust Hubpass
The skill provides a way to report session metadata (ID, directory, PID, and transcript path) by querying internal environment variables and running local CLI commands like git and opencode. It includes explicit security instructions to prevent the accidental leakage of sensitive environment variables like API keys.
- Socketpass
No alerts
- Snykpass
Risk: LOW · No issues
What does this agent skill do?
Who Am I
Report how another session can reach this one: harness, session ID, working directory, transcript, and tmux pane.
Rules
-
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 Claude Code CLAUDECODE=1$CLAUDE_CODE_SESSION_ID~/.claude/projects/*/<id>.jsonlpi PI_CODING_AGENT=true$PI_SESSION_ID$PI_SESSION_FILEOpenCode OPENCODE=1none — see rule 2 none (stored in SQLite) 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_FILEis unset (ephemeral session). -
For OpenCode, take the newest session for the current directory. OpenCode sets no session-ID env var. Run
opencode session list --format json -n 10and pick the most recentlyupdatedentry whosedirectoryequals$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. -
Print only the env vars you need. Never dump the whole environment; it holds API keys.
-
Include the tmux pane when
$TMUX_PANEis set. pi and OpenCode have no message channel between sessions, so a peer reaches them by typing into this session's tmux pane. Omit the field outside tmux. -
Reply in this format and nothing else:
harness: <Claude Code | pi | OpenCode> session: <id> cwd: <absolute path> tmux: <pane id> transcript: <absolute path> -
If no harness matches, say so. Don't fall back to a made-up ID.
How can the creator link this skill?
Add the canonical catalog link to the repository README so users can inspect current installs and available audits. The publishing guide covers the complete discovery path.
<a href="https://skillzs.dev/skills/lwlee2608/agent-skills/whoami">View whoami on skillZs</a>