Get SessionID within Claude Code
Resolved 💬 9 comments Opened Jun 12, 2025 by skorfmann Closed Dec 8, 2025
I'm just wondering what's the best way would be to access the currently active sessionid from within Claude Code itself. By just prompting there doesn't seem to be a way, so I was thinking of having a MCP server - but not sure how to identify the currently active session. Ideas?
use-case: I want to correlate the open telemetry metrics which capture the sessionid, with some other tools for cost tracking and simply out of curiosity.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗