Overview
Point Claude Code at copies of damaged documents, photos, audio or archives so it can identify each file's real format, describe the damage and try repairs that write only new files into a separate folder.
Problem or Objective
More in Home and Devices
AI Agents and Models
Tools and Integrations
- Tools
- Claude Code
- Prerequisites
- Claude Code installed and signed in, backups of the damaged files, and any open-source repair tools you choose to install.
How It Works
Back up the damaged files first and keep the originals somewhere Claude Code is not working. Make a working folder with an input folder holding copies and an empty output folder. Add a deny rule in Claude Code's permission settings so it cannot edit or delete anything in the input folder. Start Claude Code in the working folder and ask it to inspect each file: read the first bytes to find the real format, compare them with what that format should look like, and report whether the file looks truncated, has a broken header or a damaged index. For each file, ask it to propose a repair using open-source tools you already have installed or a short script, and approve each shell command when it asks. Repaired versions go only into the output folder under new names. Open every repaired file in its normal program and keep only those that really work; for anything irreplaceable that cannot be fixed this way, ask a professional recovery service before trying more.
Implementation Workflow
Steps assembled from the agents, tools and prompt of this entry. Adapt them to your own setup.
- Choose the agentSet up Claude Code.
- Connect the toolsConnect the tools this workflow relies on: Claude Code.
- Check the prerequisitesClaude Code installed and signed in, backups of the damaged files, and any open-source repair tools you choose to install.
- Gather your detailsCollect what the prompt asks for: Folder with copies of damaged files, Kinds of files, Repair tools you already have, Folder for repaired copies.
- Run the starter promptPaste the starter prompt below into Claude Code and adapt it to your case.
- Check against the documentationCompare what you get with the documentation at code.claude.com before you rely on it.
Practical Starter Prompt: Diagnose and repair file copies
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
The folder [Folder with copies of damaged files] holds copies of damaged files: [Kinds of files]. Do not modify or delete anything in it. For each file, read its first bytes, tell me its real format, and describe the damage you can see. Then propose one repair approach per file using tools already installed here ([Repair tools you already have]) or a short script, and wait for my approval of each command before running it. Write every repaired file only to [Folder for repaired copies] with "-repaired" added to the name. Finish with a table: file, damage found, repair tried, and whether the result opens.Run this in Claude Code with a deny rule protecting the input folder and the manual permission mode, so each shell command waits for your approval. Open every repaired file yourself before deleting anything.
Expected Results and Benefits
This is a suggested workflow, not a reported result. The points below are what the cited documentation says the tools can do.
This is a suggested workflow, not a reported outcome. The Claude Code docs describe a tool that reads files, edits files and runs commands, with a tiered permission system and deny rules that block a tool. No cited page covers file repair, so whether any given file can be recovered depends on the damage and is untested here.
Limitations and Considerations
Many damaged files cannot be repaired, and a failed attempt on an original can make things worse, so only ever work on copies. In its manual permission mode Claude Code asks before shell commands; keep that mode on and read each command before you approve it. Files you share with the model are sent to the provider, so think twice before using it on private photos or confidential documents. Check that any repair tool Claude suggests comes from its official source before installing it. Results depend on your setup and were not independently reproduced by Top 200 Repos.
GitHub Repositories
AI Agent Repository
Source code of the agent that does the work.
Official Website
The official site of the main tool or project in this use case.
Visit Website (opens in a new tab)code.claude.com
Related Videos
About anthropics/claude-code
The SECRET Claude Code Upgrade That Has Everyone Going Nuts (Full Guide) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)About anthropics/claude-code
The only Claude Code guide you'll ever need (Opus 4.5) (opens in a new tab)
The title names the project, the description links the project website.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- Overview - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 11:57 UTC
What this source supports
- Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools.
- Configure permissions - Claude Code Docs (opens in a new tab)
Project documentation · code.claude.com · Undated · Source checked 25 Nov 2026, 12:09 UTC
What this source supports
- Claude Code uses a tiered permission system to balance power and safety.
- Deny rules prevent Claude Code from using the specified tool.

