An Alfred workflow that removes common leading indentation from clipboard text and pastes the result.
Useful when copying a subsection of YAML or other indented code — for example, grabbing a nested block from a large config file and pasting it as a standalone snippet. Also handy when copying output from CLI tools like Claude Code, where text is often indented relative to the terminal.
Say you copy a nested section from a YAML file:
deploy:
replicas: 3
resources:
limits:
memory: 512MiAfter running Dedent, the common indentation is removed:
deploy:
replicas: 3
resources:
limits:
memory: 512MiSurrounding fenced code block markers (```) are also stripped automatically.
- Download
Dedent.alfredworkflow - Double-click to install in Alfred
- Copy indented text to your clipboard
- Open Alfred, type
dedent, and hit Enter - The dedented text is copied to your clipboard and auto-pasted
The source files are:
dedent.py— the Python script that does the dedentingREADME.md— also used as the workflow's about text in Alfred
Edit those files, then rebuild:
python3 build.pyImportant: Always run python3 build.py and include the updated Dedent.alfredworkflow in every commit that changes dedent.py or README.md. The workflow file is the distributable artifact and must stay in sync with the source files.
Double-click Dedent.alfredworkflow to reinstall in Alfred.