{"slug": "how-i-use-qwen-code-slash-commands-to-build-achu-app", "title": "How I Use Qwen Code Slash Commands to Build Achu App", "summary": "A developer uses Qwen Code, an open-source agentic coding CLI, to build Achu, a desktop screenshot beautification app built with Electron, React, and TypeScript. The workflow relies on slash commands like /init, /plan, /compress, /remember, and /btw to manage context, reduce token costs, and maintain consistent output across sessions. The developer emphasizes spec-driven planning through iterative /plan sessions before writing code, combined with parallel subagents and strict context hygiene.", "body_md": "In this blog post, we will see how I use Qwen Code's slash commands and workflow strategies to build [Achu](https://achu.app/) my screenshot beautifier app without burning through tokens or losing context mid-session.\n\nIf you haven't heard of [Achu](https://achu.app), it's a desktop app built with Electron + React + TypeScript. It does screenshot beautification, Privacy Guard (offline OCR redaction), Auto-Vibe (palette-extracted backgrounds), and an AI Bug Agent with GitHub integration. It's a side project I'm genuinely proud of, and Qwen Code has become my go-to agentic coding CLI for it.\n\nA developer shares their day-to-day workflow for using Qwen Code, an open-source agentic coding CLI, to build Achu, a desktop screenshot beautification app built with Electron, React, and TypeScript. The post covers how slash commands like /init, /plan, /compress, /remember, and /btw are used to manage context, reduce token costs, and maintain consistent output across sessions.\n\nThe core approach centers on spec-driven planning through iterative /plan sessions before any code is written, combined with parallel subagents for independent tasks and strict context hygiene using /compress and /clear. Additional practices include pointing the model at library source code instead of documentation and using /remember to persist architectural decisions across sessions.\n\nThis isn't a tutorial about what Qwen Code is. It's about how I actually use it day-to-day, the slash command tricks I rely on, and the discipline it takes to get real work done with an LLM in a terminal.\n\nIt all started with Google Antigravity, but the 5 hours reset and weekly limits is killing my productivity and thinking flow. I had to switch to more affordable and open source model where I chose Qwen.\n\nI've tried Claude Code, Gemini CLI, and a bunch of others. Qwen Code is open source, has excellent subagent support, a rich slash command system, and Qwen Max is genuinely strong at reasoning through complex TypeScript and Electron internals.\n\nMy go-to model is **Qwen Max**. For lighter tasks like `/recap`\n\nor prompt suggestions I set a fast model with `/model --fast qwen3-coder-flash`\n\nto keep costs down.\n\nThe very first thing I do when I start on a new project or return to Achu after a few days is run:\n\n```\n/init\n```\n\nThis analyzes the current directory and generates an initial context file essentially giving Qwen Code a map of the project. It picks up folder structure, key files, and creates a baseline understanding before I say a single word.\n\nAfter `/init`\n\n, I manually add a few paragraphs about the project. I treat this like writing a team onboarding doc for a new developer. I tell Qwen what Achu is, what the current milestone is, what tech stack we're on, and what the known constraints are (like Electron IPC boundaries, the Upstash Redis integration, or the Gumroad-based monetization model).\n\nThis upfront investment saves enormous amounts of back-and-forth later.\n\nWhen I want to build a new feature, I don't just dump a vague request and hope for the best. I use `/plan`\n\nto switch Qwen Code into planning mode.\n\n```\n/plan Implement the Privacy Guard redaction pipeline\n```\n\nIn plan mode, Qwen analyzes and thinks, but does not touch any files. This is key. It's the agentic equivalent of \"think before you act.\"\n\nWhat I actually do is run multiple turns in plan mode to iterate the spec. I think of a \"spec\" as the formal artifact that describes what should be built the interface contracts, the data flow, the error paths, the acceptance criteria. It's not a vague idea. It's something precise enough that a developer (or subagent) could implement it.\n\nThe loop looks like this:\n\n`/plan`\n\nenter planning modeThe quality of implementation is almost entirely determined by the quality of the spec. This multi-turn refinement before a single line of code is written is the most valuable habit I've developed using any agentic coding tool.\n\nBy default, Qwen will ask followup questions. But it is always recommended to tell the model to ask questions.\n\nOnce the spec is locked in, I use subagents aggressively for any work that can happen independently.\n\nQwen Code's subagent system lets you define specialized agents as Markdown files in `.qwen/agents/`\n\n. Each agent has its own system prompt, tool allowlist, and model. You can call them explicitly or let Qwen delegate automatically.\n\nFor Achu, I have a few custom subagents:\n\n`plan`\n\nmode and only reads filesThe key power here is **Fork Subagents** when Qwen needs to run multiple things in parallel, it can implicitly fork. Forks inherit the parent context, run in the background, and share the prompt cache prefix. This means if I ask Qwen to \"investigate the IPC handler for Privacy Guard, the Ollama integration, and the Upstash Redis voting flow simultaneously,\" it can fork three parallel agents without tripling my token costs.\n\nI explicitly phrase tasks as:\n\n\"Run these three investigations in parallel using subagents and report back.\"\n\nThis keeps the main conversation focused and lets the grunt work happen concurrently.\n\nA project-level subagent config lives at `.qwen/agents/testing.md`\n\nand looks like this:\n\n```\n---\nname: testing\ndescription: \"Writes Vitest unit tests and Electron integration tests for Achu. Use PROACTIVELY for any test-related tasks.\"\napprovalMode: auto-edit\ntools:\n  - read_file\n  - write_file\n  - read_many_files\n  - run_shell_command\n---\n\nYou are a testing specialist for an Electron + React + TypeScript app.\nFollow Vitest conventions. Mock Electron IPC using vitest-mock-extended.\nAlways write both positive and negative test cases.\n```\n\nThe phrase \"Use PROACTIVELY\" in the description is important it signals to the main model to delegate testing tasks here without being asked explicitly.\n\nThis is where most people fail with long agentic sessions. They let the context grow unbounded until the model starts hallucinating, forgetting earlier instructions, or producing inconsistent output. I've learned to treat context like memory on a constrained machine.\n\nMy hygiene rules:\n\n**After a major chunk of work is done:**\n\n```\n/summary\n```\n\nThis generates a project summary from the conversation history. I save this externally and reference it when restarting sessions.\n\n**When the context window is getting full:**\n\n```\n/compress\n```\n\nThis replaces chat history with a compressed summary, freeing up tokens while preserving the semantic essence of what was discussed. Think of it as a lossy but practical checkpoint.\n\n**When Qwen starts steering away:**\n\nIf the model starts going off-track giving answers that don't match the project constraints, suggesting patterns we've already ruled out, or just losing the thread. I don't argue. If it happens twice in a row, I clear:\n\n```\n/clear\n```\n\nThen I reload context from scratch using `/init`\n\nand a fresh description. Two drifts is my hard limit. The discipline here is resisting the urge to keep \"fixing\" a bad session. It's cheaper to restart clean.\n\nI watch these two commands constantly.\n\n```\n/context\n```\n\nShows a breakdown of what's consuming the context window right now system prompt, conversation history, tool results. If I see tool results bloating the context, I know a `/compress`\n\nis coming.\n\n```\n/context detail\n```\n\nShows per-item breakdown. Useful when one massive file read is eating 40% of the window.\n\n```\n/stats\n```\n\nGives detailed session statistics tokens used, API calls, cost estimates. I check this before and after big operations. It's how I keep tabs on spend, especially on Qwen Max which isn't the cheapest model.\n\nKeeping an eye on these is the agentic equivalent of watching memory usage in a production system. Ignore it and you'll pay for it.\n\nThis one is a significant productivity trick that I don't see talked about enough.\n\nWhen Qwen needs to understand a third-party library, the default approach is to tell it to fetch the docs URL. The problem is that docs are often incomplete, outdated, or optimized for humans rather than LLMs.\n\nWhat I do instead: I download the library source and point the conversation directly at it using `@`\n\n:\n\n```\n@./vendor/upstash-redis/src Tell me how the pipeline API works\n```\n\nOr with a deeper path:\n\n```\n@./node_modules/@electron/remote/src/main Explain the context bridge setup\n```\n\nQwen reads the actual implementation. No guessing from docs. No hallucination about API signatures that changed in the last major version.\n\nI keep a `vendor/`\n\nfolder in the project root where I clone or copy source for critical dependencies. This makes `@`\n\nreferences stable and reproducible.\n\nFor Achu specifically, I've pointed Qwen at the Ollama TypeScript client source, the llava-phi3 model integration code, and parts of the Electron forge config. The answers I get are ground-truth accurate instead of approximately correct.\n\nSome things should survive session boundaries. My preferences, key architectural decisions, constraints Qwen needs to always respect. I use `/remember`\n\nfor these.\n\n```\n/remember Always use Electron's contextBridge for IPC. Never use remote module.\n/remember Achu uses oklch color space. Do not suggest hex values without conversion.\n/remember Free tier users get 3 exports per day. Pro users are unlimited.\n```\n\nThese get persisted in Qwen's memory store and are injected into future sessions automatically.\n\n`/dream`\n\nis the manual trigger for auto-memory consolidation. Qwen's auto-memory runs in the background, but if I want to force a consolidation pass after a long session to make sure the important discoveries from the current session get persisted I run:\n\n```\n/dream\n```\n\nThink of it as flushing the cache to disk before shutting down.\n\nTo review and manage what's been remembered, I use:\n\n```\n/memory\n```\n\nThis opens the Memory Manager dialog where I can edit or delete entries. I audit this occasionally. Stale memories can be just as harmful as no memories.\n\nThis is my favourite quality-of-life command.\n\n```\n/btw What's the difference between contextBridge.invoke and contextBridge.exposeInMainWorld?\n```\n\n`/btw`\n\nsends a parallel API call with recent conversation context (up to the last 20 messages) and shows the response above the composer without touching the main conversation at all. The main session continues uninterrupted.\n\nI use this constantly for:\n\n`!`\n\nThe response doesn't become part of conversation history. It's a throwaway lookup. This is genuinely useful and I'm surprised more CLI tools don't have something like it.\n\nBeyond the commands I use daily, here are a few from the docs that are genuinely underrated:\n\n`/restore`\n\nRestores files to their state before a tool execution. If a Qwen action made a mess, you can list recent tool executions with `/restore`\n\nand roll back a specific one with `/restore <ID>`\n\n. Think of it as a targeted undo for AI changes.\n\n`/loop`\n\nRuns a prompt on a recurring schedule:\n\n```\n/loop 5m check the build output and report any new warnings\n```\n\nI use this occasionally when I'm doing a long build and want Qwen to monitor for me while I do something else. It's a lightweight cron for conversational tasks.\n\n`/recap`\n\nGenerates a one-line summary of where the session left off. If I step away for more than five minutes, Qwen auto-triggers this when I return:\n\n```\n? Implementing the Privacy Guard redaction pipeline. Next step: wire the OCR output into the bounding-box overlay renderer.\n```\n\nIncredibly useful for picking up after an interruption without scrolling through history.\n\n`/approval-mode auto-edit`\n\nOnce I trust the current task scope, I switch to auto-edit to let Qwen make file changes without prompting me every time. I reserve `yolo`\n\nmode for throwaway branches only.\n\n`/directory`\n\nAdds multiple directories to the workspace context:\n\n```\n/dir add ./src,./tests,./electron\n```\n\nUseful when the feature spans multiple root-level directories that Qwen wouldn't automatically scope to.\n\nHere's the workflow I follow for every non-trivial feature in Achu:\n\n`/init`\n\n+ add project context manually`/plan`\n\nin multiple turns until the spec is solid`/context detail`\n\nregularly, `/compress`\n\nproactively`@`\n\nat source directories, not docs`/remember`\n\nfor anything that should persist`/btw`\n\nwithout breaking flow`/clear`\n\n`/dream`\n\nto consolidate memory, `/summary`\n\nto save the stateThis isn't magic. It's discipline. The LLM doesn't make you disciplined you have to bring that yourself. But when you apply this workflow consistently, the output quality is noticeably better than freeform chatting with an AI.\n\nIf you're building something with Qwen Code, try the spec-first approach. The twenty minutes you spend in `/plan`\n\nmode iterating the spec will save you three hours of correcting implementation drift.\n\nHappy Agentic Coding, Testing, Shipping, Learning, whatever :) !\n\nWhat's your biggest challenge with agentic coding workflows staying in context, or getting the model to follow architectural constraints? Let me know in the comments.", "url": "https://wpnews.pro/news/how-i-use-qwen-code-slash-commands-to-build-achu-app", "canonical_source": "https://dev.to/qainsights/how-i-use-qwen-code-slash-commands-to-build-achu-app-5cm9", "published_at": "2026-06-17 03:49:08+00:00", "updated_at": "2026-06-17 04:21:42.437908+00:00", "lang": "en", "topics": ["developer-tools", "large-language-models", "ai-tools", "ai-agents"], "entities": ["Qwen Code", "Achu", "Electron", "React", "TypeScript", "Qwen Max", "GitHub", "Upstash Redis"], "alternates": {"html": "https://wpnews.pro/news/how-i-use-qwen-code-slash-commands-to-build-achu-app", "markdown": "https://wpnews.pro/news/how-i-use-qwen-code-slash-commands-to-build-achu-app.md", "text": "https://wpnews.pro/news/how-i-use-qwen-code-slash-commands-to-build-achu-app.txt", "jsonld": "https://wpnews.pro/news/how-i-use-qwen-code-slash-commands-to-build-achu-app.jsonld"}}