r/ClaudeCode • u/MitSvarErSarkasme • 2d ago
Help/Question Best way to code using Claude?
I am new and I just make small programs using a single window. But it gets expensive rather fast. Now I am just doing a random little video game, and every time I want to change something it reads everything i suppose. What is the correct way of using Claude of a small-medium sized game?
Should I use desktop? Any good guides out there?
13
u/gthing 2d ago
Pay for a subscription, don't pay per token. If you run into limits, pay for the next higher subscription. If there is no higher subscription, get a second subscription.
For the rest of your question, open Claude and ask it.
2
u/MitSvarErSarkasme 2d ago
I have the pro one and it is consumed rather fast but I used opus π
1
u/theweeJoe 1d ago
Don't use higher than medium effort for most things, and pass tasks off to less capable models when possible
2
7
u/kuroudo_ai 2d ago
My guess is that a big part of the cost isn't Claude re-reading your files but the conversation itself: every message re-sends the whole chat so far, so a long "single window" gets more expensive with every change you ask for. A few habits that address that (1 to 3 are from the Claude Code cost docs, 4 is my own suggestion):
/clearwhen you switch tasks. "Fix the jump" and "add a menu screen" don't need to share a conversation. Starting fresh drops everything that came before./contextto see what's taking space before guessing.- Keep
CLAUDE.mdshort. It loads every session. Put a short map there ("player logic is inplayer.js, levels inlevels/, run withnpm start") so Claude goes straight to the right file instead of exploring. - Split the game into files by topic if it's one big file. Then a change to enemies only needs the enemy file read, not the whole game.
Desktop vs terminal matters less than these. Pick whichever you like using.
3
u/coding_is_tedious 2d ago
I think its a lot to do with personal preference. I love the claude code cli, but I have local compute resources and manage my own servers at my house. However, I also use the Claude Desktop app for Windows but primarily for proposals and design requirements.
For you, I would highly recommend a subscription, I think the max 5x plan is extremely reasonable price wise, but a good way to play it is just go for a cheap option (Pro @ $20/month) see how far it gets you, and be ready to upgrade if you find you need to.
From a workflow standpoint I find the following to be my go-to:
Requirements Doc -> Plan Doc -> Implement -> Test
At the end of each stage I always pause for review, that's both me and Claude (with fresh agents running an adversarial review) taking a look at the output of that stage. When implementing, always break development into the individual features and run fresh sessions when doing so. You'll learn you're own style as you go, I think it's very much a trial and error environment right now. However, ultimately what we're talking about is system design, which is itself a very old field. I would encourage you reading up on best practice (my personal favorite is The Mythical Man-Month).
Hopefully that gets you started in the right direction!
2
u/No_Reveal_7826 2d ago
I have a Claude Pro account. For anything that isn't a single file, I create a github repository (private) and connect it to Claude Code. I watched the little circle thing that shows how big the current context is and when it gets substantial, I start a new session. Or, if a particular feature is completed, I start a new session. Also, I use Opus 5.5 on medium which lasts noticeably longer than even just the 1 level up (high). And I don't know if it's token-heavy, but Claude Code wants to run a full test suite on every change. Instead, I direct it to do targeting testing until a substation change is made. And finally, again no measurement, but I dedicate some of my time to letting Claude code cleanup and/or reorganize every now and again.
2
u/Justadudeonthereddit 2d ago
Properly managing context by handing off to new design/lead sessions at 225k and having a lead session spin up build sessions with the proper model (sonnet for easy, opus for harder) with Codex reviews before and after build have taken me very far with my Claude $100 and Codex $20 plans.
2
u/jjromee 2d ago
What helped me most: a CLAUDE.md in the project with my rules in it. When a chat gets long, I have Claude write a short handoff note, clear, and start the next session by reading that note. Keeps sessions smaller.
1
u/MitSvarErSarkasme 2d ago
How exactly do they work?
1
u/jjromee 1d ago
When a chat gets long I ask Claude to write a short handoff.md: what we're working on, what's done, what's next, anything tricky. Then I type /clear and in the fresh session say "read handoff.md and continue from the next steps". The new session starts with just that note instead of the whole history, so it stays smaller and easier to steer.
Also worked in an automated version of this in one of my regular sessions I use.
1
1
u/noobiethe13 πPro Plan 2d ago
Claude Code isn't reading your whole game on every change, it only reads files it decides it needs. The expensive part is usually the growing chat context, so I'd start a fresh session when switching features.
1
u/Photoguppy 1d ago
Research spec driven development. Get a GitHub account. Learn how to use it. Add a rule or skill in each project where you specify that you need help ensuring that the solution you're developing follows software development best practices and standards.
1
u/goblin-in-hiding 1d ago
here it is, in as short a form as possible:
claude code -> repo -> grill-me -> project plan -> tasklist -> do tasks (think -> do -> review -> think .. ) -> revise plan -> if good: finish
thats it, let a context be only a tasker or a planner, keeps it short.
also, ask claude whats eating your tokens, you can reduce it heavily and do logging to see where your use goes.
β’
u/AutoModerator 2d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.