router-session — Claude Code command: what it does, how to install
router-session displays the current session ID to trace logs and telemetry inside Weave Router. Useful when locating transcripts or debugging requests in the dashboard.
Apache-2.0 ★ 5,622 updated 2026-10-29
.claude/commands/router-session.mdWhat router-session does
The command reads the CLAUDE_CODE_SESSION_ID environment variable via echo and outputs the resulting identifier in a single copyable inline code block.
Weave Router sends this ID inside the X-Claude-Code-Session-Id header across all requests and records it in model_router_users.SessionID for analytics joins. It also acts as the transcript filename key when searching logs and feedback in the router dashboard.
Execution requires permission for Bash(echo:*). Without an active environment variable, the command returns nothing to link against backend logs.
What it helps with
- fetch the session ID to correlate telemetry in Weave Router
- locate a specific session transcript inside the router dashboard
- join user feedback submissions with request logs in analytics
Example prompts for the agent
- /router-session
- Show the session ID for Weave Router telemetry
- Print my current router session key
How to install router-session
Manually: put the files in place
.claude/commands/router-session.mdCall it with /router-session. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/router-session.mdCall it with /prompts:router-session. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/router-session.prompt.mdManually: put the files in place
.gemini/commands/router-session.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about router-session
How to install router-session in Claude Code?
Place the command file at .claude/commands/router-session.md within your project repository.
What does router-session do?
It reads CLAUDE_CODE_SESSION_ID using Bash echo and outputs the raw identifier on a single line.
Where does Weave Router track this session identifier?
The router attaches it as the X-Claude-Code-Session-Id header on outgoing requests and stores it in model_router_users.SessionID.
Source text
router-session.md · Apache-2.0
--- description: Print the session id that correlates this session in router telemetry and logs. allowed-tools: Bash(echo:*) --- Print the session id used by the Weave Router to correlate this session's telemetry, logs, and feedback submissions. Also works as a transcript filename key for manual lookups in the router dashboard. The router carries this id as `X-Claude-Code-Session-Id` on every request and stores it in `model_router_users.SessionID` for analytics joins. Run `echo "$CLAUDE_CODE_SESSION_ID"`. Then tell me the session id in one line, formatted as inline code so I can copy it.
© weave-os · Apache-2.0 · weave-os/router