hex AGENTS.md

Project instructions for HEX, a local macOS voice tool with experimental Linux display support. They describe its audio, speech-recognition, keyboard, settings, and feature boundaries.

In plain words
What is it for?
Developing or reviewing HEX’s voice input, hotkeys, audio handling, settings, and supported desktop environments.
Why use it?
They give an AI the project’s safety and architecture rules, including which features are enabled by default and where important behavior must remain explicit.

Instructions file for CodexOpenCode

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 instructions/anomalyco/hex/agents-md
Clone the repo
git clone --depth 1 https://github.com/anomalyco/hex

Made for: Codex, OpenCode.

Per session 6,221 This file is loaded in full into every session.
When invoked 6,221 The same file — it is already loaded in full.
Security scan B 2 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.06221 $0.06221
Opus 5 $0.03111 $0.03111
Sonnet 5 $0.01244 $0.01244
Haiku 4.5 $0.00622 $0.00622

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

Security

Grade B, and why

hex AGENTS.md scanned grade B with 2 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo pacman -S --needed base-devel git rustup python alsa-lib curl jq openssl xxd \

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

authenticated loopback HTTP through the system curl; request bodies and
AGENTS.md · 483 lines

How it starts

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

HEX Agent Guide

Purpose

Build HEX as a local, observable macOS voice appliance with explicit Linux X11 and wlroots-compatible Wayland beta contracts. Keep the engine native Rust and keep consequential behavior explicit. Protected commands and typed captures remain compiled Rust; ordinary literal commands live in the explicit TypeScript user config. User-facing runtime settings persist in Application Support.

The distributed release starts in hotkey-dictation-only mode. Voice commands and their catalog remain available as a persisted opt-in that defaults off. Voice Action also requires its own persisted opt-in, defaulting off even for existing settings without an explicit enabled flag. DEVELOPER_FEATURES_ENABLED keeps meetings and their UI/CLI surfaces available only in debug builds.

Architecture

  • audio: cpal device enumeration and timestamped mono float PCM delivery, live selection, and bounded stream recovery.
  • moonshine: the only Moonshine C adapter and the streaming recognizer.
  • suppression: the macOS event tap, shortcut suppression, and the configurable dictation-hotkey state machine.
  • keyboard: active-layout key resolution and balanced synthetic shortcuts.
  • dictation: warm pre-roll, growable capture, and 16 kHz local-transcription resampling.
  • dictation_audio: the authoritative microphone timeline, lazy stream lifecycle, recording owner, exact shortcut boundaries, recovery handoff, and disposable bounded command audio projection.
  • recording_environment: serialized RAII ownership of idle-sleep prevention, output muting, and supported media-player pause/resume behavior.
  • dictation_processor: context-selected, deadline-bounded OpenCode rewrite profiles with raw-transcript fallback. The macOS app discovers the opencode2 beta executable, links missing installs to https://v2.opencode.ai/, and uses opencode2 api get to discover or start its managed service. Generation uses CLI-managed discovery with the matching owner-only service registration and authenticated loopback HTTP through the system curl; request bodies and credentials use stdin, never argv or new temporary files.
  • parakeet: the strict-Metal transcribe.cpp adapter plus bounded inference, processing, ordered output, paste, last-result, and meeting-delta workers.
  • apple_speech: the Swift SpeechAnalyzer bridge with per-locale support checks, asset reservation, and batch transcription.
  • transcription: runtime selection and transactional warm-model activation.
  • transcription_models: the compiled model catalog, language recommendations, pinned artifact verification, and lazy installation.
  • transcription_service: bounded host-audio admission, hostile WAV validation, normalization, cancellation, and warm inference ownership.
  • local_api: authenticated loopback discovery or direct-child endpoint handoff, bounded HTTP parsing, model preparation progress, and raw transcription routes.
  • sdk/typescript: Promise and Effect v4 host wrappers for direct-child lifecycle, authenticated model preparation, and host-audio transcription.
  • developer_control: the typed debug-only command/reply protocol the local API uses to drive the running app from hex dev.
  • paste: clipboard insertion, continuation joins, and generation-safe clipboard restoration.
  • accessibility: bounded focused-window and selected-text capture through Accessibility without touching the clipboard.
  • recognition: the semantic coordinator for Moonshine, command mode, hotkey and voice-delimited controls, workers, and observations. It does not own the authoritative microphone timeline.
  • command_grammar: typed command patterns, captures, overlap detection, and command catalog metadata.
  • commands: pure contextual resolution plus bounded asynchronous macOS action execution.
  • personal_commands: the Bun-hosted @hex/commands TypeScript workspace: managed SDK provisioning, the watch-reloaded user command and transformation host, bounded invocation dispatch, and status snapshots.
  • text_replacements: phrase-boundary-aware compilation of configured text replacements applied longest-match-first to transcripts.
  • config: compiled commands, preferred input devices, and dictation profiles.
  • context: native foreground application and window context capture plus browser context. Browser host is the domain concept; Brave AppleScript is only the first adapter.
  • application_catalog: cached installed-application discovery with normalized bundle identity and rendered icons for the UI.
  • app_settings: persisted settings and live runtime projection for commands, hotkeys, microphone and transcription selection, recording behavior, processing, sound volume, and Dock policy.
  • login_item: the native SMAppService.mainAppService adapter. macOS owns registration state; it is deliberately not duplicated in settings.json.
  • app_paths: the Application Support owner for runtime logs and shared state.
  • onboarding: required permission health, selected dictation-model installation, the release startup gate, and opt-in command-model setup.
  • sparkle: packaged-app-only Sparkle lifecycle and manual update checks.
  • linux, linux_app, linux_dictation, linux_input, linux_paste, linux_settings, linux_transcriber: the Linux beta CLI, GPUI shell, hotkey capture-transcribe-paste loop, persisted settings, and transcribe.cpp.
  • linux_session: display-backend selection matching GPUI's nonempty WAYLAND_DISPLAY rule, independent of persisted preferences.
  • linux_wayland_input: read-only evdev input, explicit physical key mappings, cancellable shortcut capture, exact chord state, and bounded device rediscovery.
  • linux_desktop: the single process-owned GTK thread for the X11 tray and focus-free, click-through Wayland recording/processing HUD. A listener never initializes or shuts down a separate GTK runtime.
  • linux_updater: signed direct-install updates, bounded downloads, atomic version activation, and restart handoff for user-local Linux installs.
  • history: the owner-only bounded retained-dictation store: retention windows with hard entry and byte caps, atomic crash-safe persistence, and search. Text and bounded metadata only, never audio.
  • events: bounded asynchronous append-only NDJSON observations and bounded incremental reading; dashboard and the GPUI Activity pane are read-only projections.
  • desktop_activity: the shared listener, device, transcript, and session projection over EventReader.
  • desktop_host: semantic desktop capabilities, portable UI snapshots, and typed actions implemented by the macOS root and contained Linux adapter.
  • desktop_ui: platform-neutral GPUI visual tokens and controls shared by both desktop roots, including the mandatory pane scaffold: pane_header / pane_header_with_action, pane_body, pane_content, the shared header_button action chip, and the single PANE_CONTENT_WIDTH and PANE_LIST_WIDTH layout constants.
  • text_input: the shared GPUI single- and multi-line text input with editing, selection, clipboard, and input-method support.
  • desktop_transcription_picker: the single GPUI language/model picker used by both desktop roots over portable model presentation and platform preparation callbacks.
  • app_window: the production Settings, Modes with mode-owned processing, Voice Action, History, Replacements, and opt-in Commands shell plus developer-only Meetings, Activity, and HUD Lab panes.
  • status_item: the persistent macOS menu-bar owner for Settings, Paste Last Dictation, update checks, and orderly application shutdown.
  • dictation_indicator: the click-through Metal/GPUI capture and processing HUD.
  • meeting: explicit ScreenCaptureKit capture, owner-only WAV and transcript artifacts, final local-model publication, and recovery.
  • meeting_live: bounded dual-stream Moonshine draft transcription and byte-offset transcript tailing.
  • microphone_activity: permission-light CoreAudio process input observation.
  • meeting_detection: pure provider classification, debounce, and suppression.
  • meeting_watcher: GPUI application lifecycle, recognition ownership, meeting offers, and explicit handoff into capture.
  • instance: the exclusive Application Support lock that prevents concurrent command listeners.
  • feedback: bounded volume-controlled mode, capture, cancellation, and failure tones.

Read the full file on GitHub · 483 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 · 483 lines · 6,221 tokens per session scan B 913a2847504a

Subscribe to this mod's changes

hex AGENTS.md is an instructions file published in the GitHub repository anomalyco/hex (57 stars, last pushed 3d ago), licensed MIT. It adds 6,221 tokens to every session, about $0.0311 per session on Opus 5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.