# Move File

> Moves a file from a source path to a destination path. The source file is removed after a successful move.

- Skill: `firma-ai/move-file` (Agent Skill)
- Install (CLI): `npx skillmds@latest add firma-ai/move-file`
- Raw SKILL.md: https://api.skillmd.com/api/skills/firma-ai/move-file/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT-0
- Author: Firma-AI (https://skillmd.com/u/firma-ai)
- Updated: 2026-09-10
- Page: https://skillmd.com/skills/firma-ai/move-file

---


# /move_file — Move File

You are the **move_file** tool for Clawthority. You move a file from a source path to a destination path, removing the source file after a successful move.

## What You Do

- Moves the file at `from` to the path specified by `to`.
- The source file is removed after a successful move.
- The destination file is created if it does not exist, or overwritten if it does.
- Validates that the source path exists and is a regular file before moving.
- Uses `renameSync` for an atomic move on the same filesystem; falls back to copy+delete for cross-device moves with rollback on failure.

## When to Trigger

Invoke this tool when the user or agent wants to:
- Move a file to a new location
- Rename a file (same or different directory)
- Relocate a file as part of a refactor or reorganization
- Transfer a file from one directory to another

## Parameters

| Name   | Type     | Required | Description                        |
|--------|----------|----------|------------------------------------|
| `from` | `string` | Yes      | Path of the source file to move.   |
| `to`   | `string` | Yes      | Path of the destination file.      |

## Result

| Name   | Type     | Description                                        |
|--------|----------|----------------------------------------------------|
| `from` | `string` | Absolute path of the source file (now removed).    |
| `to`   | `string` | Absolute path of the destination file.             |

## Example Usage

### Move a file to a new location

```json
{
  "tool": "move_file",
  "params": {
    "from": "/project/src/old-name.ts",
    "to": "/project/src/new-name.ts"
  }
}
```

### Example Response

```json
{
  "from": "/project/src/old-name.ts",
  "to": "/project/src/new-name.ts"
}
```

## Error Handling

| Error Code  | Cause                                                               |
|-------------|---------------------------------------------------------------------|
| `not-found` | The source path does not exist.                                     |
| `not-a-file`| The source path exists but is a directory, not a file.              |
| `fs-error`  | An unexpected filesystem error occurred during the move.            |

## Out of Scope

- Directory moves
- Overwrite protection (destination is always overwritten if it exists)
- Permission or metadata preservation
- Symbolic link handling

## Action Class

This tool is classified as `filesystem.write` — it modifies the filesystem by creating or overwriting the destination file and removing the source file. It is subject to HITL gating.

