MCPcopy
hub / github.com/codeaashu/claude-code / getCharBudget

Function getCharBudget

src/tools/SkillTool/prompt.ts:31–41  ·  view source on GitHub ↗
(contextWindowTokens?: number)

Source from the content-addressed store, hash-verified

29export const MAX_LISTING_DESC_CHARS = 250
30
31export function getCharBudget(contextWindowTokens?: number): number {
32 if (Number(process.env.SLASH_COMMAND_TOOL_CHAR_BUDGET)) {
33 return Number(process.env.SLASH_COMMAND_TOOL_CHAR_BUDGET)
34 }
35 if (contextWindowTokens) {
36 return Math.floor(
37 contextWindowTokens * CHARS_PER_TOKEN * SKILL_BUDGET_CONTEXT_PERCENT,
38 )
39 }
40 return DEFAULT_CHAR_BUDGET
41}
42
43function getCommandDescription(cmd: Command): string {
44 const desc = cmd.whenToUse

Callers 2

logSkillsLoadedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected