mirror of
https://github.com/runbear-io/beardrive.git
synced 2026-08-25 08:08:08 +02:00
Field report follow-up: an agent with a stale skill copy couldn't find the gated URL after creating a file. Instructions rot; hook output is computed fresh from the binary every turn. Claude Code's turn-start pull hook now runs 'bdrive sync --hook claude-code', which: - pulls as before, and stamps the session note from the event JSON (replacing the sh/sed pipeline for the pull leg) - emits the project's gated-link formula as UserPromptSubmit additionalContext: whenever the agent mentions a synced file path in prose, it appends the hub link on an emoji — `<path>` [🔗](<url>) — path plain (it's the local path), hyperlink on the emoji only; code blocks stay plain; bdrive share stays explicit-opt-in-public Blind-tested: an agent given only the injected context decorated every path mention correctly, kept the code-block command plain, and checked files were synced before linking. - hooks install now CONVERGES marker-identified groups to the current shape (command/matcher/flags), so improvements reach existing projects on reinstall instead of being frozen by the idempotency marker; hermes same - plugin: UserPromptSubmit → beardrive-pull.sh (stdout passes through); version 0.3.0 - SKILL 'Share what you make' generalized to 'Link what you mention' (URL formula documented for non-Claude platforms); install.md pointer template updated Never fails the turn: every error path in --hook mode is a silent successful exit; offline still emits (links serve online teammates). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P5cxPQdSGJnjXCYY9GeWXt
12 lines
598 B
Bash
Executable File
12 lines
598 B
Bash
Executable File
#!/bin/sh
|
|
# Turn-start hook: pull the team's latest files and hand Claude the
|
|
# project's gated-link formula (hookSpecificOutput JSON on stdout), so any
|
|
# synced file path the agent mentions gets a hub link on a 🔗 — computed
|
|
# fresh from the binary each turn, immune to stale skill copies. `bdrive
|
|
# sync --hook` reads the event JSON from stdin itself (session note) and
|
|
# never fails the turn. Fast no-op outside beardrive projects.
|
|
cd "${CLAUDE_PROJECT_DIR:-.}" || exit 0
|
|
[ -d .bdrive ] || exit 0
|
|
command -v bdrive >/dev/null 2>&1 || exit 0
|
|
exec bdrive sync . --hook claude-code 2>/dev/null
|