/insights Languages chart: no Swift/Objective-C in extension map; .h misattributed to C on iOS codebases

Status Open
Reported on v2.1.235
Maintainer reply None cached
Activity 1 comment · opened Aug 19, 2026

Environment

  • Claude Code 2.1.235 (native binary install), macOS (darwin 25.5.0)
  • Project: large iOS codebase (Swift + Objective-C)

Bug
The /insights report's "Languages" chart reports zero Swift and zero Objective-C for a purely Swift/Objective-C iOS project, while showing "C" as the second-most-used language.

The per-session languages counter stored in ~/.claude/usage-data/session-meta/*.json is computed from a hardcoded extension→language map that contains no iOS languages. The map as found in the 2.1.235 binary:

{".ts":"TypeScript",".tsx":"TypeScript",".js":"JavaScript",".jsx":"JavaScript",
 ".py":"Python",".rb":"Ruby",".go":"Go",".rs":"Rust",".java":"Java",
 ".c":"C",".h":"C",
 ".cpp":"C++",".cc":"C++",".cxx":"C++",".hpp":"C++",".hh":"C++",".hxx":"C++",".ipp":"C++",
 ".md":"Markdown",".json":"JSON",".yaml":"YAML",".yml":"YAML",
 ".sh":"Shell",".css":"CSS",".html":"HTML"}

Consequences on an iOS codebase:

  • .swift, .m, .mm files are not counted at all.
  • .h files (overwhelmingly Objective-C headers here) are all attributed to C, which is where the misleading "C" bar comes from.

Evidence
Cross-checking one session transcript against its cached session-meta:

  • Transcript contains 31 Write calls and 228 Edit calls on .swift files.
  • Its session-meta/<id>.json records "languages": {"Markdown": 2, "C": 4} — no Swift at all.

Aggregated over 137 sessions / ~1 month of daily iOS work (133 commits), the report chart shows: Markdown 133, C 45, Shell 25, HTML 6, YAML 4, Python 3 — no Swift, no Objective-C.

Suggested fix

  1. Add the missing entries, at minimum: ".swift": "Swift", ".m": "Objective-C", ".mm": "Objective-C" (and ideally ".kt"/".kts": "Kotlin" for the Android folks).
  2. Make .h attribution context-aware instead of unconditionally "C": in an iOS project, a .h header almost always belongs to Objective-C. A cheap heuristic: attribute .h to Objective-C when the same session (or the same directory) also touches .m/.mm/.swift files, and keep the "C" fallback otherwise.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗