agentleFS
ChanMeng666ChanMeng666/echook/AGENTS.md

echook

AGENTS.md91 starsChanged 6 months agoMITView on GitHub

echook does two things for Claude Code, Cursor and Codex: (1) audio and out-of-band notification of editor lifecycle events (sound, spoken summary, desktop toast, webhook) and (2) the status line. Live truth for every subcommand, hook, config key, error code and env var is audio-hooks manifest; this file only holds what that JSON and the code cannot tell you.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    No human-interactive paths: No prompts, menus or "edit this file" instructions.

    line 8
  2. Very specific:

    Verify an install: audio-hooks status, audio-hooks diagnose, audio-hooks test all.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

echook — agent guide

echook does two things for Claude Code, Cursor and Codex: (1) audio and out-of-band notification of editor lifecycle events (sound, spoken summary, desktop toast, webhook) and (2) the status line. Live truth for every subcommand, hook, config key, error code and env var is audio-hooks manifest; this file only holds what that JSON and the code cannot tell you.

<critical> 1. **`audio-hooks` is the only interface.** JSON in, JSON out, stable error codes. Never hand-edit `user_preferences.json`; use `audio-hooks set <dotted.key> <value>`. 2. **Scope guard.** Anything that is neither a notification nor a status-line segment is out of scope by design (wellness, pomodoro/timers, gamification, opening URLs, side-commands). Decline and say why instead of implementing it. 3. **No human-interactive paths.** No prompts, menus or "edit this file" instructions. A step an agent cannot do (`/reload-plugins`) is emitted as machine-readable `next_steps`. 4. **After editing a canonical directory run `bash scripts/build-plugin.sh`.** CI runs `--check` and fails on drift. 5. **Work on a branch.** The marketplace installs `plugins/audio-hooks/` from `master`, so every push reaches users and `master` must stay releasable. 6. **Read the matching section of `docs/INVARIANTS.md` before changing an area listed below.** Each rule there cost an incident to learn. </critical>

Map

PathWhat it is
hooks/Runtime, flat modules. hook_runner.py is the entry: event tables, gating (enabled, snooze, filters, debounce), run_hook, main. runner_core.py owns shared state (preferences handle, NDJSON log, queue dir, invoker lookup). One concern each: audio_playback.py, desktop_notification.py, text_to_speech.py, webhook_dispatch.py, rate_limit_alerts.py, terminal_sequence.py, notification_context.py (wording, sanitising), platform_shell.py (PowerShell launch, untrusted text passed as base64 and never as script source, WSL). Call across modules as module.name(...), never from module import name. Also user_preferences.py (config load, migration, data-dir resolution) and invoker.py (which editor called).
bin/audio-hooks.py is the CLI entry: dispatch, config, state detection, small commands, manifest. Larger concerns are one module each in bin/echook_cli/ (legacy_uninstall, editor_installs, statusline, plugin_upgrade, config_backup, error_codes, …; its __init__.py lists them). Add a concern as a new module there, not to the entry file. Also the two status-line renderers and the launchers.
config/default_preferences.json (the template every install migrates toward), audio_manifest.json (prompt per sound file).
audio/default/, audio/custom/Voice theme and chime theme; one file per event and variant.
cursor-hooks/, codex-hooks/Install templates for those editors.
plugins/audio-hooks/The shipped plugin. Its audio, bin, config, cursor-hooks, codex-hooks directories and the Python files in its hooks directory are a build mirror — never edit. Hand-edited in place: plugins/audio-hooks/hooks/hooks.json (the Claude Code registration; no repo-root counterpart), plugins/audio-hooks/hooks/view-sensor.ts (the one mod, a sensor for the status line), runner, skills, evals, README.md and the two plugin manifests.
scripts/build-plugin.sh, bump-version.sh, generate-audio.py. The script installer was removed in 7.0.0; audio-hooks uninstall still removes an old script install.
tests/unittest suite; every module imports _isolation first.

Commands

  • Tests: python -m unittest discover tests (not pytest). CI: .github/workflows/smoke.yml, three OSes × Python 3.9/3.12/3.13.
  • Sync the mirror: bash scripts/build-plugin.sh (--check to verify). On Windows run it from Git Bash; in PowerShell bash can resolve to WSL.
  • Release: bash scripts/bump-version.sh <version>, then follow docs/RELEASING.md.
  • Verify an install: audio-hooks status, audio-hooks diagnose, audio-hooks test all.
  • Running the CLI from a checkout: set CLAUDE_PLUGIN_DATA to a scratch directory first, or it resolves the real install's data.
  • With a directory-source marketplace, every Claude Code session runs hooks from this checkout, on whatever branch it is on (docs/EVENT_BEHAVIOR_NOTES.md).

Before you change… read

Areadocs/INVARIANTS.md sectionGuard
hooks.json, a new event or matcherUpstream editor behaviour; Events, variants and soundstests/test_plugin_hooks_contract.py
The status line renderer, view-sensor.ts (and read docs/STATUS_LINE.md; a change to its output also means rebuilding the README pictures, docs/RELEASING.md)Upstream editor behaviourtests/test_statusline.py
A new variantEvents, variants and sounds (SYNTHETIC_VARIANT_DEFAULTS, VARIANT_INTRODUCED, a distinct sound in both themes)tests/test_variant_migration.py
run_hook order, escaping, notification dispatch, a runner moduleHook runnertests/test_filter_debounce_order.py, tests/test_desktop_notification.py, tests/test_runner_modules.py
A CLI subcommand or flagCLI contract (--help side-effect-free, unknown arguments are INVALID_USAGE, reporting commands are read-only, every code catalogued, every flag in the manifest)tests/test_read_only_commands.py, tests/test_cli_error_codes.py, tests/test_manifest_drift.py
Install / uninstalldocs/INSTALLATION_GUIDE.md; CLI contracttests/test_install_arg_safety.py, tests/test_uninstall_scripts_native.py
Config keys, migration, version stampsConfiguration and migration; CLI contract (every key in the manifest and manifest --schema)tests/test_migration.py, tests/test_bump_version.py, tests/test_manifest_drift.py
Cursor or Codex pathsUpstream editor behaviourtests/test_cursor_bridge.py, tests/test_codex_hooks.py
Anything under plugins/audio-hooks/Repository and release; docs/DIRECTORY_LISTING.mdtests/test_plugin_packaging.py
A new test moduleTeststests/test_isolation_guard.py
A user says audio fires too often, or stoppedstop does not mean "task complete"—
A security report, or any code that hands text to a shell (procedure: docs/RELEASING.md, "A security fix")Hook runnertests/test_desktop_notification.py (TestGeneratedScriptParses)

Other documents (open on demand)

  • docs/EVENT_BEHAVIOR_NOTES.md — what Claude Code's events actually do, measured. Read before trusting an event name.
  • docs/ARCHITECTURE.md — design decisions and the checklist for adding an event.
  • docs/STATUS_LINE.md — track 2. docs/TROUBLESHOOTING.md — symptoms whose cause is upstream.
  • docs/LIVE_TESTING.md — driving a real interactive session from a script. Use it before calling terminal behaviour verified.
  • docs/PROJECT_STATUS.md — what is waiting, unverified, or deliberately not done. Read before proposing work; update it in the same commit as anything it lists.
  • docs/RELEASING.md, docs/DIRECTORY_LISTING.md — release mechanics, and the record of the withdrawn directory submission with the rules a resubmission would bring back.
  • plugins/audio-hooks/skills/audio-hooks/SKILL.md — how to map a user's plain-language request to commands.
  • SECURITY.md — how reports arrive, the response promises, and the published advisories.
  • plugins/audio-hooks/README.md, PRIVACY.md — disclosures. Change them in the same commit as any change to what the plugin runs, sends or writes.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.