{"slug": "auto-copy-openai-codex-dictation-to-clipboard-on-macos-using-karabiner-elements", "title": "Auto-copy OpenAI Codex dictation to clipboard on macOS using Karabiner-Elements", "summary": "A developer created a Karabiner-Elements rule that intercepts OpenAI Codex's dictation shortcut (Ctrl-Shift-V) and automatically copies the transcribed text to the macOS clipboard. The rule polls the transcription history file for new entries and pipes the text to pbcopy, enabling Codex dictation to be used in any application.", "body_md": "OpenAI Codex's dictation shortcut (`Ctrl-Shift-V`\n\n) transcribes your voice and writes the result to `~/.codex/transcription-history.jsonl`\n\n— but doesn't copy it to the clipboard. This setup does.\n\nThis means you can use Codex to transcribe text to *anywhere* in your laptop, not just as prompts to Codex!\n\n**Karabiner-Elements** intercepts`Ctrl-Shift-V`\n\n, passes it through to Codex as normal, then on key-up fires a background script via`to_after_key_up`\n\n.- The script snapshots the current line count of the transcription file, then polls every 0.5s for a new entry (up to 30s timeout).\n- When a new line appears, it extracts the\n`text`\n\nfield, pipes it to`pbcopy`\n\n, and sends a macOS notification with the copied text.\n\n```\nmkdir -p ~/.local/bin\n# download codex-transcription-copy from this gist to ~/.local/bin/codex-transcription-copy\nchmod +x ~/.local/bin/codex-transcription-copy\nmkdir -p ~/.config/karabiner/assets/complex_modifications\n# download codex_transcription_copy.json from this gist to that directory\n```\n\nThen in **Karabiner-Elements → Complex Modifications → Add rule**, enable **\"Codex: copy transcription on Ctrl-Shift-V release\"**.\n\n- macOS with\n[Karabiner-Elements](https://karabiner-elements.pqrs.org/)installed - Python 3 (ships with macOS)\n[OpenAI Codex](https://openai.com/codex/)desktop app with the following hold-to-dictate hotkey configured:\n\nKarabiner logs script output to `/tmp/karabiner-codex-copy.log`\n\n.", "url": "https://wpnews.pro/news/auto-copy-openai-codex-dictation-to-clipboard-on-macos-using-karabiner-elements", "canonical_source": "https://gist.github.com/guysmoilov/87fd05fb54d2502d83a632c5968dfb55", "published_at": "2026-06-18 08:26:20+00:00", "updated_at": "2026-06-18 19:33:21.784858+00:00", "lang": "en", "topics": ["developer-tools", "artificial-intelligence", "large-language-models"], "entities": ["OpenAI Codex", "Karabiner-Elements", "macOS", "pbcopy"], "alternates": {"html": "https://wpnews.pro/news/auto-copy-openai-codex-dictation-to-clipboard-on-macos-using-karabiner-elements", "markdown": "https://wpnews.pro/news/auto-copy-openai-codex-dictation-to-clipboard-on-macos-using-karabiner-elements.md", "text": "https://wpnews.pro/news/auto-copy-openai-codex-dictation-to-clipboard-on-macos-using-karabiner-elements.txt", "jsonld": "https://wpnews.pro/news/auto-copy-openai-codex-dictation-to-clipboard-on-macos-using-karabiner-elements.jsonld"}}