refactor(import): centralize imported-Kind checks and token merge

main

Commit

computermode2mo ago
  • Add Kind.IsImported() alongside IsReview/IsInvestigate and route all imported special-cases (staleness, orphan cleanup, resume filter, list/info labels, JSON field) through it, killing the scattered string-literal checks.
  • Add types.AddTokenUsage (canonical, nil-safe, recursive) and use it in the importer instead of a hand-rolled fold.
  • Drop the single-use pluralizeImportedSessions helper and a redundant local.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com Entire-Checkpoint: 01KX4F2HAMHPF9FYCTD17VN18R

Checkpoints

Fix Imported Sessions Handling in CLI

Claude CodeOpus 4.8
View session
Checkpoint 1