variable_namingTier 1 · 70% confidence

ai-agents-variable-naming-when-writing-code-intended-for-llm-processing-or-t-e0a4822a

agent: ai_agents

When does this happen?

IF When writing code intended for LLM processing or token-sensitive contexts, using long variable names increases token count.

How others solved it

THEN Replace descriptive variable names with single- or double-letter abbreviations that are domain-meaningful (e.g., 'd' for data, 'u' for user, 'tx' for transaction). Reserve full names for exported APIs, type definitions, and security-critical code.

// Before
const userData = await fetchUser(userId);
const userName = userData.name;

// After
const{name:n}=await fetchUser(id);

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics