• Will Chen's avatar
    Add python permission hook (#2312) · 446c953b
    Will Chen 提交于
    #skip-bb
    
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Add a Python permission hook that restricts python/python3 to scripts
    inside the .claude directory. Blocks unsafe modes and command injection
    to reduce risk.
    
    - **New Features**
    - Enforces: allow scripts under .claude; deny scripts outside; deny -m,
    -c, and interactive; passthrough for non-python and --version/--help.
    - Robust parsing of env-var prefixes, flags, quoted/unquoted paths,
    relative/absolute paths, and symlinks; supports CLAUDE_PROJECT_DIR.
    - Registered the hook in PreToolUse and expanded allowed tools in
    settings (Bash(chmod:*), Bash(python3:*)). Added tests for allowed,
    blocked, passthrough, and security-bypass commands.
    
    <sup>Written for commit 798d1abf04cdedc5395603ce4e32b2b943be8941.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    ---------
    Co-authored-by: 's avatarClaude <noreply@anthropic.com>
    446c953b
名称
最后提交
最后更新
..
commands/dyad 正在载入提交数据...
hooks 正在载入提交数据...
skills/multi-pr-review 正在载入提交数据...
settings.json 正在载入提交数据...