What if your AI coding sidekick starts hallucinating harder than a drunk developer right when your project’s getting serious?
That’s Claude Code on a growing codebase—until you fix it. I did. Meet Polyphemus: 4,000+ lines of autonomous Polymarket trading bot, Kelly Criterion sizing, real USDC on the line. Shipped in six weeks. Claude Code made it possible. But only after I blew $340 figuring out its limits.
Guides obsess over prompts. Wrong priority. The real fight? Context window bloat. Load your whole project? Token bills skyrocket. Sessions drag. Claude forgets. Dumb as a bag of hammers by week three.
Why Does Claude Code Get Dumber on Big Projects?
Context is king—or tyrant. Devs dump everything in, like cramming a garage sale into RAM. Disaster. Sessions hit 10,000 tokens easy. Twenty minutes re-explaining basics. Me? $340 gone in a month.
Fix number one: tiered context. Brutal simplicity.
Tier 1—always loaded, under 500 tokens: CLAUDE.md. Project map only. “Autonomous Polymarket bot. Kelly Criterion. No exceptions stop the loop.”
Tier 2—per session, under 1k: CURRENT_TASK.md. Today’s goal, files touched, done criteria.
Tier 3—demand only: “Read src/core/kelly.py first.”
Never name-drop files without loading. Hallucinations die.
Result? Tokens plunged 58%, from 10k to 4,200 per session. One change. Magic? Nah. Discipline.
Tier 1 — Always loaded (under 500 tokens): CLAUDE.md at project root. What the project is, file structure, conventions. Nothing else. The map, not the territory.
That’s straight from the builder’s playbook. Short. Punchy. Effective.
Claude’s got two brains, most miss this.
CLAUDE.md: your rules. Architecture calls. “PostgreSQL, not SQLite. Doppler for keys only. Log trades pre-execution.”
Auto Memory: Claude’s self-notes. Corrections stick across sessions. I wasted weeks on manual markdowns—Claude tracked better automatically.
But auto memory skips strategy. Patterns only. Write big choices in CLAUDE.md. Keep it tiny: 300 tokens for Polyphemus.
No async. No ML. Sync predictability. Float thresholds. No framework fluff.
Here’s my unique twist, absent from the original: this mirrors 90s IDE hell. Remember when Visual Studio choked on 10k-line projects without workspaces? Tiered context is the modern .sln file for AI. Predict this: it’ll standardize in every AI IDE by 2025, or solo devs stay hobbled.
Is Plan Mode Claude Code’s Killer Feature?
God, yes—if you use it right.
/p lan: Claude scouts your code. Thinks. Proposes. No touches till you greenlight.
Without? Claude spits 200 confident-wrong lines, ignoring buried decisions. Hours vaporized.
With? “Add circuit breaker after three losses.” Claude digs, flags MAX_LOSS_DAILY integration I forgot. I tweak pre-code. Hours saved. Zero cost.
Corporate hype calls this ‘agentic.’ Please. It’s basic review gatekeeping—with AI smarts.
Gates seal the deal.
Gate 1: Bash script. Mypy types. Ruff lint. Pytest. 30 seconds. Catches 60% garbage.
Fails? Feed error back: “Fix ONLY this. Nothing else.” Claude obeys—or else.
Gate 2: Six-question gut check. “Exact match to ask? No side quests? Tests pass? Edge cases? Clean logs? Prod-ready?”
Five minutes. Non-negotiable.
Polyphemus lives because of this. Real money. No room for AI slop.
But let’s skewer the PR spin. Anthropic pitches Claude as ‘production-ready.’ Half-truth. Raw, it’s a talented intern—brilliant bursts, epic forgets. These workflows turn it pro. Devs ignoring them? Deserve the bills.
Six weeks. 4k lines. Autonomous trades. Kelly math crushing it (mostly). Claude Code delivered—post-bloodletting.
Dry humor time: if AI were whiskey, early Claude sessions were rotgut. Now? Smooth single malt. Expensive lesson.
Wandered a bit there? Yeah. Humans do.
The bot’s no toy. Polymarket markets—crypto predictions. Kelly sizes bets optimally. Circuit breakers halt streaks. Logs every why before firing.
One violation early: amounts in cents, not USDC. Trade botched. Hard lesson in CLAUDE.md precision.
Scaling next? Multi-market. But that’s hubris—fix one beast first.
How to Avoid My $340 Claude Code Mistake?
Don’t treat it like a magic box. Engineer the hell out of context.
Start small CLAUDE.md. use auto memory. Plan everything multi-file. Gate ruthlessly.
Token bills drop. Sanity holds. Ships faster.
Skeptical? Build your own. Risk pocket change. Or stick to Copilot fairy tales.
Polyphemus proves it: AI coding’s here. But lazy devs? Still toast.
**
🧬 Related Insights
- Read more: Browser Fingerprints: The Invisible Shield Stopping 2026’s Bot Armies from Ruining Your Ads
- Read more: ccheckpoints: Git for Your Claude Code CLI Sessions — No More Lost AI Magic
Frequently Asked Questions**
What is Polyphemus trading bot?
Autonomous Polymarket bot using Kelly Criterion for position sizing, built with Claude Code in 6 weeks—handles real USDC trades with strict safeguards.
How to use Claude Code for large projects?
Tiered context (CLAUDE.md, task files, on-demand loads), Plan Mode for multi-file changes, auto memory for corrections, and double-gate reviews (script + checklist).
Does Claude Code work for production trading bots?
Yes, with discipline—cut token waste 58%, ship 4k lines fast, but watch for context bloat and always log trades pre-execution.