claude-get-session-info
Shared utility script for getting Claude PID and Session ID. Source this in other scripts to access CLAUDE_PID and SESSION_ID variables.
When & Why to Use This Skill
This Claude skill serves as a foundational utility for session management and process tracking. By providing a standardized way to retrieve and export the Claude Process ID (PID) and Session ID, it enables developers to maintain execution context across multiple scripts, enhancing the observability and reliability of complex agentic workflows.
Use Cases
- Session Logging: Use the unique Session ID to tag and organize logs, making it easier to debug specific interactions within a multi-turn conversation.
- Process Management: Utilize the CLAUDE_PID to monitor the health of the agent's background processes or to prevent redundant script executions.
- Environment Synchronization: Source this utility in custom automation scripts to ensure they are perfectly aligned with the current agent's execution environment and metadata.
| name | claude-get-session-info |
|---|---|
| description | Shared utility script for getting Claude PID and Session ID. Source this in other scripts to access CLAUDE_PID and SESSION_ID variables. |
Get Session Info
Shared utility for session management - not directly invoked.
Usage (source in scripts):
source .claude/skills/claude-get-session-info/scripts/get-session-info.sh
echo "Claude PID: $CLAUDE_PID"
echo "Session ID: $SESSION_ID"
Exports CLAUDE_PID and SESSION_ID environment variables.