# Claude Session Id

> Find the latest Claude Code session ID(s). Use when the user asks for the current or most recent session ID, wants to find a session, or needs to look up recent sessions to resume or inspect.

- Skill: `thaitype/claude-session-id` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add thaitype/claude-session-id`
- Raw SKILL.md: https://api.skillmd.com/api/skills/thaitype/claude-session-id/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: thaitype (https://skillmd.com/u/thaitype)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/thaitype/claude-session-id

---


# Claude Session ID

Find the most recent Claude Code session(s) with their last message.

## Commands

```bash
# Show the latest session (default)
python3 .claude/skills/claude-session-id/scripts/latest_session.py

# Show the N latest sessions
python3 .claude/skills/claude-session-id/scripts/latest_session.py -n 5

# Filter sessions by project path
python3 .claude/skills/claude-session-id/scripts/latest_session.py -p /Users/thada/gits/myproject

# Combine project filter with count
python3 .claude/skills/claude-session-id/scripts/latest_session.py -p /Users/thada/gits/myproject -n 3

# Use custom projects directory
python3 .claude/skills/claude-session-id/scripts/latest_session.py --dir /path/to/projects
```

## Output

Single session (default):
```
  Session ID: 82c946c8-1eb8-4c70-9414-813fc0a278e4
  Date: 2026-03-16 10:32
  Last message (assistant): Here's the updated README with setup instructions...
```

Multiple sessions (`-n 3`):
```
  1. Session ID: 82c946c8-1eb8-4c70-9414-813fc0a278e4
     Date: 2026-03-16 10:32
     Last message (assistant): Here's the updated README with setup instructions...

  2. Session ID: a1b2c3d4-5678-9012-3456-789012345678
     Date: 2026-03-15 18:00
     Last message (user): Can you fix the login bug?

  3. Session ID: f0e1d2c3-b4a5-9687-0123-456789abcdef
     Date: 2026-03-14 09:15
     Last message (assistant): Done. The test suite passes now.
```

