global-shortcuts

A system for keyboard shortcuts that work across the operating system, even when the app is not focused.

In plain words
What is it for?
Use it to register, change, persist, validate, replace, and remove global shortcuts in an Electron desktop app.
Why use it?
It gives desktop actions consistent shortcuts and prevents unsafe key bindings from taking over ordinary typing.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/lodyai/lody/global-shortcuts
Clone the repo
git clone --depth 1 https://github.com/LodyAI/Lody
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 489 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00489
Opus 5 $0.00000 $0.00244
Sonnet 5 $0.00000 $0.00098
Haiku 4.5 $0.00000 $0.00049

Measured yesterday against content hash d4fdca8f5d01, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

global-shortcuts scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/components/src/lib/commands/global-shortcuts.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Configurable OS-level global shortcuts

Global shortcuts do not use the renderer command registry. Electron main registers them with globalShortcut.register, so they can run while the app is unfocused.

Cross-process path

  • Shared source of truth: @lody/shared/electron-ipc

    • GlobalShortcutId and GLOBAL_SHORTCUT_DEFAULTS define ids and default binding strings such as Ctrl+Alt+L for both processes.
    • IPC contracts are GlobalShortcutBinding, SetGlobalShortcutInput, SetGlobalShortcutResult, and GlobalShortcutSetError.
    • bindingToElectronAccelerator converts a binding to an Electron accelerator and rejects invalid or modifier-free bindings. A global bare key would consume that key across the OS. Pure conversion tests live in packages/shared/tests/global-shortcut-accelerator.test.ts.
  • Main process: apps/electron/src/main/services/global-shortcuts-service.ts

    • GlobalShortcutsService persists per-user overrides through Conf, registers the effective bindings, atomically replaces a binding with rollback on conflict, and unregisters everything during disposal. binding: null is an explicit unbind.
    • createGlobalShortcutsService in main injects the behavior handlers; the service owns registration/persistence rather than window behavior.
    • app.getGlobalShortcuts and app.setGlobalShortcut validate IPC input. A trigger sends app.globalShortcut (GLOBAL_SHORTCUT_TRIGGERED_CHANNEL) to an available renderer, which owns any analytics event.
  • Renderer: lib/native-global-shortcuts.ts provides a null-safe API wrapper, hooks/use-global-shortcuts.ts loads and updates bindings, and GlobalShortcutRow in keyboard settings provides recording, validation, conflict feedback, and unbind. GLOBAL_SHORTCUTS in shortcuts.ts is presentation-only.

Adding a shortcut

  1. Add the id and default binding to @lody/shared.
  2. Add { id, handler } to createGlobalShortcutsService.
  3. Add the presentation entry and i18n title to GLOBAL_SHORTCUTS.

Read the full file on GitHub · 41 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 41 lines · 0 tokens per session scan A d4fdca8f5d01

Subscribe to this mod's changes

global-shortcuts is a command published in the GitHub repository LodyAI/Lody (801 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 489 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.