← all loops

loop_007 · [agents] · · 11 min read

Replacing n8n with Claude Code and a CLAUDE.md file

Workflow builders are great until your workflow is "think for four minutes, then write 2,000 words."

Our long-form content pipeline kept dying on API timeouts. So I threw out the workflow builder and gave an agent persistent memory instead. Here's the architecture, the failure modes, and the numbers after 30 days.

The core problem with node-based execution environments is their rigidity in the face of non-deterministic processes. When an LLM decides it needs to execute an external tool, fail, re-read documentation, and try again, modeling that in a DAG becomes an exercise in drawing endless spaghetti webs of error-handling nodes.

Instead of telling the system how to move data, we shifted to telling it where the rules are stored. The entire orchestration layer collapsed into a single shell command and a perfectly tuned markdown file.

Where the pipeline kept breaking#

Initially, we had a 40-node setup. Extract RSS, clean text, summarize, draft sections, compile. Every API hiccup meant manual intervention. We needed a way to provide context to a persistent agent session. The solution was surprisingly brutalist.

bash
# The new orchestrator is literally just this
cat payload.json | claude "Execute the routine defined in CLAUDE.md for this data. Output only the final markdown file path."

The magic isn't in the command; it's in the memory structure. By keeping a local file that the agent is forced to read on initiation, we offload process state from the runner to the agent itself.

"An agent with a memory file beats a workflow with twenty nodes, but only if you version the memory."

To visualize the difference in complexity, consider the architecture delta:

CLAUDE.md
fig. 01 - pipeline before / after
Line chart comparing pipeline reliability over 30 days: the n8n workflow declines while the CLAUDE.md agent stays above 99%
fig. 02 - execution reliability, 30 days

We cut infrastructure costs by 80% and execution reliability jumped to 99.4%. The only downside is that you have to write system prompts that are basically legal contracts.