HN
Today

Accidentally created my first fork bomb with Claude Code

A developer's journey into agentic AI takes an unexpected turn, culminating in an accidental Claude Code fork bomb that bricks their machine and nearly racks up a $3800 API bill. The author details their reluctant embrace of AI coding, showcasing the custom 'skills' and hooks they built to wrangle Claude's eccentricities and optimize their workflow. This post resonates on HN for its candid look at real-world AI development challenges, highlighting both the power and pitfalls of integrating large language models into daily programming tasks.

4
Score
0
Comments
#7
Highest Rank
3h
on Front Page
First Seen
Mar 31, 5:00 PM
Last Seen
Mar 31, 7:00 PM
Rank Over Time
28711

The Lowdown

The author recounts a chaotic workday start, discovering their computer frozen and hot, realizing they'd inadvertently unleashed a fork bomb via a Claude Code hook. This technical mishap, which ran overnight, nearly led to a hefty API bill and provided a stark lesson in AI system interaction.

  • The incident stemmed from a SessionStart hook designed to spawn two background Claude Code instances, which recursively multiplied, consuming all system resources.
  • Debugging revealed hundreds of Claude Code processes, quickly identifying the recursive spawning as the cause of the system freeze.
  • A crucial factor preventing a much larger API bill was Claude Code's "shitty" and bloated architecture, where each instance consumed so much memory it crashed the system before excessive API calls could be made.
  • The author's journey into agentic AI began reluctantly, driven by a desire not to be left behind, leading them to experiment with Claude Code and integrate it into their nvim/tmux workflow.
  • They developed several custom "skills" to combat Claude's limitations, such as /yadumb for logging failed commands, /memento for conversation history, and /yablind to efficiently manage the context window.
  • Other notable skills include /adhd for personalized task management and /money for maintaining project-specific context due to Claude's poor memory.
  • The story also details PreToolUse and PostToolUse hooks for logging Bash command executions and their statuses. This firsthand account offers a humorous yet insightful look into the frustrations and ingenuity involved in working with nascent AI coding agents, demonstrating how even "bad" software can sometimes inadvertently save the day.