Building a desktop app with Electron, React, and TypeScript demands precision—but managing context and costs in agentic coding tools can derail productivity. When the developer behind Achu, a screenshot beautification app, hit limits with proprietary AI coding assistants, they turned to Qwen Code. The open-source agentic CLI became the backbone of their workflow, enabling structured planning, parallel subagents, and strict context hygiene—all while reducing token waste.
A structured workflow for consistent AI-powered development
The core of the workflow revolves around three pillars: upfront context initialization, spec-driven planning, and disciplined context management. Each slash command serves a precise role, eliminating guesswork and wasted sessions. For Achu, a project that combines screenshot beautification, offline OCR redaction, and GitHub-integrated AI bug handling, these practices transformed how the developer approached coding with an LLM in the terminal.
Starting fresh with /init to anchor context
Every new session—or return after a break—begins with /init. This command scans the project directory, generating a context file that maps the folder structure, key files, and dependencies. The developer then manually enriches this file with a project summary, current milestones, tech stack details, and constraints like Electron IPC boundaries or monetization models.
Think of it as writing a living onboarding document for a new teammate. The upfront effort pays off by reducing repetitive explanations and ensuring Qwen Code starts each session with a shared understanding. Without this, even minor context loss can derail a multi-hour coding sprint.
Planning features with /plan before writing code
Before touching a single file, the developer uses /plan to enter structured planning mode. Unlike vague prompts, this command forces Qwen Code to analyze and iterate on a formal specification—detailing interfaces, data flows, error paths, and acceptance criteria. The process is iterative:
- Enter planning mode with
/plan.
- Describe the feature, its scope, and edge cases.
- Request a proposed approach from Qwen Code.
- Refine the spec through 2-3 back-and-forth rounds.
This multi-turn refinement ensures the final implementation aligns with architectural goals. The quality of the spec directly determines the quality of the output, making this the most critical habit in the workflow.
Parallelizing tasks with subagents to save time
Once the spec is locked, the developer leverages Qwen Code’s subagent system to parallelize independent tasks. Custom subagents are defined in .qwen/agents/ with tailored system prompts and tool allowances. For Achu, this includes:
- A testing subagent focused on Vitest and Electron patterns.
- A code reviewer subagent that operates in
planmode to audit files without modifications.
The real power comes from implicit forking—when Qwen needs to run multiple investigations simultaneously, it spawns parallel subagents. These inherit the parent context and share the prompt cache prefix, preventing token bloat. For example, investigating three separate flows—Privacy Guard’s IPC handler, the Ollama integration, and Upstash Redis voting—can run concurrently without tripling token usage.
The developer frames tasks explicitly:
Run these three investigations in parallel using subagents and report back.This keeps the main conversation focused while offloading parallel work to specialized agents.
Managing context and costs with /compress and /remember
Context hygiene is non-negotiable. The developer relies on /compress to trim irrelevant or redundant context, and /clear to reset when sessions drift. For long-term consistency, /remember persists architectural decisions across sessions, acting as a living design document.
Model selection also balances cost and performance. The developer primarily uses Qwen Max for complex TypeScript and Electron work, but switches to a faster model like qwen3-coder-flash for lighter tasks such as /recap or prompt refinements.
A scalable approach for agentic coding
The workflow isn’t just about tools—it’s about discipline. By treating Qwen Code as a teammate rather than a copilot, the developer ensures every session starts with clarity, every feature is thoroughly planned, and every task is executed efficiently. For those building complex Electron apps, this method reduces token waste, maintains context, and delivers consistent results across sessions.
As agentic coding tools evolve, the principles here—spec-driven planning, parallel subagents, and strict context management—will remain foundational. For developers tired of hitting walls with proprietary AI assistants, Qwen Code offers a robust, open-source alternative.
AI summary
Elektron, React ve TypeScript ile geliştirilen Achu uygulamasında Qwen Code’un slash komutlarıyla token maliyetlerini optimize edin ve geliştirme sürecini verimli hale getirin.