LLM integrations

Put what agents write into house style with a hook. No model call, no tokens.

Agents write Markdown fast and in their own style. A hook runs Lynter on each file the agent writes, so the file lands in house style. The rules are deterministic code. There is no model call and no token cost.

The command

fix --stdin reads a file from standard input and writes the fixed text to standard output. --stdin-path tells Lynter which scope applies, because the path decides which profiles match.

lynter fix --stdin --stdin-path "$FILE" < "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE"

Claude Code

Add a PostToolUse hook that runs after the Write and Edit tools. The hook script reads the file path from the hook input, then runs the command above on Markdown files.

{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [{"type": "command", "command": "./scripts/lynter-hook.sh"}]
      }
    ]
  }
}
#!/usr/bin/env bash
FILE=$(jq -r '.tool_input.file_path // empty')
case "$FILE" in
  *.md) lynter fix --stdin --stdin-path "$FILE" < "$FILE" > "$FILE.tmp" && mv "$FILE.tmp" "$FILE" ;;
esac

Codex

Codex reads AGENTS.md for instructions. Add a line that tells it to run the check before it finishes, and run the same command in CI as the backstop.

Before you finish, run `lynter fix --changed` and commit the result.

Cursor

Add a rule in .cursor/rules with the same instruction, and run lynter check --changed in a pre-commit hook so a file that skips the instruction still gets caught.

Check, not just fix

Use check when you want a failing exit code instead of a rewrite. Add --json to read the violations from a script.

lynter check --changed --json