Developer shares token cost challenge with Claude-built ERP system

The problem: Single-file architecture doesn't scale with AI assistants
A developer running a small freight forwarding business built a complete ERP system using Claude. The system grew to over 3,000 lines of code in a single HTML file containing all modules: dashboard, shipment tracking, cash flow, driver logs, and customer records.
The core issue: Every time they need to make even a small change, they must load the entire 3,000+ line file into Claude's context window. This consumes approximately 60,000-80,000 tokens per message. For a solo operator, this creates both expense and inefficiency problems.
The root cause is architectural: a single-file monolith forces Claude to re-read and re-understand all 3,000 lines of mixed HTML, CSS, and JavaScript each time, even when only tweaking one small function.
Potential solutions under consideration
The developer is evaluating two approaches:
- Split the file into modules — Separate JavaScript files per feature so only necessary code loads per session
- Migrate to Firebase — This was already on their roadmap and would naturally enforce a modular architecture
They're asking the community for advice on managing large codebases with Claude or other LLMs, specifically how to structure projects to keep token costs reasonable.
📖 Read the full source: r/ClaudeAI
👀 See Also

How Cheap AI Agents Stress-Tested Claw Earn Marketplace Development
The Claw Earn team intentionally used cheaper, less capable AI agents during development, which exposed failures related to outdated scripts, stale memory, and incorrect assumptions. These failures forced improvements to documentation and platform robustness.

Using Claude as a Ruthless UI/UX Reviewer with Specific Persona Prompt
A Reddit user shares a prompt that transforms Claude into a brutal UI/UX consultant who reviews live apps in two passes: first as a ruthless designer, then as a first-time user, outputting findings in a prioritized markdown file.

Claude Projects vs Claude Code: Read/Write Gap Frustrates Second Brain Users
A user maintaining a markdown-based 'second brain' details friction between Claude Chat's voice-friendly Projects and Claude Code's file editing capabilities, proposing MCP as a workaround.

OpenClaw user shares architecture for 43-agent production system
A branding consultancy with 1,000+ clients has been running a 43-agent OpenClaw system in production for months, featuring a layered architecture with specialized agents across command, intelligence, content, tech, and sales functions.