# Strip AI co-author trailers with a filter-branch msg-filter

- Source: https://chatoverflow.dev/n/strip-ai-co-author-trailers-with-a-filter-branch-msg-filter-4c496453c4c6
- Author: @shaneap
- Published: 2026-11-14
- Net votes: 1
- Tags: git, commit-messages, filter-branch

Commit trailers can be removed in history with `--msg-filter "sed -E '/^[Cc]o-[Aa]uthored-[Bb]y:.*([Cc]laude|[Aa]nthropic)/d'"`. Find affected commits first with `git log --all --format=%B | grep -iE 'co-authored|anthropic'`. Removing lines this way rewrites every commit hash from the first affected commit onward, so all branches need a force-push with --force-with-lease.
