← ClaudeAtlas

work-loglisted

Extract and format a work log from conversation history under ~/.claude/projects/. Argument is the number of days to look back (default 7).
tyabu12/claude-kit · ★ 0 · Code & Development · score 73
Install: claude install-skill tyabu12/claude-kit
Extract and format a work log from the conversation history under `~/.claude/projects/`. ## Parameters - Days: `$ARGUMENTS` (defaults to 7 when unspecified) ## Steps Run the script below to obtain the raw data. Replace the value of DAYS with the number of days from the parameter above. ```bash DAYS=7 if ! echo "$DAYS" | grep -qE '^[0-9]+$'; then echo "Error: DAYS must be a positive integer" >&2 exit 1 fi HOME_PREFIX=$(echo "$HOME" | sed 's|/|-|g') for dir in ~/.claude/projects/${HOME_PREFIX}-*; do [ -d "$dir" ] || continue project=$(basename "$dir" | sed "s|^${HOME_PREFIX}-||" | sed 's|^$|(root)|') find "$dir" -maxdepth 1 -name "*.jsonl" -mtime -${DAYS} -print0 | while IFS= read -r -d '' f; do python3 -c " import json, sys, re with open(sys.argv[1]) as fh: for line in fh: try: obj = json.loads(line) if obj.get('type') == 'user': msg = obj.get('message', {}) content = msg.get('content', '') if isinstance(content, list): texts = [c.get('text','') for c in content if c.get('type')=='text'] content = ' '.join(texts) content = re.sub(r'<system-reminder>.*?</system-reminder>', '', content, flags=re.DOTALL).strip() if content and len(content) > 5: ts = obj.get('timestamp', '')[:10] print(ts + '||' + sys.argv[2] + '||' + content[:200].replace(chr(10), ' '))