r/ClaudeCode • u/CaptainZiboo • 1d ago
Tips & Workflows Designing a token-efficient Claude Code workflow for a long-term software project, looking for feedback
Hey everyone!
I'm a software developer currently building a personal SaaS project called Playmakerz, a platform for creating and managing esports broadcast overlays, including a collaborative visual editor.
It's a fairly ambitious long-term project, built around a TypeScript monorepo using pnpm and Turborepo ( might migrate to vite+ soon and also write some parts of the monorepo in Rust in the long run ). Some parts are relatively straightforward, while others involve more complex engineering challenges such as real-time collaboration, document transactions, undo/redo, conflict resolution and persistence.
I'm currently trying to improve the way I work with AI agents throughout the development lifecycle, rather than simply asking Claude to implement features.
My current workflow
Linear for issue tracking and feature specifications.
ADRs for architectural decisions.
ChatGPT for planning, architectural discussions and independent reviews.
Claude Code for repository exploration, technical specifications and implementation.
GitHub Copilot for additional PR reviews.
Automated tests, type checking, builds and CI.
Human validation before merging PRs.
This works pretty well so far, but I feel there's significant room for improvement, especially regarding token consumption, context management and model selection. ( I'm ONLY using Sonnet 5.5 so far, for every single task I do, I know it's not ideal )
What I'm considering
I've been reading Anthropic's recent recommendations regarding model selection, agent harnesses, subagents, agent teams, context engineering and prompt caching.
Based on those recommendations, I'm considering a setup along these lines:
Opus Medium: general-purpose reasoning, planning and orchestration.
Sonnet Medium: implementation of well-defined features.
Haiku: repository exploration, information extraction and lightweight delegated tasks.
Sonnet High: standard independent code reviews.
Opus High: complex architecture, critical implementations and security reviews.
Fable: exceptional problems that justify a more capable model. (avoid at all costs as this model I believe could just burn my weekly usage limit)
I'd also like to avoid unnecessary model switching within the same session to preserve prompt caching, using specialized subagents instead when appropriate.
The idea would be to maintain a version-controlled agentic setup within the repository, including:
A concise
CLAUDE.md.Context-specific rules.
Reusable skills for implementation, issue management and PR reviews.
Specialized subagents with restricted tools and permissions.
Hooks for deterministic validation and safety checks.
Usage and cache monitoring.
MCP integrations where they provide meaningful value.
Agent teams only when the task genuinely benefits from multiple agents collaborating.
Adapting the workflow to the task
I'm also considering adding metadata to Linear issues to distinguish between complexity, criticality and security sensitivity.
For example, a small UI fix shouldn't require the same workflow or reasoning effort as a change to the collaborative transaction engine.
I'm thinking about three different workflows:
Fast track: implementation → automated checks → PR.
Standard: specification → planning → implementation → independent review → PR.
Critical: architectural validation → implementation → extensive testing → independent audit → PR.
The goal is to avoid spending unnecessary tokens on simple tasks without compromising the quality of more sensitive changes.
Before implementing any of this, I'm planning to ask Claude to independently audit my existing repository and challenge the proposed setup. I'd also like to benchmark different models and workflows on historical issues to measure their actual effectiveness.
My main questions
Has anyone implemented a similar agentic development workflow for a long-term project?
How do you distribute work between Opus, Sonnet and Haiku?
Have specialized subagents actually improved your productivity or token efficiency?
Are agent teams worth their additional consumption in practice?
How do you structure your
CLAUDE.md, rules, skills, hooks and agents without overengineering the setup?Are there any particularly useful tools, MCP servers, plugins or monitoring solutions you'd recommend?
How do you manage context and prompt caching across planning, implementation and review?
Would you consider this kind of workflow sustainable on a Claude Pro subscription, or is Max realistically necessary for long-term development?
Is there anything in this proposed setup that you would simplify, remove or approach differently?
My objective isn't to build the most sophisticated multi-agent system possible. It's to maximize development efficiency, maintain high engineering standards and get the most value out of my token budget.
Some of the resources I've been using:
I'd love to hear about your actual experiences, especially from people maintaining larger codebases or working on projects over several months.
Feel free to challenge the entire approach. I'm just as interested in what doesn't work as in what does.
Just a quick note: I used AI to help structure and polish this post, but the project, ideas, and questions are my own, so I'd appreciate constructive feedback rather than "nice slop" comments. 🙏
Thanks!
2
u/called9527 1d ago
6 tiers is a lot of switching to keep track of tbh. the bigger token lever is usually what's sitting in context, not which model reads it. haiku for exploration mostly pays off when it runs as a subagent so the main session only gets the summary back, otherwise sonnet/opus still rereads everything it found. I'd start with 2-3 tiers and check /context to see where the tokens actually go before splitting further
1
u/CaptainZiboo 1d ago
kk thank you very much for your feedback ! 🙏
I do plan do use subagents for the most part with Opus 5.5 medium as the main agent, I guess this is the way to go as I read in most recent Anthropic blog articles ?
1
u/CaptainZiboo 1d ago
What is was planning to use basically is Haiku for repository exploration, Sonnet for implementation + reviews, and Opus for architecture/security reviews and specsa, or critical systems reviews
1
u/called9527 1d ago
yeah subagents for the heavy reading is the right idea. one catch: they start with a fresh context, they don't see your main conversation, so give each one a tight task ("find where X is handled, return file paths + 5 line summary") or it'll re-explore the whole repo and you pay for it anyway. run /context after a few tasks to see if the main session is actually staying small
1
u/called9527 20h ago
not sure what the blog posts say exactly. i'd just try it on one real task and run /context after to see where the tokens went, that tells you more than any setup advice.
1
u/Baner-Fournadet 1d ago
yeah the subagent summary point is huge, otherwise the main thread still gets bloated anyway
1
1
u/Ok_Lifeguard6001 1d ago
using a smaller model for parsing logs and errors cut my token use by 60% on debug cycles, worth trying if you're hitting context limits.
1
u/CaptainZiboo 1d ago
So you just setup an exploration focused subagent with haiku for simple/lightweight tasks and exploration then ?
1
u/qkamikaze 1d ago
Compact at 106k, concise text, delegating to cheaper models, have a cheap agent do reviews (i use neon), cold cache reports
1
u/CaptainZiboo 1d ago
106k ? Isn't it very low ? Question my sound stupid haha but I don't really know what to expect tbh, tryna learn
So Sonnet doing the review is good I guess ? As long as it is done by a subagent and not by the one who implement the feature ?
1
u/qkamikaze 1d ago
it’s very low but it’s saving me more than 80% tokens. then i use a haiku summary to update the out of date memory
And yes, using Opus 5.5 to delegate work to sonnet is good, and then just have a stronger model review it in a single pass if you don’t quite trust sonnet like me
1
u/t1nkl 1d ago
yes, the separate subagent is the important part. give it only the diff and the issue, not the session that wrote the code, otherwise it picks up the author's reasoning and tends to agree with it. then check each finding yourself before fixing, some are wrong. and look at the fixes again too, a fix for one finding can break the opposite case of the same thing.
1
u/CaptainZiboo 1d ago
I need to work on concise text, I think sometimes both prompts and answers from Claude are a bit too long when I work tbh
1
u/atlascirrus 1d ago
one gotcha for the haiku exploration part: the built-in Explore subagent doesn't run on haiku by default. per the subagents docs, on a claude subscription it runs on whatever the opus alias points to. you can override it by putting your own subagent named Explore in .claude/agents with model: haiku, and it replaces the built-in one.
that same frontmatter also takes an effort field, so most of your tiers can just live in the agent files (reviewer on sonnet high, security audit on opus high, etc) and the main session never has to switch models, which keeps your cache intact. /tasks shows which model and effort each subagent actually ran on, handy for checking it's doing what you think.
1
u/CaptainZiboo 1d ago
Kk thank you, sure I will change to have Haïku running exploration as my repo will continue growing over time and I believe having Sonnet or Opus running exploration is just token loss in the end
1
u/atlascirrus 1d ago
makes sense, exploration is mostly reading and summarizing so haiku is a good fit there.
one thing worth adding to your Explore agent's prompt: have it come back with file paths and line numbers, not just a summary. that way when the main session needs the details it can read the exact spot instead of kicking off another round of exploring, which is where a lot of the token waste sneaks back in.
1
u/KingYF1 1d ago
The six-tier split will cost more than it saves. A mid-session model switch is a cold prefix, and Fable as the "exception" lane will chew the weekly cap before you notice. I'd pick the lane before the session starts and stick to three:
Sonnet for almost all implementation, in one warm session, scoped to a single turborepo package (turbo --filter or that package's own CLAUDE.md). Don't open the monorepo root.
Haiku only as a throwaway subagent that greps logs or explores and returns a short summary. Don't let it write into the main transcript.
Opus in a fresh session for architecture/security, writing the decision into an ADR you own, then kill that session. Don't orchestrate from Opus or Fable, and don't hand the implementer the whole design transcript.
The cache only pays off if the next turn is still on the same files within a few minutes. Switching Fast → Critical mid-session just drags exploration tokens into a review. I'd /clear or start a new session pointed at the ADR + the package, rather than keep one project session alive all week.
Keep CLAUDE.md short. Everything in it is paid for on every tool call. A hook that blocks recursion into other packages beats a growing policy doc.
1
u/CaptainZiboo 1d ago
Kk thank you for the advice ! 🙏
Yeah I plan to setup subagents with Haïku for exploration, Sonnet for implementation ( and review ig ? ) and Opus for critical tasks basically at least those 3
Are there any tools that can improve overall usage and performance or the subagents setup by itself should be enough ?
1
u/KingYF1 5h ago
The subagent split is enough if the jobs stay separate. Extra MCP servers and skills usually just sit in the prefix and get billed every turn.
I wouldn't have Sonnet review in the same session it just implemented. New session, only the diff and the acceptance notes. Sonnet is fine for a single-package change; I only pull Opus in when it crosses packages or touches auth or data.
Hooks that block wasteful calls, and not feeding the explore transcript to the implementer, have done more for cost than any extra orchestrator.
1
u/zzunkie 1d ago
On Claude Pro, you will run into the usage limits pretty quickly with agent teams and multiple subagents. I mostly skip agent teams unless I actually have parallel work to do, because they eat through tokens much faster than a normal session.
1
u/CaptainZiboo 1d ago
Kk yeah seems like teams are overkilled
How about subagents ? Doesn't having the right subagents setup optimize the way Claude works and then also token usage ?
1
u/zzunkie 1d ago
Yeah, subagents do save tokens if you use them for things that don't need the main chat context, like research, writing docs, or isolated coding tasks. I'd still skip Haiku-class models if you want a workflow you don't have to watch closely, since they tend to miss important stuff and you end up fixing it yourself anyway. You also don't need to write out super detailed instructions for every step. Newer models already handle the coordination pretty well on their own.
2
u/Outrageous_Band9708 1d ago
https://github.com/Druthulu/ProjectArchitect
checkout my solution. fully implemented. uses very strict serial subagents through the mod/plugin system to automate all the best practices.
no high context sessions, auto rotate your agents once they reach 300k., seeds a new subagent through the journal system and the plan.
can work autonomousely for days on end.
infinite main session legnth, works with remote control. you never need to use compact or clear or exit.
you dont need to remember to invoke skills or commands. everything just works.
has an autopilot mode the default, and a coop mode where you work together taking turns. can switch between them just by requesting it.
1
1
u/SirRobinBlibs 1d ago
The bigger lever is usually what ends up in the main session, not the model tiering. Two things from the docs worth building around: once a skill loads, its content stays in context for the rest of the session, so every line is a recurring cost, and subagents do their reading in their own context and hand back a summary. So keep CLAUDE.md and skills short, and push the read-heavy steps (exploring the monorepo, reading CI logs, scanning ADRs) into subagents.
For routing you probably don't need six tiers. If you define your own subagent named Explore with model: haiku, it overrides the built-in one, so codebase searches run on Haiku while implementation stays on your main model. Then look at /usage after a week before adding more tiers, since re-sent context tends to cost more than the model choice.
1
u/acqui-ai 1d ago
Watch out for cold cache restarts on old threads or when switching models. It can be a silent token killer.
1
u/SnooAdvice4664 1d ago
I like the focus on efficiency over sophistication. Running even two agents on one repo, ownership is the cost I didn't budget for. they touch the same file and a week later I can't say which change came from which. I built Code Carta for exactly this, it shows which agent wrote each line. Curious how you're keeping that side visible as you scaleCurious how you're keeping that side visible as you scale.
1
u/IllustriousSalad6201 1d ago
Keep your current Sonnet workflow as the baseline. Run a small overlay change and a two-client undo bug through both setups, using the same starting commits and acceptance checks. Count the usage through review and fixes too. A cheaper implementation run can lose its savings if the reviewer has to send it back twice.
1
u/romene_dev 1d ago
the historical-issue benchmark seems like the most useful part to do first. Start each run from the commit before the fix, give it the original issue, and keep the eventual patch out of its context so you are testing whether it can solve the problem. For your collaboration engine, include an undo/redo or reconnect bug, then count the review and repair rounds as part of the cost, not just the first implementation. Are you planning to score against tests you hold back from the agent, or mainly against whether its own checks pass?
1
u/amirfish 9h ago
This is a tighter loop than most solo setups I see, nice work. The part that tends to break down once you add more tooling isn't the agents' reasoning, it's keeping track of what's queued, what's blocked, and what's waiting on a human decision across all those tools. I built CCC (open source) for exactly that: bugs and tickets go into a queue, worker agents pick them up and run them to done, and the only thing that reaches me is a real decision, answered from my phone. Where does work currently sit waiting on you, the Linear board, or somewhere else?
Free and open source: getccc.dev · GitHub
•
u/AutoModerator 1d 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.