How-to

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 firstOutput 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

You say (Cursor, with a function selected)
"refactor this to use the new auth client and remove the legacy fallback that's not used anywhere else"
Loqua writes (in Cursor chat)
Refactor the selected function to use the new AuthClient. Remove the legacy fallback path — confirmed unused elsewhere in the codebase. Preserve the public function signature.
You say (debugging in Claude Code)
"when I call the search endpoint with an empty query I get a 500 instead of an empty array I expected the empty case to be handled gracefully"
Loqua writes (in Claude Code terminal)
Debug: search endpoint returns 500 on empty query.

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.
You say (writing a spec for a new feature)
"spec for a saved searches feature users can save a search and reload it later it should sync across devices and be queryable by name"
Loqua writes (in Cursor, planning doc)
## Spec: Saved Searches

**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.
You say (asking for a test)
"add a test that verifies the rate limiter blocks the eleventh request in a one minute window and returns a 429 with a retry after header"
Loqua writes (in Claude Code)
Add a test for the rate limiter:
- 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.
You say (multi-file refactor request)
"break the user controller into separate files for auth profile and preferences keep the existing public API and update the router"
Loqua writes (in Cursor chat)
Refactor: split 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.
You say (mid-task pivot)
"actually before we refactor add a regression test that covers the current behavior of the merge function so we can detect drift later"
Loqua writes (in Claude Code)
Before refactoring: add a regression test covering the current behavior of the 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:

You say (in Cursor chat)
"那个 cache invalidation 的逻辑要重构 现在 race condition 太多了 边界 case 经常漏"
Loqua writes (as a Cursor prompt)
那个 cache invalidation 的逻辑要重构 —— 现在 race condition 太多了,边界 case 经常漏。请帮我重新设计 invalidation 策略:列出 race-condition 风险点,给出建议的同步原语方案,覆盖典型边界 case。

Cross-tool reuse

The same voice phrase, dictated into different AI tools, produces appropriately different prompts. We don't reframe — Loqua does:

ToolPrompt 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

Does Loqua work with Cursor's chat panel?
Yes. Loqua detects when the Cursor chat panel is open and treats your dictation as a prompt rather than a code edit. The selected code (if any) is included as context. Open the chat panel first; otherwise Loqua may treat dictation as a code-file edit.
Does Loqua work with Claude Code?
Yes. Claude Code runs in a terminal and Loqua treats its prompt as a structured-instruction context — output includes explicit file paths and a brief plan when appropriate. Long refactor narrations and spec drafting are where this shines.
Can I dictate code character-by-character?
Technically yes, but you shouldn't. Voice is for the prose part of the prompt — the explanation, the goal, the constraints. Let the LLM produce the code. Trying to dictate code letter-by-letter defeats the purpose.
How does Loqua know it's a prompt vs a code edit?
It reads the active app, the focus state, and visible UI cues. Cursor's chat panel being open is a prompt signal. The terminal of Claude Code is a prompt signal. A cursor in a function body of a Python file is a code-edit signal.
What about ChatGPT or Claude.ai in the browser?
Loqua works in any text input — including browser prompt boxes. It shapes output as a markdown-friendly prompt with sections when the destination is a chat AI.
Will Loqua send my prompts to a cloud service?
Loqua's speech recognition and multimodal context layers run on-device. The text that gets typed into Cursor or Claude Code is what those tools then send to their providers (Anthropic, OpenAI, etc.) — that's their network behavior, not Loqua's. See our privacy note for what Loqua does and doesn't send.

Try Loqua today

Free to start. Mac native. Built by algorithm researchers who use it every day.

Download for Mac

More from the Loqua Blog

how-to
How to dictate code on Mac: a complete guide for Cursor, VS Code, and Claude Code
productivity
Voice for thinking with AI: why your keyboard is the wrong tool
engineering
Reinforcement learning voice typing: GRPO, DPO, and on-policy distillation in our voice stack
compare
Loqua vs Typeless: a Mac-native Typeless alternative for context, coding, and depth