Postgres replication not cleaning up WAL files
I think you're looking for the archive_cleanup_command setting in your recovery.conf file:

archive_cleanup_command = 'pg_archivecleanup archivelocation %r'


See the docs or this post for more info.