/insights Languages chart: no Swift/Objective-C in extension map; .h misattributed to C on iOS codebases
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,.mmfiles are not counted at all..hfiles (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
.swiftfiles. - Its
session-meta/<id>.jsonrecords"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
- Add the missing entries, at minimum:
".swift": "Swift",".m": "Objective-C",".mm": "Objective-C"(and ideally".kt"/".kts": "Kotlin"for the Android folks). - Make
.hattribution context-aware instead of unconditionally "C": in an iOS project, a.hheader almost always belongs to Objective-C. A cheap heuristic: attribute.hto Objective-C when the same session (or the same directory) also touches.m/.mm/.swiftfiles, and keep the "C" fallback otherwise.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗