Skip to main content
Run your project’s formatter after every agent file edit so style stays consistent without extra steps.
The user asks for a refactor; the formatter runs automatically after each file edit.

How It Works

Quick Start

1

Simple Usage

Enable auto-formatting on edit tools:
2

With Configuration

Pin formatters per extension:
A missing or failing formatter never fails the edit — the original write is kept and errors are logged at debug level.

How It Works

After a successful edit_file or apply_patch, the pipeline detects a formatter by file extension, runs it, and re-reads the file on exit code 0. The {path} placeholder is the absolute path to the edited file. If omitted from your argv list, it is appended automatically.

Diagnostics: unavailable note

When an edited file has a known LSP language whose server is not installed and no legacy checker is available, the edit output now appends a one-time-per-language note:
For example, editing a Python file with no pylsp on PATH:
This replaces the previous silent no-op — the lost self-correction signal is now visible. The note is deduplicated per language per run, so install the server once and it disappears. See LSP Auto-Detect to probe availability before you run.

Configuration Options


Best Practices

post_edit_format="auto" runs a formatter only when one is on PATH — zero cost when none is installed.
Prefer ./node_modules/.bin/prettier so the version matches package.json.
Match local and CI formatter versions to avoid diff churn between runs.
Most useful for interactive agent sessions where you want immediate clean output.

File Editing

Core edit and patch tools

Code Agent

Code assistant configuration

LSP Auto-Detect

Probe server availability before you edit