0 вхождений custom-theme в ядре против 9 в плагине: что посчитал греп

habrahabr.ru · world
Full story

A byte-by-byte search across the 402 MB Claude Code 2.1.332 distribution returned zero hits for the literal custom-theme, but only the count was right — the conclusion drawn from it was wrong. The earlier search covered the core alone, while the /custom-theme command is provided by a plugin called theme-examples, where the literal appears nine times across three of its 43 files. The author goes through what grep is actually counting when it is run against the binary. For comparison, /ship appears 275 times in the core and never in the name:"ship" form that the binary uses to record some entries.

В прошлой статье я написал, что литерала custom-theme в поставке Claude Code 2.1.332 нет: побайтовый поиск по 402 МБ дал ноль. Счётчик был прав, ошибся вывод. Искал я только в ядре, а команду /custom-theme даёт плагин theme-examples : в 3 его файлах из 43 литерал встречается 9 раз. Разбираю, что на самом деле считает греп по бинарнику. /ship встречается в ядре 275 раз и ни разу в виде name:"ship" , которым в бинарнике записаны многие команды, а grep -c печатает число строк с совпадением, и по подстроке ship выходит 437 вместо 950 вхождений. Ниже девять случаев, когда число, напечатанное shell-скриптом, не описывает проверяемый вход, от 2>/dev/null в конвейере до curl с ответом 404, и рецепт замера, который проверяет код возврата каждой команды до счёта. Читать далее

Read full article → Compare