YuanyuanMa03/cot-lint

给你的仓库做链式思维泄露检查——即AI助手在文档和注释中留下的会话记录残留。

Project Overview项目介绍

cot-lint is a linter that detects chain-of-thought leakage in repository prose, comments, and documentation, and ships a companion fixing skill called cot-trim. It flags content that only makes sense to someone who participated in the original authoring session, such as references to old PR discussions, dead design citations, and leftover planning notes. It works as an integrated plugin for DeepSeek Harness, can be manually added to Claude Code as a skill, and runs standalone on any repository or CI pipeline. To install it for DeepSeek Harness, run dsh plugin add cot-lint in your terminal. For standalone use, just run npx cot-lint to scan your repository, no local installation required beyond Node.js 20 or newer.

The typical workflow starts with a full repository scan to get a list of potential leakage points. You can add the --json flag to output machine-readable results for useful integration with CI or AI agents, the --ext flag to add extra file types like TypeScript or Python to scan line-by-line, and the --hidden flag to scan dot-directories like .agents/ that are normally skipped. This tool is designed for developers and teams that use AI coding assistants, as it helps keep documentation and comments clean, readable, and free of distracting leftover session content. It will not flag legitimate content like issue references, standard citations, or TODO comments that are still relevant.

cot-lint has no external dependencies beyond a supported Node.js version, and works on any operating system that can run Node.js 20 or newer. It has built-in support for both English and Chinese leakage patterns, and is released under the permissive MIT open source license, so you can use it freely for personal, commercial, or open source projects. You can add a cot-lint-ignore annotation to any line to suppress false positive findings, and the tool intentionally exempts common legitimate content like RFC references and TODO comments. First-run users can install the plugin to DeepSeek Harness to try the automatic fixing feature right away.

cot-lint 是一个用于检测代码仓库中思维链泄露问题的 linter 工具,同时提供了名为 cot-trim 的修复技能插件。它可以检测文档、注释、JSDoc 中残留的 AI 助手会话记录,这类引用和叙述只有参与过编写会话的人员才能理解,对后续读者只会造成干扰。该工具支持作为原生插件安装到 DeepSeek Harness 中,也支持 Claude Code 等其他常见的 AI 代理工具,还可以独立运行在任意 CI 流程中。

典型工作流中,开发者可以先运行 npx cot-lint 扫描仓库,获取所有思维链泄露点,也可以添加 --json 参数输出机器可读结果供 CI 或代理工具使用,添加 --ext 参数指定扫描额外的源代码文件,添加 --hidden 参数进入 .agents/ 这类点目录扫描。该工具适合日常使用 AI 辅助开发的团队和个人,能够帮助维护仓库文档和注释的整洁度,提升整体的代码可读性和可维护性。

该工具无额外依赖,仅需要 Node.js 20 及以上版本即可运行,支持中英文两种语言,使用 MIT 许可证开源,可免费用于商业和非商业项目。它不会误标记常见的标准引用、TODO 等有效内容,支持通过 cot-lint-ignore 标记忽略特定行,首次使用可以通过 dsh plugin add 命令安装到 DeepSeek Harness 方便体验自动修复功能。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin add cot-lint

把 YuanyuanMa03/cot-lint 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

cot-lint

English | 中文

Lint your repo for chain-of-thought leakage — the session-transcript residue AI assistants leave in docs, comments, and JSDoc.

Your coding agent writes great code and leaks its thinking everywhere around it:

- // This PR adds a retry loop (decision 7) so the diff stays reviewable.
- // The manager used to serialize writes itself; it no longer does after v1.
- // The cast is safe — it simply narrows the union. Probably fine for now.
+ // Retries transient provider failures up to 3 times with jittered backoff.
+ // The shared coordinator serializes writes per session.
+ // The cast narrows a union already validated at the loader boundary.

None of the left column is wrong about the code. It is wrong about its reader: it argues with a reviewer who has left, cites a design session nobody can open, and narrates a change instead of stating behavior.

The one test

Could a reader at HEAD — with no access to any session transcript, PR thread, or uncommitted draft — resolve every reference and verify every claim?

If no, that passage is chain-of-thought leakage. cot-lint finds it.

Quick start

DeepSeek Harness — install the cot-trim fixing skill as a plugin:

dsh plugin add cot-lint

Any repo or CI — zero dependencies, Node ≥ 20:

npx cot-lint                 # scan the repo (Markdown and prose files)
npx cot-lint --json          # machine-readable findings for CI or agents
npx cot-lint --ext ts,py     # also scan source files line-by-line
npx cot-lint --hidden        # descend into dot-directories such as .agents/

Exit codes: 0 clean · 1 findings · 2 usage error — drop it straight into CI.

What it detects

Class Example
dead design-session citation (decision 7), design §4.7, phase tokens W3/T4, 设计稿
stack/PR vantage "this PR adds…", "a later PR in this stack"
change narration / version stamps "used to", "no longer", "the old X", "the v1 refactor", "today", 旧版/不再
review choreography "Rejected in review:", "the reviewer confirmed", 上一轮评审
reviewer-addressed justification "the cast is safe — it simply…"
control-flow narration "first we X, then we Y", "as you can see"
hedge / planning residue "probably fine for now", "should be enough"
authoring-language slip untranslated working-language fragments in the other language

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-web-service-manager 下一个 Next dsh-bun-compat-patch →