跳到正文
DEV Community· Abdulrahman Masoud·· 2 小時前AI 評分62

Abdulrahman Masoud 為 Claude Code 開發 Comprende 插件,加入程式碼解釋與合併前檢查

I Made a Claude Code Plugin So You Never Merge Code You Don't Understand

AI 導讀

Abdulrahman Masoud 為 Claude Code 開發免費開源插件 Comprende,結合程式碼解釋和合併前理解檢查,協助開發者掌握自己提交的變更。

正文

AI can write a whole feature in minutes. You ask, it builds, the tests pass, and you click approve.

But here's the problem: a lot of us now merge code we can't really explain. And when it breaks at 2 AM, nobody on the team knows how it works.

I saw this happen again and again, so I built Comprende, a free and open-source plugin for Claude Code.

What does it do?

Comprende has two parts.

1. Explain as you build

While Claude writes code, it explains the important parts:

  • new APIs you might not know
  • tricky logic that isn't obvious
  • risky stuff, like security or data loss

It skips the boring parts, so you don't get a wall of text. It works for juniors and seniors: it looks at the code, not at your level. It also answers in your language.

You can control it with plain words:

  • "explain more" goes one level deeper
  • "I know this" explains less about that topic, from now on
  • "just build" stops explaining (but still warns you about risks)

It also remembers what you already know, so it won't explain the same thing twice. That memory stays on your machine.

2. The ownership gate (for teams)

Before you open a pull request, Claude asks you a few questions to make sure you understand your change. No answers, no merge.

Here's how a check goes:

  1. You say "check me", or Claude starts the check before a pull request.
  2. Claude asks 3 to 6 questions about your change. Small changes, like a typo fix, get just 1 question.
  3. The questions can't be answered from memory. For example: "What breaks if we remove the EXPIRE call?"
  4. If you get one wrong, Claude explains it and asks a different question.
  5. You write the pull request summary in your own words.
  6. Claude saves a report, and you commit it with your code.

If you skip the check:

  • Claude won't push your code
  • git won't push it either
  • CI blocks the merge

What the team lead sees

On every pull request, the lead sees a summary like this:

The developer's summary: Raised the API rate limit from 10 to 60 per minute because real users were getting blocked.

Verified understanding:

  • rateLimit.js: sliding window, window size vs limit
  • session.js 🔒: token expiry, why refresh is single-use

The lead never sees scores, wrong answers, or how many tries it took. The goal is ownership, not surveillance.

How to install

Inside Claude Code (you need Node.js 20+):

/plugin marketplace add AbdulrahmanMasoud/comprende
/plugin install comprende@comprende

That's it. Nothing to configure.

For teams: open Claude in your repo and say:

Enable the ownership gate in this repo.

Claude sets everything up and opens a pull request for you.

Honest limits

  • It's a process tool, not a security lock. Someone determined could still write a report by hand, but that shows up in git history under their name.
  • Local hooks can be skipped with --no-verify. CI and the GitHub ruleset can't.

Try it

It's free and open source (MIT):

👉 https://github.com/AbdulrahmanMasoud/comprende

I'd love your feedback. Would you use something like this with your team? Let me know in the comments!

來源:DEV Community · dev.to