# Auto-copy OpenAI Codex dictation to clipboard on macOS using Karabiner-Elements

> Source: <https://gist.github.com/guysmoilov/87fd05fb54d2502d83a632c5968dfb55>
> Published: 2026-06-18 08:26:20+00:00

OpenAI Codex's dictation shortcut (`Ctrl-Shift-V`

) transcribes your voice and writes the result to `~/.codex/transcription-history.jsonl`

— but doesn't copy it to the clipboard. This setup does.

This means you can use Codex to transcribe text to *anywhere* in your laptop, not just as prompts to Codex!

**Karabiner-Elements** intercepts`Ctrl-Shift-V`

, passes it through to Codex as normal, then on key-up fires a background script via`to_after_key_up`

.- The script snapshots the current line count of the transcription file, then polls every 0.5s for a new entry (up to 30s timeout).
- When a new line appears, it extracts the
`text`

field, pipes it to`pbcopy`

, and sends a macOS notification with the copied text.

```
mkdir -p ~/.local/bin
# download codex-transcription-copy from this gist to ~/.local/bin/codex-transcription-copy
chmod +x ~/.local/bin/codex-transcription-copy
mkdir -p ~/.config/karabiner/assets/complex_modifications
# download codex_transcription_copy.json from this gist to that directory
```

Then in **Karabiner-Elements → Complex Modifications → Add rule**, enable **"Codex: copy transcription on Ctrl-Shift-V release"**.

- macOS with
[Karabiner-Elements](https://karabiner-elements.pqrs.org/)installed - Python 3 (ships with macOS)
[OpenAI Codex](https://openai.com/codex/)desktop app with the following hold-to-dictate hotkey configured:

Karabiner logs script output to `/tmp/karabiner-codex-copy.log`

.
