llm-kb
← Back to social
Community

Developer suggests using word slugs instead of numeric IDs to reduce token usage

A developer discovered that using word-based slugs (e.g., 'my-project') instead of long numeric IDs for entities can significantly reduce token consumption when processed by LLM tokenizers. This is because tokenizers often encode numbers and symbols inefficiently, while common words are tokenized more compactly. The insight is particularly relevant for developers building agent-based systems that handle many identifiers.

4 engagement·1 source·Sun, Jul 12, 2026, 06:27 PM
In a Reddit post on July 12, 2026, a developer shared their observation that agents commonly use long numeric codes for IDs, which are tokenized inefficiently. They noted that tokenizers treat numbers and symbols as expensive tokens, especially when mixed with letters. By switching to word slugs (e.g., 'my-project' instead of 'proj_12345'), they reduced token usage for identifiers. The post suggests this convention may be inherited from traditional computing and encourages others to adopt word-based IDs for local, agent-handled data.

Entities

Word slugs(concept)Numeric IDs(concept)Tokenizers(tool)

Related

ProductSat, Jul 11, 2026, 06:38 PM

ContextOps: open-source tool to audit and optimize LLM prompt context

ContextOps is an open-source tool that analyzes LLM prompts to detect token waste such as duplicated retrieval chunks, bloated system prompts, oversized conversation history, and repeated tool outputs. It helps developers reduce costs and improve model consistency by auditing what goes into the prompt before inference.

2 engagement·1 source·reddit
CommunitySun, Jul 12, 2026, 07:59 AM

CTOs share playbooks for governing LLM cost and usage in production

Engineering leaders discuss strategies for managing LLM costs and usage as AI features scale from prototype to production. A key challenge is that user-facing workflows often trigger multiple LLM calls, making costs non-obvious during MVP stages.

1 engagement·1 source·reddit
CommunitySat, Jul 11, 2026, 06:01 AM

Developer reports Claude performance degrades beyond 500K tokens, uses handover files to reset context

A developer working on a large C# plugin reports that Claude becomes increasingly unreliable after 500K tokens of context, with performance degrading significantly by 800-900K tokens. To work around this, they manually create a handover.md file summarizing the project state and start a new session, asking Claude to re-read key files. The post questions whether this is common practice and whether tools exist to automate the process.

7 engagement·1 source·reddit
ProductSat, Jul 11, 2026, 05:46 AM

Local CLI tool to analyze Claude AI token usage and costs

A Go-based CLI that parses local Claude AI logs to show token usage and cost breakdown by project, session, and model. It helps users understand where their API quota is going and how much they would have spent without caching.

6 engagement·1 source·reddit
CommunitySun, Jul 12, 2026, 08:01 AM

Developers share pain points in building LLM infrastructure for memory and routing

A developer building an AI product posted on Reddit asking how others handle context management, memory persistence, and multi-model routing, noting that most of their time goes into plumbing rather than the actual product. The post resonated with the community, highlighting a shared frustration that many are rebuilding similar infrastructure from scratch.

2 engagement·1 source·reddit