dotfiles / hammerspoon
AGENTS.md16 starsChanged 4 months agoMITView on GitHub
All Spoons loaded in init.lua before scripts are required
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository105 other files it gives its agents.
- ableton/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- aichat/AGENTS.mdAGENTS.md
- aider/AGENTS.mdAGENTS.md
- annepro2/AGENTS.mdAGENTS.md
- atuin/AGENTS.mdAGENTS.md
- btop/AGENTS.mdAGENTS.md
- chromium-vimium-extension/AGENTS.mdAGENTS.md
- claude-code/AGENTS.mdAGENTS.md
- codex/AGENTS.mdAGENTS.md
- contextMenu/AGENTS.mdAGENTS.md
- cron/AGENTS.mdAGENTS.md
- crush/AGENTS.mdAGENTS.md
- docker/AGENTS.mdAGENTS.md
- docker-logger/AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- eqmac/AGENTS.mdAGENTS.md
- eza/AGENTS.mdAGENTS.md
- firefox-vimium-addon/AGENTS.mdAGENTS.md
- fork/AGENTS.mdAGENTS.md
- hermes/AGENTS.mdAGENTS.md
- heroic/AGENTS.mdAGENTS.md
- homebrew/AGENTS.mdAGENTS.md
- iina/AGENTS.mdAGENTS.md
- immich/AGENTS.mdAGENTS.md
- install/AGENTS.mdAGENTS.md
- iterm/AGENTS.mdAGENTS.md
- karabiner/AGENTS.mdAGENTS.md
- keyboard-layout/AGENTS.mdAGENTS.md
- lazydocker/AGENTS.mdAGENTS.md
- lazygit/AGENTS.mdAGENTS.md
- litellm/AGENTS.mdAGENTS.md
- macos/AGENTS.mdAGENTS.md
- macos_cleanup/AGENTS.mdAGENTS.md
- macos_update/AGENTS.mdAGENTS.md
- marta/AGENTS.mdAGENTS.md
- mistral-vibe/AGENTS.mdAGENTS.md
- noti/AGENTS.mdAGENTS.md
- npm/AGENTS.mdAGENTS.md
- opencode/AGENTS.mdAGENTS.md
- python/AGENTS.mdAGENTS.md
- qdrant/AGENTS.mdAGENTS.md
- qwen-code/AGENTS.mdAGENTS.md
- rag/AGENTS.mdAGENTS.md
- rtk/AGENTS.mdAGENTS.md
- tmux/AGENTS.mdAGENTS.md
- uv/AGENTS.mdAGENTS.md
- voiceink/AGENTS.mdAGENTS.md
- vscode/AGENTS.mdAGENTS.md
- xcode/AGENTS.mdAGENTS.md
- zap/AGENTS.mdAGENTS.md
- zsh/AGENTS.mdAGENTS.md
- ableton/CLAUDE.mdCLAUDE.md
- aichat/CLAUDE.mdCLAUDE.md
- aider/CLAUDE.mdCLAUDE.md
- annepro2/CLAUDE.mdCLAUDE.md
- atuin/CLAUDE.mdCLAUDE.md
- btop/CLAUDE.mdCLAUDE.md
- chromium-vimium-extension/CLAUDE.mdCLAUDE.md
- claude-code/CLAUDE.mdCLAUDE.md
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
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
- Distinctive: line 12
All Spoons loaded in init.lua before scripts are required
- Very specific: line 21
Check bundleID() not app name
- Distinctive: line 23
Add 50ms delay before switching to avoid race conditions
- Very specific: line 40
Check console for errors: open -a "Hammerspoon Console"
- Distinctive: line 45
Don't modify Spoon files without checking their init.lua
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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.
Files
Hammerspoon Configuration Rules
Structure
- init.lua: Main entry point - loads all Spoons and requires scripts
- Spoons/: Custom functionality modules (*.spoon directories)
- Scripts:
config_UrlDispatcher.lua,set_language_on_app_focused.lua,reload_hammerspoon_on_script_changed.lua
Spoon Loading Pattern
hs.loadSpoon("SpoonName") -- Loads from Spoons/SpoonName.spoon/All Spoons loaded in init.lua before scripts are required
Auto-Switching Features
- Language per app: Forkgram/Telegram/AyuGram → Russian, Games → ABC, Everything else → English
- Karabiner profiles: Games use "Empty" profile (disables shortcuts), others use "Default"
- URL routing: Work domains open in Safari, everything else in Yandex
Application Watcher Pattern
Uses hs.application.watcher to detect app focus changes:
- Check
bundleID()not app name - Get bundle ID:
osascript -e 'id of app "AppName"' - Add 50ms delay before switching to avoid race conditions
Installed Spoons
- AudioSwitcher
- BrowserTabOpener
- GruvboxWallpapers
- HotKeys
- KSheet
- PopupTranslateSelection
- URLDispatcher
- Windows
- YouTrackTasks
- YouTrackTicket
- YouTubeStream
Critical Rules
- Always reload after changes:
hs -c "hs.reload()" - Check console for errors:
open -a "Hammerspoon Console" - Spoon names are case-sensitive
- Scripts in root use
require, Spoons usehs.loadSpoon()
Anti-Patterns
- Don't modify Spoon files without checking their init.lua
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
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.

