#!/bin/bash # Example CTASK_SESSIONS script # # Usage: # export CTASK_SESSIONS=/path/to/this/script # ctask select SESSIONS_DIR="${HOME}/.claude/tasks" # Start JSON array echo '[' first=true for session_dir in "$SESSIONS_DIR"/*; do if [ -d "$session_dir" ] && [ -n "$(ls -A "$session_dir"/*.json 2>/dev/null)" ]; then name=$(basename "$session_dir") # Add comma separator for all but first entry if [ "$first" = true ]; then first=false else echo ',' fi # Output session entry cat <