claude-get-session-info

Export CLAUDE_PID and SESSION_ID variables by sourcing a shell script.

3|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/ManuelKugelmann/BitBot --skill claude-get-session-info
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-get-session-info
Source: https://github.com/ManuelKugelmann/BitBot/tree/main/.bitbot/internal/container/templates/bitbot-dev/.claude/skills/claude-get-session-info
Command: npx skills add https://github.com/ManuelKugelmann/BitBot --skill claude-get-session-info

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Provides a standardized way for other scripts and skills to retrieve critical Claude session information (like Process ID and Session ID), enabling more sophisticated and context-aware automation.

Core Features & Use Cases

  • Session ID Retrieval: Easily get the unique identifier for the current Claude session.
  • Claude PID Access: Obtain the process ID of the Claude instance.
  • Use Case: Develop a custom monitoring script that logs activities specific to the current Claude session using its unique ID.

Quick Start

Source this script in your bash script to use CLAUDE_PID and SESSION_ID. source .claude/skills/claude-get-session-info/scripts/get-session-info.sh echo "Current Claude Session ID: $SESSION_ID"

Frequently Asked Questions about claude-get-session-info

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I access Claude session information in shell scripts?

Source the get-session-info script to populate CLAUDE_PID and SESSION_ID environment variables for use in your bash automation. This retrieves critical session context from the SessionStart hook without external dependencies.

What is a Session ID and why would I need it for scripting?

A Session ID is a unique identifier for your current Claude instance. It enables context-aware automation—scripts can log, monitor, or track activities tied specifically to that session rather than affecting other concurrent processes.

Can I use session information in custom monitoring scripts?

Yes. By sourcing this script, you gain access to both CLAUDE_PID and SESSION_ID, allowing you to build monitoring tools that log or track activities specific to the current Claude session without manual environment setup.

What do I need to do before using session variables in my scripts?

Source the get-session-info.sh script at the start of your bash script using `source .claude/skills/claude-get-session-info/scripts/get-session-info.sh`. The script exports CLAUDE_PID and SESSION_ID for downstream use in automation workflows.

Does this work with existing shell scripting and automation tools?

Yes. This skill integrates with standard bash scripting by exporting environment variables. Any script or automation tool that reads CLAUDE_PID and SESSION_ID can access session context without additional configuration.