The Claude Code App automatically does this by default.
The Codex app only does it in Plan mode, I believe. I did not touch the Plan mode for a while.