sessionlog:info
Installation
SKILL.md
Session Log Info
Identify the current Claude Code session and report its log file location.
Steps
- Determine the project session directory. Run:
project_dir="$HOME/.claude/projects/$(pwd | sed 's|/|-|g')"
echo "Project session directory: $project_dir"
- Find the current session (most recently modified JSONL file):
current_session=$(ls -t "$project_dir"/*.jsonl 2>/dev/null | head -1)
session_id=$(basename "$current_session" .jsonl)
echo "Session ID: $session_id"
echo "Session file: $current_session"
- Report session metadata. Read the first user message to get basic info:
jq -r 'select(.type == "user") | {sessionId, version, entrypoint, cwd, gitBranch, timestamp} | to_entries[] | "\(.key): \(.value)"' "$current_session" | head -6
- Count messages:
echo "Messages: $(jq -c 'select(.type == "user" or .type == "assistant")' "$current_session" | wc -l | tr -d ' ')"
- List all sessions for this project:
echo ""
echo "All sessions in this project:"
ls -lt "$project_dir"/*.jsonl 2>/dev/null | awk '{print $NF}' | while read f; do
sid=$(basename "$f" .jsonl)
msgs=$(jq -c 'select(.type == "user" or .type == "assistant")' "$f" | wc -l | tr -d ' ')
echo " $sid ($msgs messages)"
done
Output
Present results as a clean summary:
- Session ID — the UUID
- Session file — full path to the JSONL file
- Project session directory — the folder containing all sessions for this project
- Session count — how many sessions exist for this project
- Current session message count
Related skills