Menu

Post image 1
Post image 2
1 / 2
0

CLAUDE.md for Elixir: 13 Rules That Make AI Write Idiomatic, OTP-Aware Elixir

DEV Community·Olivia Craft·20 days ago
#lBOo1H2J
#rule#elixir#claudemd#ai#fullscreen#function
Reading 0:00
15s threshold

Elixir has a sharper gap between working code and idiomatic code than most languages. AI assistants can write Elixir that compiles and passes tests — but misses the OTP patterns, function head dispatch, supervision trees, and pipe conventions that experienced Elixir developers use as a matter of course. The result: code that works in dev, breaks under load, and doesn't behave like the Elixir ecosystem expects. A CLAUDE.md at your project root closes this gap. Here are the 13 rules with the highest impact. Rule 1: OTP first — processes, not objects This is an OTP application. Model concurrent behavior with: - GenServer for stateful processes - Supervisor for fault tolerance and restart strategies - Task for one-off concurrent work - Agent for simple shared state (prefer GenServer for anything non-trivial) Do NOT model concurrency with shared mutable state, mutexes, or global variables. The process is the unit of concurrency and isolation.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More