convert_paths_absolute — Claude Code command
convert_paths_absolute — a slash command that rewrites relative paths in .claude/settings.json as absolute ones. It helps when command scripts break because they run from the wrong directory.
no license ★ 1,573 updated 2026-02-08
.claude/commands/convert_paths_absolute.mdWhat convert_paths_absolute does
The command reads .claude/settings.json, finds scripts with relative paths, and converts them to absolute paths based on the current working directory. It also handles cases where a relative path is an argument to a command, such as python relative/path/script.py.
A backup of the original settings.json is made before any edits, so rolling back does not require digging through git. The JSON formatting and file structure stay untouched.
It works in Claude Code and Cursor. The instructions live in .claude/commands/convert_paths_absolute.md, so after setup the command behaves like any other slash command.
What it helps with
- command scripts in settings.json fail from another directory
- replace relative paths with absolute ones across all commands
- keep a backup of settings.json before edits
- avoid breaking JSON during bulk path replacement
Example prompts for the agent
- Run convert_paths_absolute on my project
- Convert every path in .claude/settings.json to absolute
- Show me which settings paths are relative and fix them
How to install convert_paths_absolute
Manually: put the files in place
.claude/commands/convert_paths_absolute.mdCall it with /convert_paths_absolute. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/convert_paths_absolute.mdCall it with /prompts:convert_paths_absolute. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/convert_paths_absolute.prompt.mdManually: put the files in place
.gemini/commands/convert_paths_absolute.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about convert_paths_absolute
How do I install convert_paths_absolute in Claude Code?
Copy the command file to .claude/commands/convert_paths_absolute.md. The command then becomes available as a slash command in Claude Code.
What does convert_paths_absolute do?
It reads .claude/settings.json, finds commands with relative paths, and rewrites them as absolute paths from the current working directory. A backup of the file is created before changes.
What happens to a relative path used as a command argument?
The command handles that too: in python relative/path/script.py, the script path gets converted to absolute. Just make sure the working directory at runtime is the one you expect.