if you want to do this get in claude cowork, tell it that you want to do this and have it help you make a plan on what emails to delete and setup the gmail permissions. Tell it you want a spec to feed to claude code to execute the work.
give the brief to claude code (in terminal) and let it rip. if it runs into any problems paste the output into claude cowork to help you work through it.