claude-code-wrapped 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  """Claude Code Wrapped - Your year with Claude Code, Spotify Wrapped style."""
2
2
 
3
- __version__ = "0.1.3"
3
+ __version__ = "0.1.5"
@@ -209,6 +209,7 @@ def read_stats_cache(claude_dir: Path) -> dict | None:
209
209
  def load_all_messages(claude_dir: Path | None = None, year: int | None = None) -> list[Message]:
210
210
  """Load all messages from all sessions, optionally filtered by year.
211
211
 
212
+ Reads from both project session files (detailed) and history.jsonl (older data).
212
213
  Deduplicates messages by message_id to avoid counting duplicate entries
213
214
  that can occur from streaming or retries.
214
215
  """
@@ -217,21 +218,36 @@ def load_all_messages(claude_dir: Path | None = None, year: int | None = None) -
217
218
 
218
219
  all_messages = []
219
220
 
220
- # Read from project session files
221
+ # Read from project session files (detailed messages with token counts)
221
222
  for project_name, jsonl_path in iter_project_sessions(claude_dir):
222
223
  messages = read_session_file(jsonl_path)
223
224
  all_messages.extend(messages)
224
225
 
226
+ # Also read from history.jsonl for older data that may not be in session files
227
+ # This captures user prompts from sessions that have been cleaned up
228
+ history_messages = read_history_file(claude_dir)
229
+ all_messages.extend(history_messages)
230
+
225
231
  # Deduplicate by message_id (keep the last occurrence which has final token counts)
226
232
  seen_ids: dict[str, Message] = {}
227
233
  unique_messages = []
234
+
235
+ # Track seen timestamps+content for history dedup (history has no message_id)
236
+ seen_history: set[tuple[str, str]] = set()
237
+
228
238
  for msg in all_messages:
229
239
  if msg.message_id:
230
240
  # Keep latest version (overwrite previous)
231
241
  seen_ids[msg.message_id] = msg
232
242
  else:
233
- # Messages without ID (user messages) - keep all
234
- unique_messages.append(msg)
243
+ # Messages without ID - deduplicate by timestamp+content hash
244
+ if msg.timestamp:
245
+ key = (msg.timestamp.isoformat(), msg.content[:100] if msg.content else "")
246
+ if key not in seen_history:
247
+ seen_history.add(key)
248
+ unique_messages.append(msg)
249
+ else:
250
+ unique_messages.append(msg)
235
251
 
236
252
  # Add deduplicated messages
237
253
  unique_messages.extend(seen_ids.values())
@@ -172,14 +172,16 @@ def create_hour_chart(distribution: list[int]) -> Panel:
172
172
  color = COLORS["orange"]
173
173
  elif 12 <= i < 18:
174
174
  color = COLORS["blue"]
175
- elif 18 <= i < 22:
175
+ elif 18 <= i < 24:
176
176
  color = COLORS["purple"]
177
177
  else:
178
178
  color = COLORS["gray"]
179
179
  content.append(chars[idx], style=Style(color=color))
180
180
 
181
+ # Build aligned label (24 chars to match 24 bars)
182
+ # Labels at positions: 0, 6, 12, 18, with end marker
181
183
  content.append("\n")
182
- content.append("0 6 12 18 24", style=Style(color=COLORS["gray"]))
184
+ content.append("0 6 12 18 24", style=Style(color=COLORS["gray"]))
183
185
 
184
186
  return Panel(
185
187
  Align.center(content),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-wrapped",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Your year with Claude Code - Spotify Wrapped style terminal experience",
5
5
  "bin": {
6
6
  "claude-code-wrapped": "./bin/cli.js"
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "claude-code-wrapped"
3
- version = "0.1.3"
3
+ version = "0.1.5"
4
4
  description = "Your year with Claude Code - Spotify Wrapped style terminal experience"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
package/uv.lock CHANGED
@@ -4,7 +4,7 @@ requires-python = ">=3.12"
4
4
 
5
5
  [[package]]
6
6
  name = "claude-code-wrapped"
7
- version = "0.1.2"
7
+ version = "0.1.4"
8
8
  source = { editable = "." }
9
9
  dependencies = [
10
10
  { name = "rich" },