sessions

sessions is a command for Claude Code from ch0ks/hackarandas-claude-toolbelt. It costs 0 tokens per session (1,252 once invoked), scanned A, original, MIT.

A command that lists Claude Code sessions across projects and shows when they were last used, their project context, and how to resume them.

In plain words
What is it for?
Use it to review recent sessions, locate a session by project or date, and copy its resume command.
Why use it?
It makes older sessions easier to find when many projects or conversations are involved.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Good fit Use it to review recent sessions, locate a session by project or date, and copy its resume command.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ch0ks/hackarandas-claude-toolbelt/sessions
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/ch0ks/hackarandas-claude-toolbelt

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sessions

README.md
[![agentmods](https://agentmods.dev/badge/commands/ch0ks/hackarandas-claude-toolbelt/sessions/github.svg)](https://agentmods.dev/commands/ch0ks/hackarandas-claude-toolbelt/sessions)
Your own site
<a href="https://agentmods.dev/commands/ch0ks/hackarandas-claude-toolbelt/sessions"><img src="https://agentmods.dev/badge/commands/ch0ks/hackarandas-claude-toolbelt/sessions/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sessions

Your own site · 80×15
<a href="https://agentmods.dev/commands/ch0ks/hackarandas-claude-toolbelt/sessions"><img src="https://agentmods.dev/badge/commands/ch0ks/hackarandas-claude-toolbelt/sessions.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,252 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.01252
Opus 5 $0.00000 $0.00626
Sonnet 5 $0.00000 $0.00250
Haiku 4.5 $0.00000 $0.00125

Measured 9d ago against content hash 491e5e0dd47c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sessions scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

commands/sessions.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

List all Claude Code sessions across all projects, sorted by most recent. Show project context, date, and the exact resume command for each session.


Step 1 — Collect All Sessions

# Find all session jsonl files and extract metadata
for f in ~/.claude/projects/*/*.jsonl; do
  [ -f "$f" ] || continue

  # Extract session ID from filename
  session_id=$(basename "$f" .jsonl)

  # Skip subagent files — they are not resumable sessions
  [[ "$session_id" == agent-* ]] && continue

  # Extract project name from directory path — strip the hashed prefix
  project_raw=$(echo "$f" | sed 's|.*/projects/||' | sed 's|/.*||')

  # Clean up project name for display:
  # Remove leading -Users-<username>- prefix
  # Replace remaining hyphens with slashes to reconstruct the path
  project=$(echo "$project_raw" \
    | sed 's/^-Users-[^-]*-//' \
    | sed 's/^-home-[^-]*-//' \
    | sed 's/-\(github\|src\|code\|workspace\)/\/\1/g' \
    | sed 's/-/ /g')

  # Get last modified timestamp (macOS + Linux)
  modified=$(stat -f "%Sm" -t "%Y-%m-%d %H:%M" "$f" 2>/dev/null \
    || stat -c "%y" "$f" 2>/dev/null | cut -c1-16)

  # Get first user message from the jsonl as session context (first 80 chars)
  first_msg=$(grep '"role":"user"' "$f" 2>/dev/null | head -1 \
    | python3 -c "
import sys, json
try:
    line = sys.stdin.read()
    obj = json.loads(line)
    content = obj.get('message', {}).get('content', '')
    if isinstance(content, list):
        text = next((c.get('text','') for c in content if c.get('type')=='text'), '')
    else:
        text = str(content)
    print(text[:80].replace('\n', ' '))
except:
    print('')
" 2>/dev/null)

  echo "$modified|||$session_id|||$project_raw|||$project|||$first_msg"

done | sort -r

Step 2 — Format and Display

Parse the output from Step 1 and display as a numbered, readable table:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 Claude Code Sessions
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 #   Date              Project                                  First Message
─────────────────────────────────────────────────────────────────────────────
 1   2026-03-20 14:32  spdrs-code / FundingEventQueue           security review of create_risk...
 2   2026-03-18 09:15  semgrep-crawler                          run semgrep pro scan on...
 3   2026-03-15 16:44  Security-Design-Reviews-SPDR-SPS         review the threat model for...
 ...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

To resume a session:
  claude --resume <session-id>

Full session IDs:
  1  →  3bdbff51-3aab-4643-a01e-4e305b224650
  2  →  f805ff93-3b09-4221-be20-eb87bc07cb90
  3  →  fecbde4f-86aa-4f1d-857e-966843381d86
  ...

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 151 lines · 0 tokens per session scan A 491e5e0dd47c

Subscribe to this mod's changes

sessions is a command published in the GitHub repository ch0ks/hackarandas-claude-toolbelt (5 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,252 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.