claude-code - 💡(How to fix) Fix Auto mode classifier should block `--break-system-packages` by default [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48992Fetched 2026-04-17 08:53:50
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2cross-referenced ×1subscribed ×1

Root Cause

  • --break-system-packages exists because PEP 668 / OS maintainers decided this action is dangerous enough to require an explicit opt-in. If the OS itself gates it behind a safety flag, auto mode should treat bypassing that gate as a destructive action.
  • Modifies shared system state — the system Python is used by brew, macOS tools, and other scripts
  • Hard to reverse — transitive dependency version changes aren't tracked for rollback; pip uninstall doesn't restore previous versions of indirect deps
  • Meets auto mode's own documented criteria for blocking: "hard to reverse, affects shared systems beyond your local environment"

Code Example

pip3 install pyarrow pandas --quiet --break-system-packages
pip3 install news-please --quiet --break-system-packages
pip3 install news-please==1.6.13 --quiet --break-system-packages
RAW_BUFFERClick to expand / collapse

What happened

Claude Code running with --enable-auto-mode, no custom deny rules or CLAUDE.md instructions about pip/venv at the time. Claude autonomously ran:

pip3 install pyarrow pandas --quiet --break-system-packages
pip3 install news-please --quiet --break-system-packages
pip3 install news-please==1.6.13 --quiet --break-system-packages

All three were auto-approved by the classifier with no confirmation prompt.

  • news-please pulled heavy transitive dependencies (newspaper4k, lxml, nltk, Pillow, beautifulsoup4, etc.)
  • A package downgrade was also performed (1.6.16 → 1.6.13)
  • --quiet was used on all three commands, suppressing installation output and reducing user visibility

Why the classifier should have caught this

  • --break-system-packages exists because PEP 668 / OS maintainers decided this action is dangerous enough to require an explicit opt-in. If the OS itself gates it behind a safety flag, auto mode should treat bypassing that gate as a destructive action.
  • Modifies shared system state — the system Python is used by brew, macOS tools, and other scripts
  • Hard to reverse — transitive dependency version changes aren't tracked for rollback; pip uninstall doesn't restore previous versions of indirect deps
  • Meets auto mode's own documented criteria for blocking: "hard to reverse, affects shared systems beyond your local environment"

Aggravating factor

--quiet was also used alongside --break-system-packages, suppressing pip's installation output. The combination of a destructive flag + suppressed output should be an even stronger signal to block.

Ask

Add --break-system-packages (and possibly sudo pip) to the default block list for auto mode's classifier. Users shouldn't have to get burned first and then write custom deny rules for commands that bypass OS-level safety protections.

extent analysis

TL;DR

Add --break-system-packages to the default block list for auto mode's classifier to prevent potentially destructive package installations.

Guidance

  • Review the classifier's current rules and configuration to understand why --break-system-packages was not blocked initially.
  • Consider adding sudo pip to the block list as well, as it can also pose a risk to system stability.
  • Evaluate the impact of transitive dependencies on system state and explore ways to track or mitigate version changes.
  • Assess the effectiveness of the --quiet flag in suppressing installation output and its potential to mask important warnings or errors.

Example

No code snippet is provided as the issue focuses on configuration and policy changes rather than code modifications.

Notes

The solution may require updates to the classifier's configuration or the auto mode's default block list. It is essential to test and validate these changes to ensure they do not introduce unintended consequences.

Recommendation

Apply a workaround by adding --break-system-packages to the default block list for auto mode's classifier, as this will help prevent potentially destructive package installations and align with OS-level safety protections.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING