How the Agent Reach Uninstall Command Handles Skills vs Configuration Files

The uninstall command in Agent Reach removes skill files from agent-specific directories while optionally preserving the ~/.agent-reach/ configuration directory via the --keep-config flag, and also cleans up MCP entries.

The Agent Reach CLI provides an uninstall sub-command to cleanly remove installed components from your system. Located in agent_reach/cli.py, the _cmd_uninstall function handles the removal of three distinct data types: configuration files, skill files, and MCP entries. This article examines how the Agent Reach uninstall command differentiates between skills and configuration files during the cleanup process.

Core Uninstall Logic

The _cmd_uninstall function (lines 1375-1475 in agent_reach/cli.py) implements a three-phase removal process that distinguishes between global configuration and platform-specific skill files.

Configuration Directory Handling

The command targets the ~/.agent-reach/ directory, which contains the config.yaml file storing tokens, cookies, and API keys. By default, this directory is deleted entirely unless the user specifies the --keep-config flag. When --keep-config is passed, the configuration directory is preserved while only skill files are removed.

Skill File Removal

Skill files consist of SKILL.md documents and their associated references/ folders. The command identifies these across three supported agent platforms:

  • ~/.openclaw/skills/agent-reach for OpenClaw
  • ~/.claude/skills/agent-reach for Claude Code
  • ~/.agents/skills/agent-reach for generic agents

The implementation walks each path and removes the entire directory or symlink unless --dry-run is specified. This logic complements the _install_skill function (lines 55-65), which originally created these directories.

MCP Entry Cleanup

The command removes search-backend entries (exa and xiaohongshu) that were added during installation. If the mcporter binary exists on the system, the command invokes mcporter config remove <name> for each entry. During a dry run, it lists the would-be-removed actions without executing them.

Command-Line Options

The uninstall behavior is controlled through two primary flags:

--keep-config

Use this flag to preserve the ~/.agent-reach/ configuration directory while removing only skill files and MCP entries. This is useful when you want to retain API keys and tokens but remove the agent-specific implementations.

--dry-run

This flag displays all actions that would be performed without actually executing them. The command prints a concise summary distinguishing between real runs and dry runs, showing which directories and entries would be affected.

Usage Examples


# Full uninstall – removes config, skill files and MCP entries

agent-reach uninstall

# Keep the ~/.agent-reach config (only skill files are removed)

agent-reach uninstall --keep-config

# Show what would be removed without making changes

agent-reach uninstall --dry-run

Summary

  • The _cmd_uninstall function in agent_reach/cli.py handles three distinct removal targets: configuration directories, skill files, and MCP entries.
  • Configuration files in ~/.agent-reach/ are deleted by default but preserved with --keep-config.
  • Skill files are removed from three agent-specific locations: ~/.openclaw/skills/agent-reach, ~/.claude/skills/agent-reach, and ~/.agents/skills/agent-reach.
  • MCP entries for exa and xiaohongshu are cleaned up via mcporter config remove when the binary is available.
  • The --dry-run flag allows safe preview of removal actions before execution.

Frequently Asked Questions

What is the difference between skills and configuration files in Agent Reach?

Configuration files are stored in ~/.agent-reach/config.yaml and contain global settings like API keys and tokens. Skills are platform-specific files (SKILL.md and references/) installed in agent directories like ~/.claude/skills/agent-reach. The uninstall command treats these separately, allowing you to preserve configuration while removing skills.

Will uninstalling Agent Reach remove my API keys?

By default, yes. The uninstall command deletes the entire ~/.agent-reach/ directory containing config.yaml with all stored tokens. However, passing the --keep-config flag preserves these credentials while only removing skill files and MCP entries.

Which agent platforms are supported for skill removal?

The command supports three agent platforms: OpenClaw (~/.openclaw/skills/agent-reach), Claude Code (~/.claude/skills/agent-reach), and generic agents (~/.agents/skills/agent-reach). The uninstaller checks all three locations and removes the agent-reach skill directories from each.

How does the dry-run option work?

The --dry-run flag simulates the uninstall process without making actual changes. It lists all directories and MCP entries that would be removed, prints a summary of actions, and distinguishes between simulated and real execution, allowing you to verify the scope of removal before proceeding.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →