Back to Discover

CmdLens

plugin

choam2426

View on GitHub
11 starsApache-2.0Synced Aug 2, 2026

Install to Claude Code

/plugin marketplace add choam2426/CmdLens

README

CmdLens

A Claude Code plugin that automatically explains commands before execution.

Every Bash command is displayed with risk level and recovery instructions. 한국어


Before & After

Command Output

BeforeAfter
before-outputafter-output

Permission Approval Screen

BeforeAfter
before-permissionafter-permission

Features

  • Automatic Explanation — Shows risk and recovery info for every command
  • Risk Level Indicator — Visual assessment (🟢 Safe / 🟡 Caution / 🔴 Danger)
  • Recovery Guide — How to undo, or warns if irreversible
  • Multilingual Support — Explains in user's language (English/Korean)
  • Zero Dependencies — No external API calls, no additional packages

Installation

Option 1: Marketplace (Recommended)

# Add marketplace
/plugin marketplace add choam2426/CmdLens

# Install plugin
/plugin install cmdlens@cmdlens-marketplace

Option 2: Manual Installation

  1. Clone the repository:
git clone https://github.com/choam2426/CmdLens.git
  1. Copy plugin to Claude Code plugins directory:
cp -r CmdLens/plugins/cmdlens ~/.claude/plugins/
  1. Restart Claude Code

How It Works

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.


Risk Levels

LevelIconDescriptionExamples
Safe🟢Read-only, info queryls, cat, pwd, git status
Caution🟡File modificationmv, cp, chmod, git commit
Danger🔴Deletion, system changerm -rf, sudo, git push --force

Requirements

  • Python 3.10+
  • Claude Code

Project Structure

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

License

MIT

Rendered live from choam2426/CmdLens's GitHub README — not stored, always reflects the source repo.

1 Plugin

NameDescriptionCategorySource
cmdlensDisplays risk level and recovery info before every Bash command execution./plugins/cmdlens

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.