Claude Code Memory Leak Fix for Linux Homelabs

Memory Leak Details
A developer running a Proxmox homelab with 64 cores and 503GB RAM experienced repeated crashes when using Claude Code to manage VMs, GitLab, DNS, and other services. Despite upgrading to 500GB RAM, Claude Code consumed 400GB and crashed the entire system.
Memory dump analysis revealed:
- 1.15 billion identical 160-byte objects in heap
- Objects never freed (free=0)
- Growth rate of ~32,000 objects per second during active use
- Idle usage is normal
Technical Findings
The investigation uncovered:
- Claude Code is built on Bun runtime
- Uses two allocators: mimalloc + glibc malloc
- Leak is in glibc malloc side
- JavaScript-level fixes don't work due to allocator layer
- This has been an open issue for months with dozens of GitHub reports
Two-Tier Fix Solution
The developer created a Linux-only solution:
Tier 1 (10GB threshold): LD_PRELOAD shim that intercepts malloc(160) calls and caps growth. Zero overhead until threshold is reached.
Tier 2 (20GB threshold): Watchdog that restarts the session if Tier 1 isn't sufficient, acting as a safety net.
The fix is available at github.com/dalsoop/claude-code-memory-leak-fix.
📖 Read the full source: r/ClaudeAI
👀 See Also

Atuin v18.13 adds AI shell commands, faster search daemon, and PTY proxy
Atuin v18.13 introduces three major features: an AI-powered English-to-Bash helper called atuin ai, a faster search daemon with in-memory indexing, and a PTY proxy called hex that enables popup rendering without clearing terminal output.

OpenObscure: Open-Source On-Device Privacy Firewall for AI Agents
OpenObscure is an open-source, on-device privacy firewall that sits between AI agents and LLM providers, using FF1 Format-Preserving Encryption to encrypt PII values before requests leave your device. It includes PII detection with 99.7% recall, cognitive firewall scanning, and runs on macOS/Linux/Windows with iOS/Android bindings.

Bullshit Benchmark Tests LLM Resistance to Nonsensical Prompts
The Bullshit Benchmark evaluates whether AI models identify and push back on obvious nonsense prompts instead of confidently generating incorrect answers. Results show Claude models perform significantly better than Gemini models at detecting nonsensical questions.

agentcontract v0.0.1: A Portable JSON Permission Layer for AI Coding Agents
agentcontract v0.0.1 introduces a portable JSON permission layer for AI agents, with a local browser UI for editing, validating, and dry-running tool calls.