Skip to content

hooks: auto-approve bd CLI commands for research-step#76

Merged
rodneykinney merged 1 commit into
mainfrom
init-bd-permissions
Jun 12, 2026
Merged

hooks: auto-approve bd CLI commands for research-step#76
rodneykinney merged 1 commit into
mainfrom
init-bd-permissions

Conversation

@rodneykinney

Copy link
Copy Markdown
Member

Summary

Auto-approve bd ... commands in the asta-preview plugin's PermissionRequest hook, mirroring the existing auto-approval of asta ... commands. Fixes the permission-prompt friction that the
html-linearization-reproduction-and-reflection feedback report
flagged: the research-step skill uses bd (beads) dozens of times per session — bd list, bd show, bd ready, bd create, bd close, bd dep add, bd update, … — and each one was triggering a prompt until the user ran /permissions to add Bash(bd:*).

The feedback report's literal suggestion was to have init hand off to a fewer-permission-prompts skill, but that skill isn't part of the asta-plugins distribution and may not be installed in every environment that loads asta-preview. The plugin hook is portable: anyone who loads asta-preview (via npx plugins add, the Claude Code marketplace, or --plugin-dir) gets the bd allowlist automatically, with no per-environment configuration.

Changes

  • plugins/asta-preview/hooks/approve-asta-bash.sh: add a bd ... branch alongside the existing asta ... branch.
  • plugins/asta/hooks/approve-asta-bash.sh: regenerated via make build-plugins.
  • tests/test_hooks.py: two new tests — one verifies bd ... invocations are approved, one verifies bd-prefix lookalikes (bdiff) are not matched.

Validation

This is a permission-prompt UX gap. Eval sandboxes auto-approve every tool call, so the asta_skills benchmark does not measure permission-prompt friction and cannot reproduce the baseline behavior. Validation is by:

  • Hook unit tests: 8 / 8 passing, including the two new cases above.
  • Lint + format-check: clean.
  • make check-plugins: plugins/asta is in sync with plugins/asta-preview.

The blast radius is bounded: the new branch only matches commands starting with bd (literal b, d, space), and the negative-lookalike test guards against bdiff / bd-something regressions. No research-step workflow steps were modified.

Out of scope

The same feedback report lists four other suggestions for research-step (less-static task chain, lighter experiment task type, scope-triggered replan, definitions schema feedback). They are not addressed here — the user asked for this one specifically.

The research-step skill uses `bd` (beads) dozens of times per session
across plan/execute/update-summary. The skill's SKILL.md frontmatter
declares `Bash(bd:*)` in allowed-tools, but in practice that has not
suppressed per-command permission prompts; users have had to manually
add `Bash(bd:*)` via /permissions to make the friction stop.

Approve `bd ...` invocations plugin-wide via approve-asta-bash.sh, the
same way `asta ...` invocations are already approved. `bd` is a tool
whose only purpose in this plugin is to back research-step.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rodneykinney rodneykinney force-pushed the init-bd-permissions branch from b557c39 to 1931d16 Compare June 12, 2026 20:39
@rodneykinney rodneykinney self-assigned this Jun 12, 2026
@rodneykinney

Copy link
Copy Markdown
Member Author

Manually refactored into 3 distinct hooks:

  • Approve any bd command
  • Approve any asta command
  • Approve any read/write operation on ./.asta or $HOME/.asta

@rodneykinney rodneykinney merged commit 3424f3f into main Jun 12, 2026
7 checks passed
@rodneykinney rodneykinney deleted the init-bd-permissions branch June 12, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant