Skip to content

Bash redirect to /tmp/ triggers permission prompt despite allowed command pattern #85

@ikuwow

Description

@ikuwow

Problem

When a Bash command includes output redirection to /tmp/ (e.g., gh issue view ... > /tmp/file.md), Claude Code prompts for permission even though the command itself matches an allow rule (Bash(gh * view *)).

The permission prompt displays:

"Do you want to proceed?"
Option: "Yes, and always allow access to tmp/ from this project"

However, selecting "always allow access to tmp/" does not save a path-based permission. Instead, it saves a broader command pattern (e.g., Bash(gh issue:*)) to .claude/settings.local.json, which does not address the underlying /tmp/ access issue.

Current workaround

  • Added Write(//tmp/**), Edit(//tmp/**), Read(//tmp/**) to global settings.json (PR Add shell command rules, /tmp/ access, and language rule for Claude Code #84)
  • Added AIRULES rule to avoid chaining commands with && / ;, so that permission hooks and allow patterns match correctly
  • For Bash redirects specifically, the permission prompt may still appear — the Write tool should be used instead when possible

Related Claude Code issues

TODO

  • Monitor upstream Claude Code fixes for the permission pattern matching issues
  • Remove workarounds once the underlying issues are resolved
  • Consider adding an AIRULES rule to prefer Write tool over Bash redirects if the issue persists

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions