Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Run automatically on Claude Code events. Claude doesn't decide.
1 caution to review before installing
A hook runs when Claude uses the Bash tool
Static checks of hooks, mods, MCP servers and commands. Not a security audit.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Bashツール経由の素のrmコマンドをtrashへ自動的に書き換えるClaude Codeプラグインです。
ユーザー側のグローバル設定でrmがdenyされている前提で、
リトライ往復を削減するための補助動作として動作します。
このプラグインをインストールする前に、 ncaq/konokaマーケットプレイスをClaude Codeに追加してください。
Claude Codeで以下を実行します。
/plugin install rm-to-trash@konoka
または.claude/settings.jsonに追加します。
{
"enabledPlugins": {
"rm-to-trash@konoka": true
}
}
PreToolUseフックでBashツールのコマンドを監視し、
rm <ファイル>をtrashへ自動的に書き換えてから実行します。
trash-cliはrm互換のために-r/-R/-f/-d/-i/-vと、
その長形式(--recursive/--force/--directory/--interactive/--verbose)を受理するため、
これらの互換フラグだけが付いたrmも書き換えます。
trash-cliが受理しないフラグ(-I, --one-file-system, --no-preserve-rootなど)が含まれる場合は、
書き換えると挙動が変わってしまうため書き換えずに通常の承認フロー(deny含む)に任せます。
git rmはgit trashサブコマンドが存在せず書き換えると単に動作しなくなるため、
git rmを含むコマンドも書き換え対象から除外します。
git rm自体を禁止したい場合はユーザ側のsettings.json等のdeny設定で制御してください。
フック本体はRustバイナリrm-to-trashです。
Bashツール毎に呼ばれるため起動コストを抑える目的で、
シェルスクリプト+jq/sedのような実装を避けてネイティブバイナリで実装しています。
SessionStartフックのhooks/buildが初回セッションでcargo build --locked --releaseを走らせ、
target/release/rm-to-trashを生成します。
ビルド成果物はGitで追跡せず、
プラグイン更新時は再ビルドされます。
cargo(Rust toolchain)とtrashコマンドが必要です。
trash-cliを想定しています。
単語境界はシェルのトークン境界(行頭/末、空白、各種記号)で判定するため、
rmdirやrm-utilityのようにrmが他の文字と連続する形は対象外です。
クォートやヒアドキュメント内のrmまで完全に分離するのは困難なため、
echo "rm a"のような稀な誤マッチは許容しています。
どうしても置き換えられると困るようなものはWriteツールなどで書けば良いので、
echoなどを使った書き方にそこまで配慮していません。
Apache-2.0
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub ncaq/konoka --plugin rm-to-trashPlugins from other owners that cover similar ground