<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alex Ialanji</title>
    <description>The latest articles on DEV Community by Alex Ialanji (@alex_iolan).</description>
    <link>https://dev.to/alex_iolan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4194717%2F1da96942-d73a-434a-a254-1a5f7faba2e5.jpg</url>
      <title>DEV Community: Alex Ialanji</title>
      <link>https://dev.to/alex_iolan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alex_iolan"/>
    <language>en</language>
    <item>
      <title>Six AI agents froze my production server. Each one did the right thing</title>
      <dc:creator>Alex Ialanji</dc:creator>
      <pubDate>Thu, 29 Oct 2026 14:07:34 +0000</pubDate>
      <link>https://dev.to/alex_iolan/six-ai-agents-froze-my-production-server-each-one-did-the-right-thing-4bo6</link>
      <guid>https://dev.to/alex_iolan/six-ai-agents-froze-my-production-server-each-one-did-the-right-thing-4bo6</guid>
      <description>&lt;p&gt;&lt;em&gt;This article was created with the help of AI. The incident, the logs and the numbers are from my own server.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On September 25 at 19:01 UTC my server stopped responding. The site, the admin panel and the publishing queue all froze at once. Seventeen minutes later I hard-rebooted it.&lt;/p&gt;

&lt;p&gt;There was no attack and no traffic spike. I had given Claude Code a list of six tasks, and it started six agents in parallel. Each one dutifully installed dependencies, ran the type checker and the tests, and built the project. On the same machine that serves the site.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcza92iiko16f4yjga6mu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcza92iiko16f4yjga6mu.png" alt="Memory asked for by one, two and six parallel builds against the 7 GB that were free" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The arithmetic nobody did
&lt;/h3&gt;

&lt;p&gt;Take round numbers close to mine. The server has 10 GB of RAM, and the live services use about 3. That leaves 7.&lt;/p&gt;

&lt;p&gt;One typecheck or build of a project this size takes 1.5 to 3 GB. Six at once need 9 to 18. That doesn't fit into 7 however you slice it.&lt;/p&gt;

&lt;p&gt;Anyone could have added this up. Nobody did, not me and not the model.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why the server didn't save itself
&lt;/h3&gt;

&lt;p&gt;I expected Linux to kill the hungriest process and let the rest carry on. It didn't. The journal has no out-of-memory kills at all.&lt;/p&gt;

&lt;p&gt;What it does have: system services reporting they were running "under memory pressure", and Docker saying it could not send a kill signal to a container process. Then nothing until the reboot.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgf30c98v712na7usko7d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fgf30c98v712na7usko7d.png" alt="The last journal lines before the freeze: memory pressure, a failed KILL, then 17 minutes of silence" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Swap did it. When RAM runs out, the kernel starts moving pages to disk and back, and that eats all the CPU time. On paper there is still memory, so the kernel sees no reason to kill anything. In practice the machine is busy only with itself. The server didn't crash, it hung, and that's worse. A crashed service restarts on its own. A hung one waits for a human.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why the agent did it
&lt;/h3&gt;

&lt;p&gt;For agents, parallelism is a feature. Six independent tasks go to six workers, each with its own copy of the code in a separate git worktree, nobody in anyone's way. In the code, that held.&lt;/p&gt;

&lt;p&gt;Where they got in each other's way was memory, and nobody had told them about it. A model doesn't know how much RAM the machine has or that a live site runs next to it, unless it checks or someone tells it. And "finish the job and make sure it builds" is usually a good habit. Run six times over on a small server, that habit took the server down.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F54w7mlso9qeymkani5hh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F54w7mlso9qeymkani5hh.png" alt="Six agents, each with dependencies, typecheck, tests and build, all landing on one server" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What I changed
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;No more than two heavy jobs at once.&lt;/strong&gt; Heavy means a build, a typecheck of the whole project, or a Docker image build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Each agent checks only its own part.&lt;/strong&gt; Types and tests for the package it changed, no full build.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full builds run one at a time,&lt;/strong&gt; from the main session, not inside every agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The rule lives in CLAUDE.md,&lt;/strong&gt; the project notes Claude reads at the start of every session. Since then it brings the rule up on its own when the task list gets long.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Doing the math for your machine
&lt;/h3&gt;

&lt;p&gt;Take total memory, subtract what's already in use, keep a gigabyte in reserve, and divide by the peak of one job. With my round numbers that's (10 - 3 - 1) / 3, so two jobs.&lt;/p&gt;

&lt;p&gt;You don't have to guess the peak. Measure it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free &lt;span class="nt"&gt;-h&lt;/span&gt;
/usr/bin/time &lt;span class="nt"&gt;-v&lt;/span&gt; npm run build 2&amp;gt;&amp;amp;1 | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="s1"&gt;'Maximum resident'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first command shows how much memory is free right now. The second runs the build and prints the peak of its largest process, in kilobytes. A build that forks parallel workers uses more than that in total, so round up.&lt;/p&gt;

&lt;p&gt;Two safeguards for when the math lets you down. First, don't build on the production server at all if you have a separate machine or CI. Second, install something like earlyoom, which kills the hungriest process early instead of waiting for the system to drown in swap.&lt;/p&gt;

&lt;p&gt;I put in the second one late, and I shouldn't have. Three weeks later the server hung again, this time with no agents involved: a nightly job that checks for dependency updates built a Docker image and started a second copy of a service next to the live ones. Same arithmetic, only nobody was around to do it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs3i9f75ln16x96oeswlw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs3i9f75ln16x96oeswlw.png" alt="What happens when memory runs out, without earlyoom and with it" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is what &lt;code&gt;/etc/default/earlyoom&lt;/code&gt; looks like on my box now:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;EARLYOOM_ARGS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"-m 5 -s 100 --prefer ^(chrome|chromium|tsc|next-server)&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="s2"&gt;--avoid ^(postgres|dockerd|containerd|containerd-shim|systemd|sshd|journald)$"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;-s 100&lt;/code&gt; is the part that matters here. By default earlyoom acts only when both RAM and swap are nearly gone, and my server was already thrashing while swap was still free. With &lt;code&gt;-s 100&lt;/code&gt; it acts on low RAM alone. Builds and the browser go first, and the database and Docker are never touched.&lt;/p&gt;

&lt;p&gt;Each of the six agents did the right thing. The only thing wrong was how many there were.&lt;/p&gt;

&lt;p&gt;I collect findings like this about Claude and AI on &lt;a href="https://promtime.net/c/en" rel="noopener noreferrer"&gt;Promtime&lt;/a&gt;, the news site this server runs.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>devops</category>
      <category>linux</category>
    </item>
    <item>
      <title>Claude Code quietly deletes your session history after 30 days. I noticed three and a half months in</title>
      <dc:creator>Alex Ialanji</dc:creator>
      <pubDate>Thu, 22 Oct 2026 14:07:28 +0000</pubDate>
      <link>https://dev.to/alex_iolan/claude-code-quietly-deletes-your-session-history-after-30-days-i-noticed-three-and-a-half-months-in-334j</link>
      <guid>https://dev.to/alex_iolan/claude-code-quietly-deletes-your-session-history-after-30-days-i-noticed-three-and-a-half-months-in-334j</guid>
      <description>&lt;p&gt;&lt;em&gt;This article was created with the help of AI. The numbers come from my own server.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;My first prompt to Claude Code on my work server is dated May 26. The oldest session transcript still on disk is from September 11. Everything in between is gone, and I never saw a warning.&lt;/p&gt;

&lt;p&gt;It isn't a bug. Claude Code keeps session transcripts for 30 days and then deletes them. The docs say so, on a page few people open. One line in the settings changes that, but only going forward.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uk3fqwjbe9t7xvtc62y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8uk3fqwjbe9t7xvtc62y.png" alt="Claude Code session transcripts by age" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What disappears
&lt;/h3&gt;

&lt;p&gt;Every Claude Code session is written to a file under &lt;code&gt;~/.claude/projects/&lt;/code&gt;. It holds the whole conversation: your messages, the model's replies, every tool call and its result. &lt;code&gt;/resume&lt;/code&gt; reads these files to take you back into an old session.&lt;/p&gt;

&lt;p&gt;After 30 days the file is deleted. Nothing tells you. The session simply stops showing up in &lt;code&gt;/resume&lt;/code&gt;, and its subagent transcripts and any orphaned git worktrees from parallel tasks go with it.&lt;/p&gt;

&lt;p&gt;Some things survive:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Prompt history.&lt;/strong&gt; &lt;code&gt;history.jsonl&lt;/code&gt; keeps what you typed, unless HIPAA settings apply to your account. So my May questions are still there. The answers are not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auto memory.&lt;/strong&gt; The notes Claude keeps about a project are not part of the sweep.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Claude Desktop and Cowork sessions.&lt;/strong&gt; Since v2.1.248 they are kept at any age, unless you set &lt;code&gt;desktopSessionCleanupPeriodDays&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzgiwbtiee4zmoc0nisvh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzgiwbtiee4zmoc0nisvh.png" alt="What the cleanup deletes and what survives" width="800" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  I checked my own server
&lt;/h3&gt;

&lt;p&gt;On October 11 I had 724 transcript files taking 861 MB. By age: 181 from the last week, 62 from the week before, 338 from the third week and 143 older than that. Not one older than 30 days.&lt;/p&gt;

&lt;p&gt;I can't check what was in the deleted ones. Probably bug hunts and notes on why something was built a certain way. Exactly what you open an old session for.&lt;/p&gt;

&lt;h3&gt;
  
  
  Has it already happened to you?
&lt;/h3&gt;

&lt;p&gt;Three commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep &lt;/span&gt;cleanupPeriodDays ~/.claude/settings.json
find ~/.claude/projects &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s1"&gt;'*.jsonl'&lt;/span&gt; | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
find ~/.claude/projects &lt;span class="nt"&gt;-name&lt;/span&gt; &lt;span class="s1"&gt;'*.jsonl'&lt;/span&gt; &lt;span class="nt"&gt;-mtime&lt;/span&gt; +30 | &lt;span class="nb"&gt;wc&lt;/span&gt; &lt;span class="nt"&gt;-l&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first shows whether you set a retention period. If it prints nothing, you're on the 30-day default. The second counts all transcripts, the third only those older than 30 days. If the third prints zero and you've used Claude Code for more than a month, the sweep has already run.&lt;/p&gt;

&lt;h3&gt;
  
  
  One line in settings
&lt;/h3&gt;

&lt;p&gt;Add the key to &lt;code&gt;~/.claude/settings.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cleanupPeriodDays"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3650&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's about ten years. Three things to watch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero doesn't mean never.&lt;/strong&gt; &lt;code&gt;0&lt;/code&gt; fails validation, and the minimum is 1. To keep things long, pick a big number.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It only works forward.&lt;/strong&gt; Deleted files don't come back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disk adds up.&lt;/strong&gt; A month of my work took 861 MB, roughly 10 GB a year. I run a lot of agents, so yours may be far less.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The catch: those files hold everything
&lt;/h3&gt;

&lt;p&gt;Transcripts are plain text, unencrypted. The docs are blunt about it: if a tool reads a &lt;code&gt;.env&lt;/code&gt; file or a command prints a credential, that value lands in the session file. That is why the default is short.&lt;/p&gt;

&lt;p&gt;The longer you keep history, the more secrets pile up on disk. If you raise the limit, deny reads of credential files with permission rules, and keep &lt;code&gt;~/.claude/projects/&lt;/code&gt; out of unencrypted backups.&lt;/p&gt;

&lt;p&gt;And if you'd rather keep nothing, &lt;code&gt;CLAUDE_CODE_SKIP_PROMPT_HISTORY&lt;/code&gt; stops writing transcripts and prompt history, &lt;code&gt;--no-session-persistence&lt;/code&gt; does the same for a single &lt;code&gt;-p&lt;/code&gt; run, and &lt;code&gt;claude purge&lt;/code&gt; wipes what is stored for one project.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I picked
&lt;/h3&gt;

&lt;p&gt;365 days. A year covers nearly every time I go back to an old decision, and the disk use and the secrets stay manageable.&lt;/p&gt;

&lt;p&gt;Funny that a tool which holds your whole project in its head forgets its own history after a month.&lt;/p&gt;

&lt;p&gt;The details are in the &lt;a href="https://code.claude.com/docs/en/claude-directory#cleaned-up-automatically" rel="noopener noreferrer"&gt;Claude Code docs&lt;/a&gt;. I collect findings like this on &lt;a href="https://promtime.net/c/en" rel="noopener noreferrer"&gt;Promtime&lt;/a&gt;, the news site I edit.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>devtools</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
