fix(context-report): accept "< 20" token counts from /context

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Julian lechnerandClaude Opus 5.5 committed 2026-10-08 10:34:00 +02:00
1 parent a81c67f070
commit f254a1ca40
1 file changed
+2 -1
+2 -1
View File
@@ -43,7 +43,8 @@ def skill_names(root):
def tokens(text): def tokens(text):
text = text.strip().lstrip('~') # Claude prints "< 20" for small nonzero counts; count it as its upper bound.
text = text.strip().lstrip('~<').strip()
if text in ('', '-'): if text in ('', '-'):
return 0 return 0
return round(float(text[:-1]) * 1000) if text.endswith('k') else round(float(text)) return round(float(text[:-1]) * 1000) if text.endswith('k') else round(float(text))