By choam2426
Blocks risky bash commands until an API key is verified, then prints a risk level and recovery info before each command execution.
A Claude Code plugin that automatically explains commands before execution.
Every Bash command is displayed with risk level and recovery instructions. 한국어
| Before | After |
|---|---|
![]() | ![]() |
| Before | After |
|---|---|
![]() | ![]() |
# Add marketplace
/plugin marketplace add choam2426/CmdLens
# Install plugin
/plugin install cmdlens@cmdlens-marketplace
git clone https://github.com/choam2426/CmdLens.git
cp -r CmdLens/plugins/cmdlens ~/.claude/plugins/
Session Start
↓
SessionStart Hook → Inject description guide to Claude
↓
User requests task
↓
Claude prepares Bash command with description
↓
PreToolUse Hook → Display risk/recovery via systemMessage
↓
Command executes
Hybrid Approach: Combines SessionStart (behavior modification) and PreToolUse (display) for consistent, reliable output.
| Level | Icon | Description | Examples |
|---|---|---|---|
| Safe | 🟢 | Read-only, info query | ls, cat, pwd, git status |
| Caution | 🟡 | File modification | mv, cp, chmod, git commit |
| Danger | 🔴 | Deletion, system change | rm -rf, sudo, git push --force |
CmdLens/
├── .claude-plugin/
│ └── marketplace.json
├── plugins/
│ └── cmdlens/
│ ├── .claude-plugin/
│ │ └── plugin.json
│ ├── hooks/
│ │ ├── hooks.json
│ │ ├── session_start.py
│ │ └── pre_tool_use.py
│ └── prompts/
│ └── description_guide.md
├── docs/
│ └── PRD.md
└── README.md
Executes bash commands
Hook triggers when Bash tool is used
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub choam2426/CmdLens --plugin cmdlensSmart command safety filter for Claude Code — parses shell pipelines and evaluates per-command safety rules to auto-approve safe commands and block dangerous ones
PreToolUse hook that auto-approves safe Bash commands by parsing them into an AST and matching against configurable patterns
Block destructive git and filesystem commands before execution
Safety hooks to block or require user approval for dangerous commands (rm, git operations, .env access, file size limits)
5 essential safety hooks for Claude Code. Blocks rm -rf, force-push, hard-reset, .env overwrites, and package publish. The minimum viable safety net from 800+ hours of autonomous operation.
Intelligent command history tracking with automatic failure detection. Tracks all bash commands Claude runs (successful and failed) with semantic directory aliasing and command mapping.