Mine Claude Code sessions — timeline, gaps, repo attribution, session history. Use when user says "dig", "sessions", "past sessions", "timeline", "what did I work on", or wants to see session history. Do NOT trigger for finding code/projects (use /trace), exploring repos (use /learn), or current session status (use /recap).
SKILL.md
/dig - Session Goldminer v2
Mine Claude Code session data for timelines, gaps, and repo attribution. No query needed.
Usage
/dig # Current repo, 10 most recent
/dig [N] # Current repo, N most recent
/dig --all # All repos, ALL sessions (auto-detect count)
/dig --all [N] # All repos, N most recent
/dig --deep # Deep scan — ALL .jsonl files (not just most-recent per project)
/dig --deep [N] # Deep scan, N most recent
/dig --all --deep # All repos, deep scan — full coverage
/dig --timeline # Day-by-day grouped (current repo)
/dig --all --timeline # Day-by-day grouped (all repos, ALL sessions)
Deep Mode (#216)
Standard /dig deduplicates by session basename — only showing the most recent file per session. This misses historical sessions, subagent sessions, and worktree sessions.
--deep scans ALL .jsonl files across all project directories. Output includes extra fields:
toolCalls — number of tool invocations in the session
fileSizeKB — session file size in KB
Coverage metadata: "X of Y sessions" showing how many were returned vs found
Timezone (#214)
dig.py v2 auto-detects timezone instead of hardcoding GMT+7:
MAW_DISPLAY_TZ env var (e.g., Asia/Bangkok, 7, America/New_York)
TZ env var
System timezone
Fallback: UTC
Output metadata includes detected timezone name and offset.
Step 0: Timestamp
date "+🕐 %H:%M %Z (%A %d %B %Y)"
ENCODED_PWD=$(pwd | sed 's|^/|-|; s|[/.]|-|g')
PROJECT_BASE=$(ls -d "$HOME/.claude/projects/${ENCODED_PWD}" 2>/dev/null | head -1)
export PROJECT_DIRS="$PROJECT_BASE"
# Strip -wt* suffix to find parent project dir
PARENT_ENCODED=$(echo "$ENCODED_PWD" | sed 's/-wt-[^/]*$//')
if [ "$PARENT_ENCODED" != "$ENCODED_PWD" ]; then
PARENT_BASE=$(ls -d "$HOME/.claude/projects/${PARENT_ENCODED}" 2>/dev/null | head -1)
[ -n "$PARENT_BASE" ] && export PROJECT_DIRS="$PROJECT_DIRS:$PARENT_BASE"
fi
# nullglob-safe worktree scan (both parent and self)
for base in "$PROJECT_BASE" "$PARENT_BASE"; do
[ -z "$base" ] && continue
for wt in "$base"-wt-*(N); do # (N) = zsh nullglob qualifier
[ -d "$wt" ] && export PROJECT_DIRS="$PROJECT_DIRS:$wt"
done
done
Encodes pwd the same way Claude does (replace / and . with -, prepend -) to match the .claude/projects/ directory naming (e.g. github.com → github-com). Detects parent project from worktree dirs (strips -wt-* suffix) and includes both parent and self worktrees. The (N) qualifier prevents zsh crashes when no worktrees exist.
Read the JSON output and display as a table. Sessions are chronological (oldest first). Gap rows (type: "gap") span the session column with · · · prefix: