[Community] Bark: AI-powered permission hook — free alternative to Auto Mode

Resolved 💬 3 comments Opened Mar 26, 2026 by shaominngqing Closed Apr 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When running multiple Claude Code sessions in parallel, the constant permission prompts ("Can I read this file?", "Can I run ls?") create significant friction. Users have to constantly switch between terminals to click "Allow".

The current options have trade-offs:

  • Default mode: Asks permission for everything — constant interruptions
  • -y flag: Auto-allows file edits, but still prompts for every Bash command
  • --permission-mode auto: Rule-based classifier, but requires Team plan and uses static pattern matching
  • --dangerously-skip-permissions: Allows everything with zero safety

There's no middle ground for Free/Pro users who want intelligent, AI-powered permission management without paying for a Team plan.

Proposed Solution

I built Bark — a community hook that uses AI to assess every tool call's risk level. It leverages Claude Code's existing hooks system.

How Bark works:

  1. Layer 1 — Fast Rules: Deterministic checks. Read/Grep/Glob/file edits → instant allow (0ms)
  2. Layer 2 — Custom Rules: User-defined patterns in bark.conf (allow/notify/block)
  3. Layer 3 — Cache Lookup: Normalized command patterns with 24h TTL. Same pattern = 0ms
  4. Layer 4 — AI Assessment: Uses claude -p for semantic risk understanding. Result cached

Risk Levels:

  • Level 0 (Low): Silent allow — reads, builds, tests
  • Level 1 (Medium): System notification + auto allow — package installs, git push
  • Level 2 (High): Notification + sound + terminal confirmation — rm -rf, force push, DB drops

Key features:

  • Smart caching (24h TTL, repeated patterns = 0ms latency)
  • Custom rules via bark.conf
  • CLI tools: bark stats, bark log, bark cache, bark test <cmd>
  • macOS & Linux system notifications
  • One-line install: curl -fsSL https://raw.githubusercontent.com/shaominngqing/Bark/main/install.sh | bash

I'd love to see this kind of AI-powered permission assessment considered for the hooks ecosystem or even integrated into Claude Code's official plugin directory.

Alternative Solutions

  • --dangerously-skip-permissions: Works but removes all safety. Not recommended for production.
  • Auto Mode (Team plan): Good but not available to Free/Pro users, no caching, no custom rules, static pattern matching.
  • hookify plugin: Lets you create hooks to prevent unwanted behaviors, but doesn't provide intelligent risk assessment.
  • Manual approval: The default experience — functional but slow and disruptive.

Priority

Medium - Would be very helpful

Feature Category

Configuration and settings

Use Case Example

  1. I open 3 Claude Code sessions to work on different parts of a project
  2. I tell Claude: "fix the login bug and push the changes"
  3. Claude starts working — reads files, greps for functions, edits code
  4. Without Bark: Every Read, Grep, Edit triggers a permission prompt. I'm clicking "Allow" constantly
  5. With Bark: Read/Grep/Glob auto-allowed (0ms). File edits auto-allowed. When Claude runs git push, I get a macOS notification. When it tries git reset --hard HEAD~5, Bark blocks it and asks for confirmation
  6. I can actually go make coffee while Claude works ☕

Additional Context

  • GitHub repo: https://github.com/shaominngqing/bark-claude-code-hook
  • Demo video: Available in the repo README
  • License: MIT
  • Compatibility: Works with Claude Code's existing hooks system, no modifications needed
  • Design philosophy: No hardcoded Bash rules — AI understands command semantics better than regex. Cache ensures zero latency for repeated patterns.

I'm happy to adapt the project to better fit the Claude Code ecosystem, and I'd be glad to contribute it as an official community plugin if the team is interested.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗