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.

⭐2stars🔀0forks📁View on GitHub🕐Updated Dec 2, 2025⬇️1downloads

When & Why to Use This Skill

The claude-get-session-info skill is a foundational utility designed to streamline agent session management and process tracking. By automatically exporting essential environment variables like CLAUDE_PID and SESSION_ID, it enables developers to build more cohesive, context-aware, and debuggable script sequences within the Claude environment.

Use Cases

  • Session Continuity: Use the unique SESSION_ID to link logs and data across multiple script executions within a single chat session for better traceability.
  • Process Monitoring: Utilize the CLAUDE_PID to monitor system resource usage or implement process-specific locks to prevent execution conflicts in complex workflows.
  • Modular Scripting: Source this utility in custom shell scripts to ensure all tools in a developer's toolkit are synchronized with the current agent state without manual ID passing.
nameclaude-get-session-info
descriptionShared 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.