---
title: "Discussion on \"[CLI] Multiple Codex (ChatGPT) accounts on one machine\" | Hashnode"
description: "Discussion on \"[CLI] Multiple Codex (ChatGPT) accounts on one machine\". Ran out of usage, logged out, logged into the other account, got tired of it, so I automated it.\nFast track: throw this post's URL at your AI and tell it to set this up for you.\nTLDR:\n\nMake several co"
url: "https://hashnode.com/posts/cli-multiple-codex-chatgpt-accounts-on-one-machine/6ac2931a73f4e91095662fe0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[CLI\] Multiple Codex (ChatGPT) accounts on one machine](https://sanghunkang.hashnode.dev/cli-multiple-codex-chatgpt-accounts-on-one-machine?utm_source=hashnode&utm_medium=feed)

Ran out of usage, logged out, logged into the other account, got tired of it, so I automated it. Fast track: throw this post's URL at your AI and tell it to set this up for you. TLDR: Make several co

Oct 4 · 3 min read · sanghunkang.hashnode.dev  
Updated Oct 12  
Read the article

-   [#dev](https://hashnode.com/tag/dev)

## Written by

[Sanghun Kang](https://hashnode.com/@sanghunkang)

@sanghunkang

  
[View profile](https://hashnode.com/@sanghunkang)

## Responses 2

Markdown supported · ⌘↵ to post

[OnlineProxy](https://hashnode.com/@onlineproxyio)

[Oct 9](https://hashnode.com/posts/cli-multiple-codex-chatgpt-accounts-on-one-machine/6ac2931a73f4e91095662fe0/comment/6ac941103b027169609627c2)

WAL does stop corruption, but codex's lock handling is the shaky part, since it sets busy\_timeout to 5000 and doesn't retry SQLITE\_BUSY. issues 20213 and 35555 seem to show that under concurrent use, and 35555 was still open as of august. the journal\_mode stall in 35704 only involves one process, so I'd treat it as a side note

unquoting the pattern inside excluded should make state\_\*.sqlite match and survive schema bumps, so test that on a scratch copy first. keep each DB with its wal and shm files in the same folder. and check with sqlite3 whether unified history is in state\_5.sqlite, because if it is, excluding the DBs loses most of the benefit

[Sanghun Kang](https://hashnode.com/@sanghunkang)

[Oct 10](https://hashnode.com/posts/cli-multiple-codex-chatgpt-accounts-on-one-machine/6ac2931a73f4e91095662fe0/comment/6ac941103b027169609627c2#reply-6ac9e1e2f21e51700d1f1ddf)

Thanks, you're right. WAL supports concurrent access, but depending on how Codex handles locking, running multiple instances at the same time can lead to startup failures or temporary hangs.

In my case, I switch to another account when one runs out of usage. Since I don't run both instances at the same time, I haven't encountered these issues so far. They could occur if you run both simultaneously.

I've updated the post to clarify this. Thanks for pointing it out!
