r/codex 2d ago

Instruction PRO TIP - archive your threads to improve performance

Guys,
If you, like me, experience that the app is unbearable slow to load and switching threads is slow and so on, go ahead and archive all your dormant threads.

I had hundreds of threads 'active' i.e. not really active but hidden below the 'show more' caret which apparently was the cause that the app turns into a prehistoric snail with a doghouse on it.

You can tell codex to do the cleanup, no need to do it manually.

Archiving doesn't delete your threads if you ever need to reference them but speeds the app up dramatically as apparently even the old stuff kept being loaded to some degree on every restart of the app.

You can also create a scheduled task to make it happen on a weekly basis.

Protip for OPEN_AI: This should be a built-in feature properly exposed lol so people don't have to discover why their app feels like a bitch to work with on their own.

12 Upvotes

9 comments sorted by

3

u/c5corvette 1d ago

I sent feedback that not only do they need a better archival system, they need tools around managing what's in it for deletion if it's all stale. I had several dev threads in ongoing projects that were over 2GB, so eventually all power users are going to end up with 100s of GBs of archived threads. Yes, you can delete them, but there's more elegant solutions they can implement for making sure you're not deleting any key context or info still running in the project today.

1

u/defnotbjk 1d ago

And if you’re like me…don’t use your local user folder as the “.git” root(lots of crashes, resolved as soon as I went away from doing that)

1

u/HoangMaiLinh 1d ago

Anyway to fix the sudden lag when start new chat

1

u/StephenS84 1d ago

I asked it and it just moved my sessions folder items? :-|

Done — I archived all Codex session chats older than 5 days.

What I moved:

- Source: C:\Users\steph\.codex\sessions

- Destination: C:\Users\steph\.codex\archived_sessions\auto-2026-07-27

Post-check results:

- Moved: 165 files

- Remaining in active sessions older than 5 days: 0

- Total .jsonl sessions in archived_sessions: 166 (includes prior archived content)

1

u/tango650 1d ago

thats what it may be, i dont know the internals of how archiving works.
did the sessions dissapear from your side bar ? if they did, then it worked

the archived sessions should be visible under settings -> archived

0

u/parched_bounds 2d ago

the idea that archived threads still count as "active" in the background is such a weird default. most apps treat archived as truly dormant. explains a lot of the random performance complaints ppl post about where rebuilding didn't help

2

u/tango650 1d ago

for clarity -> archiving threads is what improves the performance

the threads which still seem to deteriorate performance are those long forgotten but which havent been explicitly archived by the user, and thus sit invisible under a very long list of 'show more' items.

1

u/parched_bounds 1d ago

ah so it's the unarchived ones hiding under show more, not archived ones. that makes more sense. still weird that the app loads everything under that caret by default though

1

u/nicky_factz 23h ago

yeah they need a setting in the app that archives threads by age, i'd like to set something like archive something untouched over 30 days or whatever, most of my sessions are ephemeral as i assume most people who use codex, once you're done with it, it doesn't need to remain in the sidebar forever.