claude-code/src/utils/userPromptKeywords.ts at 642c7f944bbe5f7e57c05d756ab7fa7c9c5035cc · chatgptprojects/claude-code
claude
| Source: Mastodon | Original article
A new commit to the open‑source Claude‑Code repository has introduced a profanity filter into the tool’s prompt‑processing pipeline. The change, made in the file `src/utils/userPromptKeywords.ts` at commit 642c7f944bbe5f7e57c05d756ab7fa7c9c5035cc, adds a regular expression—`negativePattern`—that matches a range of vulgarities and offensive phrases such as “wtf”, “omfg”, “shit”, “dumbass” and “what the hell”. When a user’s prompt contains any of these terms, Claude‑Code will now flag or reject the request before it reaches the underlying language model.
The move reflects a growing emphasis on safety and content moderation in AI‑assisted development tools. Claude‑Code, a community‑driven wrapper around Anthropic’s Claude model that focuses on code generation, has been praised for its flexibility but also scrutinised for occasional output that mirrors the tone of user inputs. By filtering out profanity at the prompt stage, the project aims to curb the propagation of hostile language, reduce the risk of model misuse, and align with emerging industry standards that demand responsible AI behaviour. The change also signals that even niche, developer‑centric AI projects are adopting the same safeguards that larger platforms have implemented.
Developers should watch how the filter is rolled out in the next release of Claude‑Code and whether the maintainers expand it to cover other forms of toxic content, such as hate speech or disallowed instructions. The community’s response—whether the regex is seen as over‑reaching or as a necessary step—will shape future moderation policies. Additionally, the update may prompt other open‑source AI toolkits to adopt similar safeguards, potentially leading to a broader convergence on baseline safety standards across the AI‑coding ecosystem.
Sources
Back to AIPULSEN