Voice typing for AI coding: voice prompt Cursor and Claude Code without typing
Vibe coding goes faster when you can describe the change instead of typing it. Six worked examples, the prompt patterns we converged on, and how to handle multilingual identifiers.
TL;DR
If you're searching for how to voice prompt Cursor — or how to get Claude Code dictation right without spelling every identifier — this is the practical guide. Voice typing for AI coding works because prompts are mostly prose: context, intent, constraints, and test expectations. Loqua adds multimodal screen context, structured prompt formatting, technical-vocabulary handling, and mid-sentence EN+Chinese mixing. The vibe coding voice workflow that pays off most: long Cursor prompts, Claude Code debugging, refactor specs, and test descriptions. Short "fix this" prompts are often no faster by voice; the win is in dense instructions.
Loqua is a context-aware voice typing tool for Mac that sees what you're working in and shapes output accordingly. For AI coding specifically, that means it can detect the chat panel of Cursor, the terminal of Claude Code, the prompt box of ChatGPT, and produce prompts in the structure those tools handle best.
This isn't a productivity-listicle pitch. We use voice for our own AI coding daily and we cut the prompt-writing time roughly in half on long instructions, where the win is largest. Short prompts ("fix this") are a wash. Long, structured prompts (refactor specs, multi-file changes, debug narration) are where voice pays for itself.
Why voice matches AI coding
The shape of an AI-coding prompt is different from the shape of code. A good prompt has: a context block (where I am, what I see, what I just tried), an instruction block (what I want done), and constraints (don't change X, preserve Y, must pass Z tests). That's prose, not syntax — and prose is what voice excels at.
You think faster than you type — easily 2× faster for prose. The bottleneck isn't your mental model; it's the keystroke tax. For prompts that explain a complex situation to an LLM, that gap matters. Loqua adds three things on top of basic dictation: it sees your IDE state (so context blocks write themselves), it formats prompts structurally (system + user, or bullet step-list), and it handles technical vocabulary without you spelling identifiers.
Setup for AI coding
This section assumes Loqua is installed (see our setup guide for dictating code on Mac). The only AI-coding-specific configuration is granting Loqua's Accessibility permission, which lets it read the active app's selection and adjacent text. macOS Accessibility is documented at developer.apple.com; this is the same API screen readers and automation tools use.
Three habits to build:
- Select before dictating. If you want the prompt to act on a specific block, select it first. Loqua passes the selection as context.
- Open the chat panel inline. In Cursor, the chat panel being visible tells Loqua you're prompting, not editing.
- Pause for structural breaks. A half-second pause is read as a paragraph break in your prompt — useful for separating context from instruction.
Prompt structure that works
After months of voice prompting, we've converged on three structures that produce the cleanest LLM behavior. Loqua reads how you frame the start of an utterance and shapes the output accordingly.
| Framing you say first | Output shape |
|---|---|
| "Refactor this so..." | Refactor: [goal]. Constraints: [implicit from selection]. Output: [code]. |
| "Debug this — when I X, Y happens but I expected Z" | Narrative bug report with steps, expected, actual. |
| "Write a spec for..." | Structured spec: Goal / Inputs / Outputs / Edge cases / Tests. |
| "Add a test that..." | Test description + acceptance criteria. |
| "Explain why this code..." | Plain prose, technical register. |
Six worked examples
AuthClient. Remove the legacy fallback path — confirmed unused elsewhere in the codebase. Preserve the public function signature.Steps:
1. POST /search with body
{ "query": "" }2. Server responds 500 (expected: 200 with empty array)
Hypothesis: the empty-string path skips the early-return and hits the indexer with an invalid query.
Fix: add an early return for empty queries.
**Goal:** users save a search query and reload it later.
**Inputs:** search query (string), user id, optional name (string, defaults to first N chars of query).
**Behavior:**
- Persist to user's saved-searches collection.
- Sync across devices via existing user-data sync.
- Queryable by name (case-insensitive substring match).
**Edge cases:** duplicate names → suffix with index; deleted user → cascade delete.
- Send 10 requests in a 60-second window — all succeed.
- 11th request should return 429.
- Response must include a
Retry-After header with seconds-remaining value.- Use existing test fixtures for time control.
userController.ts into three modules — authController, profileController, preferencesController. Keep the public API surface unchanged. Update the router to import from the new locations. No behavior changes; this is a structural refactor only.merge function. The test should snapshot the existing outputs so we can detect any drift introduced by the refactor.Letting Loqua see file context
When you say "refactor this" with no selection, Loqua sends only the instruction. When you have text selected, Loqua includes a short context block describing what was selected — file name, lines, surrounding identifiers — before the instruction. You don't need to dictate the context; the multimodal layer reads it.
This matters for AI tools that benefit from explicit context (Claude Code especially benefits from file paths and line numbers). Loqua's omni-modal stack is what makes this work — see the deeper note on voice meets vision: omni-modal dictation if you want the research-level intuition.
Mid-sentence EN+中
Many of our engineering team's discussions happen in Mandarin with English technical terms mixed in. Voice-prompting AI tools in this register is a daily activity. Loqua handles the code-switching without a mode toggle:
Cross-tool reuse
The same voice phrase, dictated into different AI tools, produces appropriately different prompts. We don't reframe — Loqua does:
| Tool | Prompt shape Loqua produces |
|---|---|
| Cursor (chat panel) | Conversational instruction with implicit file context |
| Claude Code (terminal) | Structured instruction with explicit file paths and a brief plan |
| ChatGPT (web) | Markdown-formatted prompt with sections |
| Aider (terminal) | Direct file-edit instruction with target paths |
You write once with your voice; Loqua reshapes per destination.
Gotchas
- Don't dictate code letter-by-letter. Voice is for the prose part of the prompt; let the LLM produce the code. Trying to dictate code character-by-character defeats the point.
- Selection matters. If you want Loqua to include selected code as context, select before dictating. Otherwise it sends just the instruction.
- Long pauses end the dictation. A 1.5-second silence is read as utterance-end. If you're thinking mid-sentence, use a filler word — Loqua strips fillers from the output but uses them to keep the recording open.
- Cursor's chat panel state matters. If the panel isn't visible, Loqua may treat your dictation as a code edit instead of a prompt. Open the panel first.
- Don't dictate identifiers blindly. If you have a custom library name that's not common, add it to Personal Dictionary in Settings or pronounce it as one word.
The aggregate effect: prompt-writing time roughly halves on long instructions, and the prompts themselves are better because the voice form encourages explaining intent rather than just naming the change. That's the part that matters more than raw speed. For more on the wider voice ai coding pattern — voice prompt Cursor flows, Claude Code dictation, and how to keep your hands off the keyboard during long sessions — see the companion guides linked above.
For a longer take on why voice fits AI work, see why your keyboard is the wrong tool for thinking with AI.
Frequently asked questions
Try Loqua today
Free to start. Mac native. Built by algorithm researchers who use it every day.
Download for Mac