How to dictate code on Mac: a complete guide for Cursor, VS Code, and Claude Code
Identifiers spelled right. Commit messages already in conventional format. PR descriptions in the voice you'd type. Six worked examples and the keyboard setup we use every day.
TL;DR
This is the practical guide to dictate code on Mac with Loqua — voice typing for programmers who write code in Cursor, VS Code, and Claude Code. Three things have to line up: technical identifiers are recognized, output is formatted for the destination, and latency stays low enough not to break flow. Loqua is designed for that Mac workflow: code comments, commits, PR descriptions, terminal commands, Cursor prompts, and Claude Code instructions. This guide walks through setup and worked examples without pretending voice is the best way to write every line of code.
Loqua is a context-aware voice typing tool for Mac that detects whether you're in an IDE, a terminal, a PR description, or a chat panel, and adjusts output accordingly. It runs on Apple Silicon via the Neural Engine, formats per-app, and recognizes technical vocabulary without requiring a dictionary loaded first.
The honest version: dictating code is a different skill than dictating prose. You'll be slower in the first hour. By hour two you'll write longer comments and better commit messages because the voice form doesn't have the keystroke tax. We've been using this every day for months — here's the setup.
Setup in 90 seconds
Five steps, none of them surprising if you've installed a Mac app before:
- Download Loqua from the homepage and drag it into
/Applications. - On first launch, grant microphone permission and Accessibility permission. (Accessibility is what lets Loqua see your active app and selected text — see Apple's Privacy & Security guide for what Accessibility means here.)
- Open Loqua's Settings and confirm your push-to-talk shortcut. Default is
Fn + Space. We useCaps Lockremapped via Karabiner-Elements because it's reachable without leaving the home row. - Open any text editor — TextEdit, VS Code, Cursor, Notes — and put your cursor in a text field.
- Hold the shortcut. Talk. Let go. Text appears at the cursor.
That's it. No per-app configuration. Loqua is system-wide on Mac.
Your first code dictation
Open VS Code or Cursor and put your cursor inside a Python file, in a function body. Say, naturally:
# Cache response for 15 min.# On auth failure (401): redirect to /login — do not retry.Notice three things that happened: it recognized you were in code (output as comment, not as prose); it formatted the explicit values ("fifteen minutes" → "15 min"; inferred the standard 401 status code); and it tightened the second clause into a structured directive. None of this required configuration — the multimodal context engine read the file extension and adjacent code to decide.
Voice patterns that work in code
You don't need to learn new syntax. You do need to learn which framings produce the cleanest output. The patterns below are what we've converged on after months of daily use.
- Name + format hint: say "function name
fetch user profile" to getfetchUserProfile; "function name underscorefetch user profile" to getfetch_user_profile. The language convention of the active file is the default. - Type spec by description: say "async function that takes a user id and returns a promise of user" to get the full signature; Loqua infers types from context.
- Comment intent first: say "add a comment saying X" to get a comment in the file's syntax; just saying X tends to produce a comment too inside a code file, but the explicit framing avoids ambiguity.
- Commit message: say what changed: in a commit context (Source Control panel, terminal git commit), Loqua produces conventional-format messages without needing the prefix.
- PR description: lead with the why: Loqua reads the PR template if one is present and shapes around it.
- Pause for a structural shift: a half-second pause is read as a paragraph break in prose and as a logical step break in code blocks.
Six worked examples
Each example below is real — what we actually said and what Loqua wrote. The voice is yours; the output is Loqua's:
middleware/rateLimit.ts module. Update imports across handlers. Preserve current behavior; no API changes.Two simultaneous /logout requests could both attempt to invalidate the same token. Added mutex lock on the session store write path. Tests: auth_test.go — TestConcurrentLogout
Adds field-selection support to the search endpoint. Clients can request a subset of fields and receive a smaller payload.
## Changes
- Search endpoint accepts a
fields query param- Response serializer respects field selection
- Tests cover selection, omission, and invalid-field handling
- CHANGELOG.md updated
## Test plan
- [ ] Unit tests pass
- [ ] Manual smoke against staging
rg "OldAuthClient" api/ --glob '!**/*_test.go'SELECT user_id, email, last_loginFROM usersWHERE last_login < NOW() - INTERVAL '90 days' AND account_status = 'active';const emailWithPlus = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/;How IDE context shapes output
Loqua doesn't just know that you're in VS Code or Cursor. It knows the file type, the active selection, the surrounding code, and (if you allow it) the open chat panel. The same voice phrase produces a different output depending on these cues:
| Context | Output shape |
|---|---|
| Inside a function body, Python file | Code or inline comment, matching the file's language |
| In a docstring or top-of-file comment | Prose, formatted as a docstring |
| In the source-control commit message field | Conventional commit format |
| In a PR description on GitHub | Structured PR template (Summary / Changes / Test plan) |
| In Cursor's chat panel | Prompt-shaped instruction with context |
| In Claude Code's terminal interface | Direct instruction, often with file paths if context is clear |
You don't need to tell Loqua any of this. It reads the active app and the cursor's surrounding text and decides. If it gets the wrong shape, repeat the phrase with the explicit framing (e.g., "add a comment saying..." or "the commit message is...") and it adjusts.
For the deeper screen-context mechanics behind identifier preservation, see building a listener that sees what you see.
Multilingual identifiers and code-switching
A real situation we hit: a Mandarin-named feature flag in a codebase, dictated mid-sentence in an English commit message. Loqua handles this without a mode switch — see our voice + AI coding guide for more on EN+中 patterns. The short version:
// Fallback: if the 用户画像 service is down, render the page with the default state.Troubleshooting
- Identifier comes out wrong: repeat the voice phrase with the identifier in normal English (e.g. "fetch user profile" instead of pronouncing each letter). Loqua's NER is trained for natural utterance, not letter-spelling.
- Output is prose when you wanted code: say "add a comment saying..." or "as code:..." as an explicit framing. The cursor position usually disambiguates, but a frame helps.
- Wrong language convention (camelCase vs snake_case): Loqua follows the file's language default. To override, say "camel case" or "snake case" inline.
- Voice not registering: check the menu-bar icon — gray means mic permission missing; red means it's listening; green is idle. Mic permission lives in System Settings → Privacy & Security → Microphone.
- Shortcut conflict: if
Fn + Spaceconflicts with Spotlight or another app, change the shortcut in Settings → Shortcut. Many of us useCaps Lockremapped via Karabiner — Caps Lock is otherwise wasted real estate.
What we actually use every day
This is the part that matters more than feature lists. Here's what our daily workflow looks like:
- Code comments — almost always voice. The voice form is longer, more explanatory, and the team reads them more.
- Commit messages — voice with a quick edit pass. Body content is fuller because the keystroke tax is gone.
- PR descriptions — voice, often dictated while still looking at the diff. The structure comes out right because Loqua sees the GitHub template.
- Cursor / Claude Code prompts — voice for everything except very short "fix this" prompts. Long refactor descriptions are where voice pays for itself.
- Slack / Discord engineering threads — voice. Faster, more thoughtful.
- Identifiers and code bodies — mixed. Trivial code (CRUD, glue) is voice-friendly; complex algorithmic code is usually faster to type because the structure is the work.
The math is: about 4× speed gain on writing prose-in-code (comments, docs, messages, prompts) and roughly typing-parity on writing pure code. The aggregate over a workday is significant — and the cognitive load drops because you stop context-switching between thinking-mode and typing-mode.
If you want the deeper architecture of how this works, see our note on the three-model voice typing stack. If you want to extend the pattern to AI-coding tools specifically, see voice typing for AI coding.
One more note for programmers evaluating this workflow: if you're searching the web for how to dictate code on Mac, most results stop at "use Apple's built-in dictation." That's a fine starting point but it's audio-only — it doesn't know your IDE, your identifiers, or your structural conventions. Loqua's pitch is the next layer up: voice typing for programmers who want output that already matches the destination.
Frequently asked questions
Try Loqua today
Free to start. Mac native. Built by algorithm researchers who use it every day.
Download for Mac