Skip to main content
rule CX Codex

no-debug-statements — Claude Code rule: what it does, how to install

The no-debug-statements rule flags debugging calls for removal before a commit in JavaScript, TypeScript, Python, Go, and Rust files. Use it during a pre-commit review.

MIT ★ 2,966 updated 2026-09-29

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/no-debug-statements.mdc
Open on GitHub

What no-debug-statements does

Before a commit, the rule asks the agent to remove debugging calls such as console.log() and debugger in JavaScript or TypeScript, print() and breakpoint() in Python, and their Go and Rust counterparts. It targets files matching **/*.{ts,tsx,js,jsx,py,go,rs}. The alwaysApply setting is false, so it does not run on every interaction.

Logging through frameworks such as winston, pino, or Python’s logging module is allowed. Keep that distinction in mind: the rule targets debugging output, not application logs. To add it to Claude Code, register the marketplace, install pro-workflow, then place the rule at .claude/rules/no-debug-statements.md.

What it helps with

  • remove console.log() and debugger before committing
  • clean temporary print() calls from Python files
  • check Go and Rust code for debugging output
  • preserve logs written through logging frameworks

Example prompts for the agent

  • Review the changes before committing and remove debugging calls while keeping normal application logs.
  • Find temporary Python debugging calls in the changed files and remove them.
  • Check the Go and Rust code for debugging output before the commit.

How to install no-debug-statements

Manually: put the files in place

.cursor/rules/no-debug-statements.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about no-debug-statements

How do I install no-debug-statements in Claude Code?

Run /plugin marketplace add rohitg00/pro-workflow, then /plugin install pro-workflow@pro-workflow. Put the rule file at .claude/rules/no-debug-statements.md.

What does no-debug-statements do?

It asks the agent to remove debugging calls before a commit in JavaScript, TypeScript, Python, Go, and Rust. The rule applies to files matching its configured pattern.

Does the rule remove logs from winston or pino?

No. Logging through winston, pino, or Python’s logging module is allowed.

Source text

no-debug-statements.mdc · MIT
---
description: Remove debug statements before committing - console.log, print, debugger
globs: "**/*.{ts,tsx,js,jsx,py,go,rs}"
alwaysApply: false
---

Remove all debug statements before committing:
- JavaScript/TypeScript: `console.log()`, `console.debug()`, `console.info()`, `debugger`
- Python: `print()`, `breakpoint()`, `pdb.set_trace()`
- Go: `fmt.Println()` used for debugging
- Rust: `dbg!()`, `println!()` used for debugging

Exceptions: Legitimate logging using a logging framework (winston, pino, logging module) is fine.

© Rohit Ghumare · MIT · rohitg00/pro-workflow

Similar IDE rules

All IDE rules for Code review and refactoring →

From the same set83

The whole set →
quality-gates quality-gates — a Claude rule that makes the agent lint and typecheck before a commit, then sweep the staged diff for debug lines and hardcoded keys. CX Codex +1 ★ 2,966repo stars atomic-commits Enforces Git best practices: atomic commits in Conventional Commits format, mandatory feature branches, and selective file staging. CX Codex +1 ★ 2,966repo stars cost-tracker cost-tracker is a Claude Code command that estimates current-session spend, identifies its main cost drivers, and suggests optimizations. Compare the estimate with a task budget. CX Codex +1 ★ 2,966repo stars self-correction self-correction turns a correction into a one-line [LEARN] rule with a category, and saves it only once you approve the wording. CX Codex +1 ★ 2,966repo stars mcp-audit Audits active MCP servers, estimates token overhead from tool schemas, and flags unused integrations to disable. CX Codex +1 ★ 2,966repo stars auto-setup auto-setup detects a project’s stack and configures quality gates, permission rules, and hooks. Useful when bringing a new codebase into Claude Code. CX Codex +1 ★ 2,966repo stars compact-guard compact-guard is a Claude Code command that saves working state before context compaction and restores critical data afterward. Run it before manual compaction or when auto-compaction warnings appear. CX Codex +1 ★ 2,966repo stars wrap-up wrap-up audits git diffs, runs test suites, records lessons learned, and prepares context before closing a Claude Code session. CX Codex +1 ★ 2,966repo stars

More in the catalog

Project sponsors

Companies that keep this analytics open