Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix: disallow JSON generation in Claude Code from running any tools #4062

ClosedDDeenis(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/4062/headopened View on GitHub

Closes #4061

What Changed

Removed --dangerously-skip-permissions from the Claude Code JSON generation path (for text models), replacing it with --tools "" to disallow calling any tools and editing files

Why

Short: --dangerously-skip-permissions allows the model to edit code instead of generating thread titles Long: #4061

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk Changes how every headless Claude CLI invocation is launched; misconfigured flags could break text generation or leave tools enabled on some CLI versions, but the intent is stricter safety than skip-permissions.

Overview Headless Claude text generation (thread titles, commit messages, PR content, etc.) no longer passes --dangerously-skip-permissions, which could let the model use tools and edit the workspace.

Spawn args now use deny-by-default restrictions: --permission-mode dontAsk, --strict-mcp-config, a long --disallowedTools list of built-ins, and --tools with an empty value (with comments noting older CLIs that ignored empty --tools).

Tests add fake-CLI validation for the empty --tools argument and a case that asserts the new flags are present and --dangerously-skip-permissions is absent.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ebb441efb9a3e7c479f9a86e9568da7ff24e67ab. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Disallow all tools in Claude Code headless text generation

  • Replaces --dangerously-skip-permissions with --permission-mode dontAsk, --strict-mcp-config, an explicit --disallowedTools denylist, and an empty --tools argument in ClaudeTextGeneration.ts.
  • The denylist covers built-in tools (e.g. Bash, WebFetch, WebSearch, Agent) for compatibility with older Claude CLI versions that ignore --tools.
  • Adds a test asserting the empty --tools argument is passed correctly via an extended fake Claude binary in ClaudeTextGeneration.test.ts.
  • Behavioral Change: text generation no longer runs with blanket --dangerously-skip-permissions; all tool invocations are now blocked by default.
Macroscope summarized ebb441e.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 356d6000-9c25-49e7-a32b-cab16aab0a00

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Needs human review

      This PR modifies security and permissions behavior by changing how Claude Code's text generation restricts tool access. While the change appears to be a security hardening (replacing --dangerously-skip-permissions with explicit tool denylists), changes to permissions and security-sensitive code paths warrant human review.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1a297f5c2dd68df389c581857f5e54c26a3ac1a9. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. closing in favor of #4169, the newer implementation with the same objective and exact production/test file set.

Sign in to join this conversation.