Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

What is com.apple.imagent and can I safely delete the files inside its folder?

I have a 2017 Macbook Pro running Mojave (10.14.2). 121 GB SSD.


What is contained in this folder?

Macintosh HD/Users/<User>/Library/Caches/CloudKit/com.apple.imagent


It is quite large: the Size is 21.56 GB for 10,992 items.


Can I safely delete any/all of those 10,992 files?

MacBook Pro

Posted on Apr 1, 2021 1:54 PM

Reply
Question marked as Best reply

Posted on Apr 1, 2021 3:43 PM

CloudKit is also used by various apps for app-related storage.


It's possible this data is stale, though the changing timestamps imply this is live data.


To clear up stale data and to rebuild caches, boot through Safe Mode.


Caches will rebuild, and apps will then re-download contents, which can mean negligible changes to usage.


A Mac with 128 GB is never going to be less than an on-going content-management effort, though

8 replies
Question marked as Best reply

Apr 1, 2021 3:43 PM in response to 26beans

CloudKit is also used by various apps for app-related storage.


It's possible this data is stale, though the changing timestamps imply this is live data.


To clear up stale data and to rebuild caches, boot through Safe Mode.


Caches will rebuild, and apps will then re-download contents, which can mean negligible changes to usage.


A Mac with 128 GB is never going to be less than an on-going content-management effort, though

Apr 1, 2021 2:12 PM in response to 26beans

Those are cached copies of the contents you have stored on iCloud. macOS manages that. Not something I'd mess with directly, lest iCloud itself get corrupted.


Maybe turn off iCloud?


iCloud should reduce its caching as storage gets more constrained, but this system started constrained.


If you're always using this MacBook Pro in one place, maybe add and migrate to an external SSD, and locate your contents and data there?


Or have a look at a replacement MacBook or MacBook Pro with more internal storage?


Apr 1, 2021 3:30 PM in response to MrHoffman

Thanks for the reply, MrHoffman, though I'm still puzzled. I have turned off iCloud and signed out of my account: no change. My iCloud usage is less than 5GB (I don't pay for any extra space) and it consists of Calendar, Contacts, Mail, and Messages. No documents, video, music, or other files.


If I look at "cache" in Activity Monitor, it tells me there is zero activity, zero files.


The "im" in the name "imagent" makes me think the folder relates to Messages. But the dates on the files in that folder don't correspond to anything in Messages. (The most recent date/timestamp was from today, while I wasn't even in the room.) The datestamps on the files begin in Jan 2019. There are 28 unique dates from then until today. Some dates have only a few files, but three of the dates have thousands -- one date has nearly 5000 files, all with timestamps in a 37-minute range and another with 2300 files in just 2 minutes. I can't think what I could possibly have done to create that many files that quickly.


Is it possible that the OS has had a few meltdowns and, in the process, somehow created a whole bunch of junk files?

Apr 2, 2021 4:11 PM in response to MrHoffman

Thanks again, MrHoffman.


I booted into Safe Mode, then restarted. No change in the contents of the Macintosh HD/Users/<User>/Library/Caches/CloudKit/com.apple.imagent folder -- still 21.5 GB.


The size of the Macintosh HD/Users/Library/Caches folder is also unchanged, at its previous manageable 7.05 GB.


Now I'm trying to clear enough space so that I can download/use either Onyx or CleanMyMac. I've used Onyx on previous computers, but have no experience with CleanMyMac other than I've seen it referenced by others. Do you have any insight on either of those tools?

Apr 2, 2021 4:37 PM in response to 26beans

As a general rule, I do not use, nor recommend, add-on cleaner apps.


On the local systems, any such apps found will be removed.


For opinions, see the results of the following search with DuckDuckGo or Google search: cleanmymac site:discussions.apple.com


For locating and cleaning up large files, OmniDiskSweeper is one option: https://www.omnigroup.com/more


This Mac just doesn’t have enough storage for what you want to do with it. I know you don’t want to hear that.

Apr 3, 2021 2:21 PM in response to MrHoffman

Good morning :-)

Thanks yet again. I've spent some time reading up on CleanMyMac and now feel that I should give my keyboard a bath. OnyX sounds like it's not such a hideous little gremlin, but also not necessary.


re: This Mac just doesn't have enough storage...

I don't doubt it, but it's what I could pay for, and so it's what I have. That said, I lead a somewhat dull computing life. Word, Excel, and Quicken. Mac Mail, Thunderbird, Firefox, Safari. Messages. Every few months, I clear out email and delete browser caches. I don't often remove old messages, b/c I haven't found a straightforward way to easily clear out the detritus without also losing things I want to keep.


The Documents folder (that houses all those exciting spreadsheets and my Quicken files) is 6.8GB. Very little music (iTunes folder is 400 MB). No movies. Photos does take a large chunk, 23.5 GB. Still, it seems like I ought to be able to do more than that without constantly running out of space.


I would just like to understand why that pesky imagent folder is so large -- 21.5 GB -- and how files end up in it. I have determined that the files mostly, if not all, things that were attached in Messages. The dates have nothing at all to do with the actual Message date, and the filenames don't match the filename displayed in the Messages UI, but the preview in Get Info does show me the image.

Apr 3, 2021 2:43 PM in response to 26beans

While quite familiar with working on 16 kB systems in þe olden days before 5 MB and 10 MB HDDs replaced floppies, these days that 21 GB is often considered, well, small.


Dull or not, that collection of apps and associated documents and files and data also clearly means you’re past the capacity of this SSD and this by your own experience here.


I doubt there’s a fix this within the constraints of available internal storage either.


Maybe switch tactics entirely, install a terabyte-class external SSD and boot and run from that for most of your use.


Boot from and provision and use the internal SSD solely when you really need to be mobile.


Or maybe get a portable external SSD, for when you need more but also need mobile.

Apr 3, 2021 4:30 PM in response to 26beans

IMAgent is the agent that listens for incoming traffic for Messages and FaceTime. The agent runs whether or not the apps are open which explains why the timestamps cover times you weren't using the Mac.


Do you use FaceTime? If not, and it's been activated, you may want to consider turning it off which you can do by opening it and using the switch in Preferences (sorry I can't remember exactly where that is and don't have FaceTime activated on my Macs so can't open Preferences).


On one of my Macs running Mojave (rebuilt at the end of 2019) I have never used FaceTime but do use Messages frequently and the size of this folder is only a few hundred KB.


If you want to delete the cache you will have to make sure there is nothing using it at the time (there are a few IM processes and I don't know if more than one of them puts data in this cache). You should do this in safe mode.

What is com.apple.imagent and can I safely delete the files inside its folder?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.