@dlhck/strip-clanker-attribution

中文文档
1.0.1发布于 2026/08/21MITES Module零依赖构建来源已验证近 30 天下载 6752

Strip Cursor, Claude, and Codex attribution from commit messages. Built for husky commit-msg hooks.

原始使用文档
文档目录7 节
  1. Install
  2. Usage with husky
  3. CLI
  4. Programmatic use
  5. Requirements
  6. Releasing
  7. License

strip-clanker-attribution

Strip Cursor, Claude, and Codex attribution from commit messages. Built for husky commit-msg hooks.

Coding agents like to sign their work. This tool removes that signature before the commit lands, so your history stays clean and commitlint never chokes on a trailer it doesn't expect.

It removes:

  • Agent co-author trailers, for example Co-authored-by: Cursor <[email protected]> or Co-Authored-By: Claude Sonnet 4.6 <[email protected]>. Human co-authors stay.
  • Attribution trailers such as Made-with: Cursor, Generated-by: Claude Code, and Codex-Session-Id: ses_123.
  • Signature lines like 🤖 Generated with [Claude Code](https://claude.com/claude-code).

It keeps everything else, including body text that merely mentions these tools.

Install

npm install --save-dev @dlhck/strip-clanker-attribution

Usage with husky

The package only ships the stripping script. Your repo's husky setup stays in charge of the hooks. If husky is already set up, wire it in from the repo root:

npx strip-clanker-attribution-init

This puts npx strip-clanker-attribution "$1" at the top of .husky/commit-msg, before commitlint or anything else that reads the message. Running it twice changes nothing. Without a .husky directory it stops and tells you to run npx husky init first.

Or add the line by hand:

npx strip-clanker-attribution "$1"
bunx commitlint --edit "$1"

The hook rewrites the commit message file in place, so anything after it sees the cleaned message. This works for git commit, git merge, git revert, and any other command that fires the commit-msg hook.

CLI

strip-clanker-attribution <commit-msg-file>

Rewrites the file in place. Exits non-zero if no file is given.

Programmatic use

import { stripAiCommitAttribution } from '@dlhck/strip-clanker-attribution';

const clean = stripAiCommitAttribution(rawCommitMessage);

The function takes the full commit message as a string and returns it without the attribution lines. It preserves the original line endings and collapses the blank lines the removals leave behind.

Requirements

Node.js 18 or later. No dependencies.

Releasing

Releases are tag-driven and published with npm trusted publishing (OIDC). No npm token is stored anywhere. One-time setup: on npmjs.com, open the package settings and add GitHub Actions as a trusted publisher for this repository with the release.yml workflow.

Then, from a clean main:

npm run release:patch   # or release:minor / release:major

This runs the tests, bumps the version, commits, tags vX.Y.Z, and pushes. The release workflow verifies the tag matches package.json, publishes to npm with provenance, and creates the GitHub release.

License

MIT

版本与发布记录

@dlhck/strip-clanker-attribution 共发布 2 个版本,首次发布于 2026/08/21;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.0.1latest2026/08/212 个月前
1.0.02026/08/212 个月前

关于 @dlhck/strip-clanker-attribution 的常见问题

@dlhck/strip-clanker-attribution 是什么?

Strip Cursor, Claude, and Codex attribution from commit messages. Built for husky commit-msg hooks.

如何安装 @dlhck/strip-clanker-attribution?

在项目目录运行 npm install @dlhck/strip-clanker-attribution,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 strip-clanker-attribution、strip-clanker-attribution-init,可以用 npx strip-clanker-attribution 直接运行。

@dlhck/strip-clanker-attribution 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/dlhck__strip-clanker-attribution 是否存在。

@dlhck/strip-clanker-attribution 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dlhck/strip-clanker-attribution 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dlhck/strip-clanker-attribution 可以商用吗?

@dlhck/strip-clanker-attribution 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dlhck/strip-clanker-attribution 的下载量有多少?

根据 npm 官方下载统计,@dlhck/strip-clanker-attribution 在 2026/10/13 – 2026/11/11 这 30 天内被下载 6,752 次,日均约 225 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dlhck/strip-clanker-attribution 还在维护吗?

最新版本 1.0.1 发布于 2026/08/21(2 个月前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/08/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。