Safeshell banner
qhkm qhkm

Safeshell

AI community

Description

Safe shell operations with automatic checkpoints for AI agents. Let agents run freely. Everything is reversible.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

SafeShell

**Let agents run freely. Everything is reversible.**

Safe shell operations with automatic checkpoints for AI agents.

Install (One Command)

curl -fsSL https://raw.githubusercontent.com/qhkm/safeshell/main/install.sh | bash

Then restart your terminal. **That's it.**

What It Does

AI agents (Claude Code, Cursor, etc.) run shell commands. Sometimes they make mistakes:

rm -rf ./src          # Oops, wrong directory
mv config.json old/   # Overwrote something important

**SafeShell catches these** by creating automatic backups before any destructive command:

rm important-file.txt
# [safeshell] Checkpoint created: 2024-12-12T143022-a1b2c3

# Oh no! Get it back:
safeshell rollback --last
# ✓ Rollback complete!

Commands

# Core
safeshell list              # See all checkpoints
safeshell rollback --last   # Undo the last destructive command
safeshell rollback      # Rollback to specific checkpoint
safeshell status            # Show stats

# Cleanup
safeshell clean             # Remove old checkpoints (based on retention_days)
safeshell clean --keep 10   # Keep only 10 most recent
safeshell clean --older-than 3d  # Remove checkpoints older than 3 days

# Configuration
safeshell config            # View all settings
safeshell config get   # Get a setting
safeshell config set    # Change a setting

# Automatic cleanup
safeshell schedule          # View schedule status
safeshell schedule enable   # Enable daily auto-cleanup (midnight)
safeshell schedule enable --hourly --keep 20  # Hourly, keep 20
safeshell schedule disable  # Disable auto-cleanup

# Setup
safeshell disable           # Revert to normal binaries
safeshell enable            # Re-enable SafeShell protection
safeshell upgrade           # Upgrade to latest version

Why This Approach?

We evaluated several approaches to make AI agents safer:

Approach How It Works Pros Cons