Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

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.

  • Score 94
  • 8.3k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

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-hooks

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install autoresearch-hooks in Claude Code

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

A

No 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 →

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.

autoresearch-hooks Install

Add to stack

Loading.