How to Run 10+ Claude Code Sessions Without a Powerful Computer

How to Run 10+ Claude Code Sessions Without a Powerful Computer

如何在不使用高性能电脑的情况下运行 10 个以上的 Claude Code 会话

Running coding agents requires a lot of hardware. Of course, running the actual LLM is incredibly expensive and requires extremely powerful GPUs. However, running the agents as well, for example, Claude Code and Codex, is also demanding on your computer. 运行编程智能体(Coding Agents)需要大量的硬件资源。当然,运行大语言模型(LLM)本身成本极高,且需要极其强大的 GPU。然而,运行这些智能体(例如 Claude Code 和 Codex)同样会对你的电脑造成沉重负担。

I struggled for a long time with running too many coding agents at the same time on my computer. I would notice that my computer got bottlenecked in different ways, for example, with input/output limitations or with my RAM running out. 我曾长期困扰于在电脑上同时运行过多的编程智能体。我发现电脑会以各种方式遇到瓶颈,例如输入/输出限制或内存(RAM)耗尽。

I got myself an even more powerful computer to try to remove these bottlenecks, which for the most part works. However, I know that getting an extremely powerful computer is not an option for a lot of people, and thus, you need alternatives. Thus, in this article, I’ll discuss how you can run a lot of parallel coding agents without having to purchase a very powerful computer to run all of them on. 我曾买了一台更强大的电脑试图消除这些瓶颈,这在很大程度上确实有效。然而,我知道对于许多人来说,购买一台极其强大的电脑并非可行之选,因此你需要替代方案。所以,在本文中,我将探讨如何在无需购买高性能电脑的情况下,并行运行大量的编程智能体。

The technique I’ll cover also has the additional benefit that it allows you to run the coding agents 24x7 and will not be blocked, for example, if you close your computer. 我将介绍的技术还有一个额外的好处:它允许你 24x7 全天候运行这些智能体,并且不会因为你关闭电脑而中断。

This infographic image highlights the main contents of the article. I’ll discuss how to run 10 to 20 coding agents at the same time without having to purchase powerful hardware. You can do this by renting a CPU and accessing the server through SSH. Image by ChatGPT. 这张信息图概括了本文的主要内容。我将讨论如何在不购买强大硬件的情况下,同时运行 10 到 20 个编程智能体。你可以通过租用 CPU 并通过 SSH 访问服务器来实现这一点。(图片由 ChatGPT 生成)

Why running a lot of parallel coding agents is challenging

为什么并行运行大量编程智能体具有挑战性

First, let’s cover why running a lot of parallel coding agents is challenging. There are a few aspects that make it challenging. First of all, running Codex or Claude Code simply requires quite a bit of CPU from your computer. If you then multiply this by 10 to 20 coding agents, you’ll start spending a lot of your available CPU power or RAM. 首先,让我们探讨一下为什么并行运行大量编程智能体具有挑战性。这主要涉及几个方面。首先,运行 Codex 或 Claude Code 本身就需要消耗电脑相当多的 CPU 资源。如果将其乘以 10 到 20 个智能体,你将耗尽大部分可用的 CPU 算力或内存。

Additionally, you don’t only spend compute on running the CLI coding tools themselves; you also might spend compute on stuff the coding agents might be doing. Some examples of this are: Running local unit tests, Spinning up localhost servers to test on, Letting the agent use your computer or browser. All of these things add up, and as mentioned, if you multiply it by 10 to 20 coding agents, it becomes an extreme strain on your hardware. 此外,你消耗的算力不仅限于运行 CLI 编程工具本身,还包括智能体执行任务时产生的开销。例如:运行本地单元测试、启动用于测试的本地服务器、让智能体调用你的电脑或浏览器。所有这些加在一起,正如前面提到的,如果乘以 10 到 20 个智能体,将对你的硬件造成极大的压力。

Furthermore, I don’t believe that running coding agents on your computer will be any cheaper in the long run. Of course, you can do optimizations. Claude Code has, for example, done a lot of optimizations to reduce the amount of load that the Claude Code CLI requires from your computer. However, it will always take quite a bit of compute. Additionally, I imagine that in the future we’ll just run even more coding agents at the same time; thus, the problem will multiply. Therefore, you need a better, more long-term solution to this problem, which I’ll cover in the following section. 此外,我不认为从长远来看,在本地电脑上运行编程智能体会更省钱。当然,你可以进行优化。例如,Claude Code 已经做了大量优化,以减少其 CLI 对电脑的负载。然而,它始终需要消耗相当多的算力。而且,我预想未来我们会同时运行更多的智能体,问题会成倍增加。因此,你需要一个更好、更长期的解决方案,我将在下一节中介绍。

How to run a lot of parallel coding agents effectively

如何高效地并行运行大量编程智能体

The main technique that I’ll cover in this article is to rent a remote server with the hardware specs that you require and run your coding agents there. 本文介绍的核心技术是:租用一台符合你硬件规格要求的远程服务器,并在那里运行你的编程智能体。

This has massive advantages. First of all, renting a server is not particularly expensive, especially compared to buying that kind of hardware. For example, you can get a powerful computer with 64 GB of RAM for less than 100 USD per month, while in practice that would probably cost you at least two thousand USD to purchase; so instead of having to pay two to three thousand USD up front, you can simply pay a monthly cost of way less than one hundred USD. 这有巨大的优势。首先,租用服务器并不昂贵,尤其是与购买同类硬件相比。例如,你可以以每月不到 100 美元的价格租到一台拥有 64GB 内存的强大电脑,而购买同类设备通常需要至少 2000 美元。因此,你无需一次性支付两三千美元,只需支付每月不到 100 美元的费用。

This is, of course, great because it puts much less strain on your cash flow, and it allows more people to access this kind of hardware. Furthermore, you can, of course, adapt: you can buy less powerful hardware for way cheaper, and of course, you can buy more powerful hardware, for example, 128 gigabytes or even more RAM if you need it. 这当然很好,因为它减轻了你的现金流压力,并让更多人能够使用这种硬件。此外,你还可以灵活调整:你可以花更少的钱购买配置较低的硬件,或者根据需要租用更强大的硬件,例如 128GB 甚至更大的内存。

However, there are some challenges that you need to deal with when you run on rented hardware. I’ll cover some of the challenges. 然而,在租用的硬件上运行程序时,你需要应对一些挑战。我将在下文介绍其中的一些。

Where to get hardware

从哪里获取硬件

First of all, I’m not sponsored by any of these companies. I’m just mentioning a few of the options that you have for getting hardware. Of course, you can use the hyperscalers such as Google Cloud Platform, Microsoft Azure, and AWS to access servers from there. These servers are very expensive, and I would argue they’re two to four times more expensive than alternatives on the market that you get from other mid-level players, but they are very solid, and they might be on a platform that you already know. 首先,我没有接受任何这些公司的赞助。我只是列举了一些获取硬件的选项。当然,你可以使用 Google Cloud Platform、Microsoft Azure 和 AWS 等超大规模云服务商。这些服务器非常昂贵,我认为它们比市场上其他中型厂商提供的替代方案贵 2 到 4 倍,但它们非常稳定,而且可能处于你已经熟悉的平台上。

Furthermore, you might have credits available through one of these hyperscalers, which will allow you to, of course, rent a server without having to pay any of your own money. So, that could be a good option. 此外,你可能拥有这些云服务商的赠金,这让你无需自掏腰包即可租用服务器。所以,这可能是一个不错的选择。

If you don’t want to use the hyperscalers, for example, if you have to pay for it yourself and you want to set up your own server, I recommend alternatives such as Hetzner, which is a German cloud company you can use. There are also multiple other alternatives, for example, Scaleway. Note that you do not need to rent a GPU, so you are renting a CPU, which is way cheaper than renting a GPU. There are a lot of options. I recommend you just check what the options in your region are. You can ask your Claude Code or Codex about it to find the best alternative for you, given your hardware preferences, like how powerful a computer you need, how much you can pay, and so on. 如果你不想使用这些超大规模云服务商(例如你需要自费且想搭建自己的服务器),我推荐像 Hetzner 这样的替代方案,这是一家你可以使用的德国云公司。还有许多其他选择,例如 Scaleway。请注意,你不需要租用 GPU,因此你租用的是 CPU,这比租用 GPU 要便宜得多。选择非常多,我建议你查看所在地区的选项。你可以询问 Claude Code 或 Codex,根据你的硬件偏好(如需要多强大的电脑、预算多少等)来找到最适合你的方案。

Effectively running your coding sessions on remote hardware

在远程硬件上高效运行编程会话

Now the main issue that you have to deal with is how to effectively run your coding sessions on remote hardware. There are a few challenges that you will realize you’ll have whenever you start spinning up coding sessions through SSH. So, first of all, you would want to access your new hardware that you rent, this you should do through SSH, which is the standard way of accessing remote hardware. 现在你需要处理的主要问题是如何在远程硬件上高效运行编程会话。当你开始通过 SSH 启动编程会话时,你会发现存在一些挑战。首先,你需要访问租用的新硬件,这应该通过 SSH 完成,这是访问远程硬件的标准方式。

The great thing now is that you don’t have to set this up manually yourself. Setting up these connections manually is a very time-consuming and frustrating process, which is something I’ve done before. However, luckily today you can just use coding ag… 现在好的一点是,你不需要手动进行设置。手动配置这些连接是一个非常耗时且令人沮丧的过程,我以前就经历过。然而幸运的是,今天你可以直接使用编程智能体……