fix(context-report): accept "< 20" token counts from /context
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a81c67f070
commit
f254a1ca40
1 file changed
+2
-1
@@ -43,7 +43,8 @@ def skill_names(root):
|
||||
|
||||
|
||||
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 ('', '-'):
|
||||
return 0
|
||||
return round(float(text[:-1]) * 1000) if text.endswith('k') else round(float(text))
|
||||
|
||||
Reference in new issue
Block a user