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
.cursor/rules/no-debug-statements.mdcWhat 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()anddebuggerbefore 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.mdcFrontmatter: description, globs, alwaysApply
1Plugin marketplace
/plugin marketplace add rohitg00/pro-workflow/plugin install pro-workflow@pro-workflow2Manually: put the files in place
.claude/rules/no-debug-statements.mdThe paths frontmatter field limits the files: move globs from the source into paths
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.github/instructions/no-debug-statements.instructions.mdThe applyTo field sets which files it applies to: move globs from the source into applyTo
Manually: put the files in place
.devin/rules/no-debug-statements.mdManually: put the files in place
.clinerules/no-debug-statements.mdStep 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