agents-reverse-engineer / hooks
AGENTS.md21 starsChanged 10 months agoMITView on GitHub
Runtime integration layer providing background update checks and context injection hooks for Claude Desktop and OpenCode editors. Claude/Gemini hooks ship as .mjs so Node always parses them as ES modules, regardless of any "type": "commonjs" in the nearest package.json (e.g. .claude/package.json written by get-shit-done). OpenCode plugins stay .js. Hooks execute as extension points in editor lifecycles: 1. SessionStart/session.created: are-check-update.mjs and opencode-are-check-update.js fire asynchronous npm version checks on session initialization 2. PostToolUse: are-context-loader.mjs intercepts file read operations, traverses directories upward to…
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/workflows/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- src/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/workflows/CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- src/CLAUDE.mdCLAUDE.md
- bumpSkill
- are-cleanSkill
- are-dashboardSkill
- are-discoverSkill
- are-generateSkill
- are-helpSkill
- are-implementSkill
- are-planSkill
- are-rebuildSkill
- are-specifySkill
- are-updateSkill
The file
Files
<!-- Generated by agents-reverse-engineer v1.2.8 -->hooks
Runtime integration layer providing background update checks and context injection hooks for Claude Desktop and OpenCode editors.
Contents
are-check-update.mjs
SessionStart hook that spawns detached child process via spawn(process.execPath, ['-e', inlineScript]) to check npm view agents-reverse-engineer version and cache results to ~/.claude/cache/are-update-check.json.
are-context-loader.mjs
PostToolUse hook (matcher Read|Edit|Write|MultiEdit|NotebookEdit|Bash|Agent|Task) that derives start directories from tool_input.file_path/notebook_path or scans them out of Bash command and Agent/Task prompt/description strings, walks each directory tree up to data.cwd, loads ARE-generated AGENTS.md files parent-first, and injects them as additionalContext with session-scoped deduplication via ${os.tmpdir()}/are-context-loader/${session_id}.json.
opencode-are-check-update.js
OpenCode plugin exporting AreCheckUpdate(ctx) factory triggering on session.created events, checks ~/.config/opencode/ARE-VERSION files, spawns background npm version check to ~/.config/opencode/cache/are-update-check.json.
Architecture
Claude/Gemini hooks ship as .mjs so Node always parses them as ES modules, regardless of any "type": "commonjs" in the nearest package.json (e.g. .claude/package.json written by get-shit-done). OpenCode plugins stay .js.
Hooks execute as extension points in editor lifecycles:
- SessionStart/session.created:
are-check-update.mjsandopencode-are-check-update.jsfire asynchronous npm version checks on session initialization - PostToolUse:
are-context-loader.mjsintercepts file read operations, traverses directories upward to inject relevant AGENTS.md documentation
File Relationships
are-check-update.mjstargets Claude Desktop SDK SessionStart event, reads.claude/ARE-VERSIONfilesopencode-are-check-update.jsimplements OpenCode plugin contract, reads.opencode/ARE-VERSIONand~/.config/opencode/ARE-VERSIONfilesare-context-loader.mjsdepends on PostToolUse event payloads containingdata.cwdplus eithertool_input.file_path/notebook_pathor scannabletool_input.command(Bash) /tool_input.prompt(Agent, Task) text
Both update checkers use identical cache format: {update_available: boolean, installed: string, latest: string, checked: number}.
Behavioral Contracts
Process spawning
spawn(process.execPath, ['-e', inlineScript], {
stdio: 'ignore',
detached: true,
windowsHide: true
})Version check command
execSync('npm view agents-reverse-engineer version', {timeout: 10000})AGENTS.md marker detection
content.includes("Generated by agents-reverse-engineer")Context output format
## ARE Context: {relDir}/AGENTS.md
{content}Hook response schema
{
"suppressOutput": false,
"hookSpecificOutput": {
"hookEventName": "PostToolUse",
"additionalContext": "string"
}
}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.

