How-to

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:

  1. Download Loqua from the homepage and drag it into /Applications.
  2. 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.)
  3. Open Loqua's Settings and confirm your push-to-talk shortcut. Default is Fn + Space. We use Caps Lock remapped via Karabiner-Elements because it's reachable without leaving the home row.
  4. Open any text editor — TextEdit, VS Code, Cursor, Notes — and put your cursor in a text field.
  5. 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:

You say
"add a comment saying this caches the response for fifteen minutes and on auth failure just redirect to login don't retry"
Loqua writes (in VS Code, Python file)
# 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 get fetchUserProfile; "function name underscore fetch user profile" to get fetch_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:

You say (in Cursor, refactor request)
"move the rate limiter into its own middleware file and update the imports"
Loqua writes (as a Cursor prompt)
Refactor: extract the rate-limiter logic into a new middleware/rateLimit.ts module. Update imports across handlers. Preserve current behavior; no API changes.
You say (after staging changes)
"this fixes the race condition in session cleanup when two logout requests hit at the same time added a mutex on the session store also added a regression test"
Loqua writes (as a git commit message)
fix(auth): handle concurrent session cleanup race condition

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
You say (in the PR description box)
"this PR adds support for partial responses on the search endpoint clients can request specific fields and get back a smaller payload covered by tests and the changelog is updated"
Loqua writes (in GitHub PR)
## Summary
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
You say (in Terminal)
"use ripgrep to find all usages of the old auth client in the api folder excluding tests"
Loqua writes (in Terminal)
rg "OldAuthClient" api/ --glob '!**/*_test.go'
You say (writing a SQL query in DBeaver)
"select user id email and last login from users where last login is more than 90 days ago and account status equals active"
Loqua writes (in DBeaver)
SELECT user_id, email, last_login
FROM users
WHERE last_login < NOW() - INTERVAL '90 days'
  AND account_status = 'active';
You say (writing a regex)
"regex for matching email addresses but allowing plus signs in the local part"
Loqua writes (in VS Code, JavaScript file)
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:

ContextOutput shape
Inside a function body, Python fileCode or inline comment, matching the file's language
In a docstring or top-of-file commentProse, formatted as a docstring
In the source-control commit message fieldConventional commit format
In a PR description on GitHubStructured PR template (Summary / Changes / Test plan)
In Cursor's chat panelPrompt-shaped instruction with context
In Claude Code's terminal interfaceDirect 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:

You say
"add a fallback when 用户画像 service is down so the page still renders with the default state"
Loqua writes (in VS Code, code comment)
// 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 + Space conflicts with Spotlight or another app, change the shortcut in Settings → Shortcut. Many of us use Caps Lock remapped 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

Does Loqua work in Cursor specifically?
Yes. Loqua treats Cursor as a first-class IDE — it detects the chat panel, file context, and selection state, and shapes output accordingly. Prompts go in the chat panel; code goes in the editor; comments stay inside the active file's language.
Can I use Loqua with Claude Code?
Yes. Claude Code is detected as a terminal-based development tool; Loqua produces direct instructions and file paths in a shape Claude Code understands. For long refactor narrations or spec drafting, voice is especially efficient.
What if my variable names mix Chinese and English?
Loqua handles mid-sentence code-switching without a mode toggle. Saying "add a check for the 用户画像 service" produces a comment or identifier with the Chinese term inline, preserving the original characters.
How do I dictate symbols like braces, parens, equals?
You usually don't need to. Loqua infers structure from context — saying "function name fetch user with id and return a user" produces the full signature with parens, types, and braces. For explicit symbol input (rare), say "open paren" / "close paren" / "equals sign" etc.
How does Loqua handle long voice sessions?
There's no per-utterance cap. Hold the shortcut, talk for as long as you want, release. Streaming output appears as you speak — TTFT is under 200ms, so the first words show up while you're still in the middle of the phrase.
Is there a learning curve?
About an hour for IDE work. The biggest mental shift is learning which framings produce the cleanest output (see the patterns section above). After that, it's faster than typing for prose-in-code work, and the IDE context awareness does most of the formatting decisions for you.

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
Voice typing for AI coding: voice prompt Cursor and Claude Code without typing
productivity
Voice productivity stack: 9 tools we actually use to write, ship, and think
how-to
Mac meeting notes voice: from voice to done with notes and action items
engineering
Omni-modal voice typing: multimodal understanding, MoE, and streaming text output