spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / telemetry / hooks / context / entrypoint-of / entrypoint-of.ts
13 lines · 454 BRaw
1/**
2 * The row's `entrypoint` field: the variable as the CLI or its host set it
3 * when spelled like one (a short lowercase token), else `other`.
4 *
5 * @param variable CLAUDE_CODE_ENTRYPOINT as read; undefined stays so
6 * @returns the field, or undefined
7 */
8export function entrypointOf(variable: string | undefined) {
9 const isSpelled =
10 variable === undefined || /^[a-z][a-z0-9_-]{0,39}$/.test(variable)
11
12 return isSpelled ? variable : 'other'
13}