autoresearch-hooks
Skill by davebcn87
Writes pre and post iteration hook scripts for an autoresearch session. Adds research fetching, notifications, learnings journals, auto-tagging and anti-thrash steering around each loop iteration.
Install autoresearch-hooks
Built from the published package, never by AI.
git clone --depth 1 https://github.com/davebcn87/pi-autoresearch /tmp/pi-autoresearch && mkdir -p ~/.claude/skills && cp -r /tmp/pi-autoresearch/skills/autoresearch-hooks ~/.claude/skills/autoresearch-hooksRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/davebcn87/pi-autoresearch /tmp/pi-autoresearch && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/pi-autoresearch/skills/autoresearch-hooks ~/.gemini/antigravity-cli/skills/autoresearch-hooksAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
autoresearch-hooks is an agent skill for adding optional scripts that run at iteration boundaries in an autoresearch session. It defines two hooks: .auto/hooks/before.sh fires before each iteration, and .auto/hooks/after.sh fires after each logged experiment. Each hook reads one JSON line on stdin, and its stdout is delivered to the agent as a steer message on the next turn.
The skill includes runnable example scripts for external search, qmd document search, anti-thrash intervention, idea rotation, learnings journals, macOS notifications on new bests, and auto-tagging winning commits. It is aimed at users who want side effects such as research fetching or Slack and webhook notifications around an autoresearch loop. Hook output is limited to 8 KB, and scripts are killed after 30 seconds.
Written from the project's SKILL.md and checked against it.
What it can do
- before.sh hookRuns before each iteration and can fetch research or steer the agent.
- after.sh hookRuns after each logged experiment for retrospective work such as journaling.
- External search examplePattern for adding external search results before an iteration.
- Anti-thrash examplePattern for intervening when the loop repeats unproductive attempts.
- Idea rotator examplePattern for rotating the next idea between iterations.
- Learnings journal examplePattern for persisting learnings after each experiment.
- macOS notification examplePattern for sending a notification when a new best is kept.
- Auto-tag examplePattern for tagging winning commits automatically.
- Piped mock testingSanity-tests a hook with a mock JSON input before using it in the loop.
What you need
- jq, used to parse the JSON input on stdin
- An autoresearch session with a .auto directory
- Hook files marked executable
Try asking
- Add a Slack notification when a new best metric is kept
- Set up an anti-thrash hook for my autoresearch session
- Write an after hook that keeps a learnings journal
Good to know
- Hook stdout is capped at 8 KB
- Hooks are hard killed after 30 seconds
- Files without the executable bit are silently ignored
- Hooks cannot use environment variables; all input comes through stdin
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/autoresearch-hooks/SKILL.md, skills/autoresearch-hooks/examples/after/auto-tag-winners.sh, skills/autoresearch-hooks/examples/after/learnings-journal.sh, skills/autoresearch-hooks/examples/after/macos-notify.sh, skills/autoresearch-hooks/examples/before/anti-thrash.sh, skills/autoresearch-hooks/examples/before/context-rotation.sh, skills/autoresearch-hooks/examples/before/external-search.sh, skills/autoresearch-hooks/examples/before/hypothesis-reflection.sh, skills/autoresearch-hooks/examples/before/idea-rotator.sh. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md7 KB -
examples/README.md3 KB -
examples/after/auto-tag-winners.sh870 B -
examples/after/learnings-journal.sh887 B -
examples/after/macos-notify.sh944 B
Show all 11 files
-
examples/before/anti-thrash.sh1 KB -
examples/before/context-rotation.sh819 B -
examples/before/external-search.sh890 B -
examples/before/hypothesis-reflection.sh848 B -
examples/before/idea-rotator.sh769 B -
examples/before/qmd-search.sh1 KB
Alternatives to autoresearch-hooks
All alternatives →Aligns a Qwen Code feature with a Codex or Claude Code reference agent. It runs both under the same scenario, captures HTTP and terminal traces, and compares them until behavior matches.
Searches, views, creates, updates, and deletes the user's Google Contacts from an AI assistant. It is for people who want to manage their address book through conversation. A one-time Google connect is required before it returns data.
Guides an AI assistant on error handling choices. It covers when to use Result, Option, ? propagation, unwrap, expect and panic, plus anyhow and thiserror.
Caveman is an agent skill that makes an AI assistant reply in a terse style. It cuts filler and keeps technical facts, code, commands and errors exact. It is built for users who want shorter, cheaper replies.
docs-sync audits or updates English SDK documentation against the requested implementation scope. It is for maintainers who want docs to match main branch features, configuration options, and defaults.
Guides an AI assistant through setting up and running monorepos with pnpm workspaces, Turborepo and Nx. Aimed at developers who need faster builds, shared code and managed dependencies across multiple packages.
Compare with agent-reproduce-align, google_contacts or m06-error-handling
autoresearch-hooks: common questions
Will hook files affect my code branches?
No. The .auto/** directory is excluded through .git/info/exclude, so code branches stay clean and .auto/ survives checkouts and manual reverts.
How does the agent see what a hook prints?
Stdout is delivered to the agent as a steer message on the next turn, and empty output means no steer. Stderr or a non-zero exit is surfaced as an error steer.
Can hook scripts read environment variables?
No. Everything comes in on stdin as JSON, and the source states there is no $AUTORESEARCH_WORK_DIR variable.
How do I install autoresearch-hooks?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is autoresearch-hooks free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is autoresearch-hooks safe to use?
It scores 94 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to autoresearch-hooks?
Similar skills: agent-reproduce-align, google_contacts, m06-error-handling, caveman.
