skill-refresh

Terminate orphaned Claude Code processes and clean the ~/.claude/ directory.

3|1|Updated May 21, 2024
One-click install
npx skills add https://github.com/benbrastmckie/.dotfiles --skill skill-refresh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-refresh
Source: https://github.com/benbrastmckie/.dotfiles/tree/main/.claude/skills/skill-refresh
Command: npx skills add https://github.com/benbrastmckie/.dotfiles --skill skill-refresh

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This skill helps you terminate orphaned Claude Code processes and clean up the ~/.claude/ directory to reclaim system resources and maintain a tidy work environment.

Core Features & Use Cases

  • Process cleanup: Identify and terminate Claude Code processes that have no controlling terminal or are orphaned.
  • Directory cleanup: Remove accumulated temporary files in ~/.claude/ while preserving important or recently modified data.
  • Safe operation: Never kills active sessions or the current process; supports dry-run and force modes for safety.

Quick Start

To refresh Claude Code resources, run the script to terminate orphaned processes and clean up the directory. Example basic commands:

  • Dry-run: .claude/scripts/claude-refresh.sh --dry-run
  • Force cleanup: .claude/scripts/claude-refresh.sh --force
  • Cleanup status: .claude/scripts/claude-cleanup.sh

Frequently Asked Questions about skill-refresh

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I terminate orphaned Claude Code processes that are lingering in my development environment?

To terminate orphaned Claude Code processes, run a shell script that identifies instances without a controlling terminal and safely stops them while preserving active sessions and the current process.

What is the safest way to clean up temporary files left behind in the ~/.claude/ directory?

The safest way to clean up the ~/.claude/ directory is using a dry-run mode to preview which temporary files will be removed, ensuring important or recently modified data is preserved before actual deletion.

How do I run a dry-run cleanup of Claude Code processes and temporary files before committing to changes?

You can run a dry-run cleanup by executing the shell script with the --dry-run flag, which previews the termination of orphaned processes and directory cleanup without actually deleting files or stopping processes.

Can I force cleanup of accumulated Claude Code temporary files without manually confirming each deletion?

Yes, you can force cleanup by running the shell script with the --force flag, which bypasses manual confirmation to automatically remove accumulated temporary files in the ~/.claude/ directory.

Why does this process cleanup script preserve my active Claude Code sessions instead of killing them?

The process cleanup script preserves active sessions by specifically targeting only orphaned processes without a controlling terminal, ensuring your current work and active instances remain unaffected during the cleanup operation.

Does this cleanup script support automated usage within larger shell-script automation workflows?

Yes, the script supports automated usage by providing argument parsing, safe process termination, directory cleanup with safeguards, and user feedback, making it suitable for integration into larger shell-script automation workflows.