claude-code - 💡(How to fix) Fix [MODEL] /audit in Anthropic Tutorial custom command lacks guardrails for breaking changes — causes excessive token usage [1 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#52574Fetched 2026-04-24 06:03:31
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Code Example



---

https://claude.ai/code — conversation not shareable, but the issue is reproducible on any project where   npm audit returns breaking changes. The /audit demo made claude go down an npm rabbit hole. Not my command or tutorial. It wasted 5 mins and 4500 tokens


Add to the /audit command prompt: "Do not investigate or attempt to fix breaking changes.    
   Report remaining vulnerabilities and move on."
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues for similar behavior reports
  • This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

Body:
Following tutorial 303239 (Claude Code in Action), the /audit command triggered npm audit which flagged
vulnerabilities requiring breaking dependency upgrades. Claude escalated into researching package
compatibility, reading source files, and investigating migration paths instead of staying within the 3-step script. Result: ~4500 tokens used on a tutorial step that should take ~200.

Fix: Add one line to the command prompt: "Do not investigate or attempt to fix breaking changes. Report
remaining vulnerabilities and move on."

What Claude Actually Did

▎ - Ignored the 3-step script, investigated breaking dependency upgrades across multiple packages, read source ▎ files, checked npm registry for compatible versions, attempted a major AI SDK version upgrade, and fetched ▎ an external URL — all unsolicited.

Expected Behavior

Run npm audit, run npm audit fix, run tests, report output. Done

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Haven't tried to reproduce

Steps to Reproduce

  1. Follow tutorial 303239 on https://anthropic.skilljar.com/claude-code-in-action/303239 Custom Commands step in tutorial
    ▎ 2. Open the tutorial project with npm dependencies
    ▎ 3. Enable auto-accept edits
    ▎ 4. Run /audit as instructed ▎ 5. Observe Claude escalate beyond the 3-step script when npm audit flags vulnerabilities requiring breaking ▎ dependency upgrades

Claude Model

Sonnet

Relevant Conversation

https://claude.ai/code — conversation not shareable, but the issue is reproducible on any project where   npm audit returns breaking changes. The /audit demo made claude go down an npm rabbit hole. Not my command or tutorial. It wasted 5 mins and 4500 tokens


Add to the /audit command prompt: "Do not investigate or attempt to fix breaking changes.    
  ▎ Report remaining vulnerabilities and move on."

Impact

High - Significant unwanted changes

Claude Code Version

claude-sonnet-4-6

Platform

Anthropic API

Additional Context

Add to the /audit command prompt: "Do not investigate or attempt to fix breaking changes.
▎ Report remaining vulnerabilities and move on."

extent analysis

TL;DR

Modify the /audit command prompt to include "Do not investigate or attempt to fix breaking changes. Report remaining vulnerabilities and move on."

Guidance

  • Add the specified text to the /audit command prompt to prevent Claude from escalating beyond the intended 3-step script.
  • Verify that Claude now only runs npm audit, npm audit fix, and reports output without investigating breaking changes.
  • Test this modification with the tutorial project and Accept Edits enabled to ensure the desired behavior.
  • Consider reproducing the issue to confirm the effectiveness of the proposed fix.

Example

No code snippet is necessary, as the fix involves modifying a command prompt.

Notes

The provided fix is based on the user's own suggestion, which may not be comprehensive or applicable in all scenarios. Further testing and validation are recommended.

Recommendation

Apply workaround: Add the specified text to the /audit command prompt, as it directly addresses the reported issue and prevents unwanted changes.

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

claude-code - 💡(How to fix) Fix [MODEL] /audit in Anthropic Tutorial custom command lacks guardrails for breaking changes — causes excessive token usage [1 comments, 2 participants]