Enchanted forest workshop scene with bearded gnomes gathered around ancient scrolls filled with crossed-out plans and lessons learned, some gnomes scratching their heads in confusion while others nod wisely. A friendly blue AI spirit (Claude Code) hovers patiently above, emanating soft golden light that illuminates floating error messages transforming into butterflies. Magical chalkboard shows 'Plan Mode' in glowing runes, with broken gears being carefully repaired, symbolizing learning from mistakes

An Anthropologic Approach to Coding : Field Notes on Failure

Lessons learned from failures with Claude Code - from abandoned plans to lost work, each mistake taught me valuable insights about AI-assisted development

Nello D'Andrea
Nello D'Andrea
8 minutes to read

Every new tool, and Claude Code is a tool, especially when it has significant impact, requires us to adapt. While the entry barrier for interacting with LLMs is perceived to be low, since they can interact easily in natural language with us, we are still required to learn and to adapt. In this post, I will share how I started learning, focusing particularly on the various problems I encountered. Lessons learnt!

Table of Contents

Introduction

Still in 1984, I just found my “Basic Plus Encyclopedia” from my youth. I was one of those rare few going every week to the local newsstand to grab the latest issue about computers and read it avidly. At that time, computer information was sparse, so you could easily absorb everything new within a couple of hours. The first publication already asks the question (translated from French): “Computer, intelligent machine?” The article spans multiple pages, but you can already read that programming is compared to conditional reflexes. It looks like humans have already tried to replicate their intelligence.

A page from the first issue of the 'Basic Plus Computer Encyclopedia' from 1984, showing an article titled 'L'ordinateur, machine intelligente?' (Computer, intelligent machine?) with text discussing programming as conditional reflexes, and a photo of a 1980s computer store interior below

Entering the AI Coding Era

I started using Claude Code on an ambitious personal project. While I was aware of setting a goal that I might not reach, partly because I failed on this particular idea a couple of times before, I decided to make it even more ambitious. The project was about automating specific coding tasks with an LLM. The ambitious idea was that the tool would be able to adapt itself to new patterns/problems and update its own code. A fantastic idea, isn’t it?

To be straightforward: I abandoned that self-modifying code idea. However, the LLM-based tool I built with Claude Code turned out to be impressive, even if not perfect.

Let’s focus now on my lessons learnt.

Initial Enthusiasm

Before starting with Claude Code, I watched a couple of videos on YouTube about it. So I had a personal project which didn’t work as expected and this super new AI Assistant: Claude Code. I just prompted it what the project was about and what I would want to achieve.

Claude Code was so kind and found that my project was great. It immediately started updating my code, and I thought “that’s it, I’m done!” I was in admiration - it seemed so easy.

Until I discovered it wasn’t so easy. My project eventually wouldn’t compile anymore, or it wouldn’t work as I thought it should, or Claude would forget to update and align parts of the logic…

Lesson learnt 1

I now always use Plan Mode (cycle with Shift+Tab to set Claude in Plan Mode).

The Claude Code text mode with Claude Code in Plan Mode

Lesson learnt 2

I read the plan Claude Code is making for me and iterate as long as it isn’t clear and doesn’t perfectly describe what Claude Code should achieve.

I ask Claude Code to:

  • explain its plan
  • show me what it would change
  • think about it more deeply, meaning Claude Code will take more time to refine its plan
  • modify its plan (add/remove steps, analyze further solutions)

A typical plan takes 3-5 iterations until I let Claude Code modify the code, but it could easily go up to about 10 iterations.

Lesson learnt 3

I abandon the plan when I see that it is going the wrong way. I just stop the planning and tell Claude Code: “Forget about this plan, I have a new idea.” Then I describe my idea, or just go for a walk with my dog.

Flowchart showing Claude Code's Plan Mode iteration process. Starting with entering Plan Mode, Claude creates an initial plan, followed by a review cycle that typically takes 3-5 iterations. At a decision diamond asking 'Plan Good?', the flow branches: 'No' leads back to requesting changes (with a dotted line showing the iteration loop), while 'Yes' proceeds to execute the plan. Statistics at bottom show: 3-5 typical iterations, 10+ for complex cases, and infinite patience from Claude.

Non-deterministic

A word I barely used before LLMs entered into my coding life, which I now always have to remember - and I stumbled hard on this several times. LLMs by design may produce varied output when the input differs slightly, or when parameters like the temperature are not set correctly.

Lesson learnt 4

I always keep this in mind and try to reduce the non-deterministic aspect of the LLM or force it to perform those actions I require by controlling the temperature and mostly through prompt engineering (adding those “CRITICAL”, “YOU SHOULD ALWAYS”, …). I would wish to have the power of an LLM and its “intelligence” without its creativity…

Give me the permissions

I never used the flag “dangerously-skip-permissions”. That means Claude Code prompts me when it executes shell commands, reads files outside of the current folder, or accesses the internet. But I sometimes forgot to read what Claude Code asked me to accept.

Hint When you have accepted a plan, Claude Code’s mode changes to “accepts edits on”, it will not prompt you for modifying code files.

Lesson learnt 5

I now always review carefully what Claude Code is prompting me to execute and stop it if I am not sure about it or if it is wrong.

Hint: File/folder deletion or a git reset --hard are quickly done but may be painful to undo. Both happened to me. That’s not Claude Code’s fault - it’s mine, because I acknowledged the commands.

/init and the missing /update

At the very beginning, I just skipped creating the CLAUDE.md file which provides the grounding for Claude to understand your solution. Why bother waiting for the file to be created when it may cost tokens?

But this file gives important context for Claude Code and should be present in each repo, especially when you work cross-folder with more than one solution simultaneously.

Lesson learnt 6

Always start with /init to provide Claude with context about your solution. Then review the CLAUDE.md file and either:

  • Extend the knowledge of Claude using a CLAUDE.local.md file
  • Modify the CLAUDE.md file with your knowledge between some text marker so your knowledge doesn’t get removed when you update the CLAUDE.md file

Lesson learnt 7

Update your CLAUDE.md file regularly. A CLAUDE.md file is static, so when your solution grows - which can grow quickly when you work with an AI assistant like Claude Code - you should update this regularly.

Here is a quick prompt which you can use to update your CLAUDE.md files and grab a coffee until it is finished:

# Instruct Claude Code to update CLAUDE.md files protecting text between a specific marker
# Depending on your solution type, you may need to adapt the kind of files it processes
claude --print --verbose --permission-mode acceptEdits 'For each subfolder with a CLAUDE.md file:
  1. Run: find . -type f -newer CLAUDE.md -name "*.ts" -o -name "*.js" -o -name "*.json" -o -name "*.md" | grep -v CLAUDE | head -1
  2. If any files found (meaning they are newer than CLAUDE.md):
     - Regenerate CLAUDE.md project documentation
     - Keep sections between <!-- CUSTOM-START --> and <!-- CUSTOM-END -->
     - Update timestamp in metadata
  3. If no newer files found:
     - Skip and log: "CLAUDE.md is up-to-date for [folder]"

Writing Chat History

Sometimes something may crash (Terminal / VS Code, …) and the current chat history is lost. I mostly work with various VS Code instances, so remembering everything is quite difficult.

Lesson learnt 8

When I find myself in a very specific chat session that I want to save, I use “/export” to save the current state. It exports everything from my prompts to Claude’s answers, but without the colouring.

Writing Git History

Working with Claude Code means iterating fast on code changes. I found myself wanting to sometimes go back through the history of the changes which was not possible because it was not committed.

Lesson learnt 9

Commit to git as soon as you have taken a step in your implementation. This will allow Claude Code to leverage the commit history in order to understand the changes and be able to try another approach or analyze when something went wrong.

Grid of 9 lessons learned from Claude Code failures, numbered 1-9. Lesson 1: Always Use Plan Mode (Shift+Tab). Lesson 2: Iterate the Plan (3-5 iterations typical). Lesson 3: Know When to Quit. Lesson 4: Embrace Non-Determinism. Lesson 5: Review Permissions. Lesson 6: Start with /init. Lesson 7: Update CLAUDE.md. Lesson 8: Export Chat History. Lesson 9: Commit Often. Each lesson includes a brief description and icon.

Conclusion

Working with Claude Code has been a journey of discovery, filled with both triumphs and failures. Each mistake I’ve made has taught me something valuable about how to better collaborate with this AI assistant. The lessons I’ve shared here - from always using Plan Mode to carefully reviewing permissions - weren’t learned from documentation or tutorials. They came from real mistakes, lost work, and moments of frustration.

But that’s exactly how we grow as developers. Every new tool demands that we adapt our workflows and challenge our assumptions. Claude Code is no exception. What makes it special is its patience and consistency - it never gets frustrated when I iterate on a plan ten times, never judges when I abandon an approach, and is always ready to help me try again.

The most important lesson? Embrace the iterative nature of working with Claude Code. Use Plan Mode religiously, protect your custom documentation, and always read what you’re accepting. These aren’t just best practices - they’re the guardrails that transform Claude Code from a potentially chaotic assistant into a reliable partner.

As I continue this anthropological journey with Claude Code, I’m sure I’ll make new mistakes and learn new lessons. That’s not a bug; it’s a feature of the learning process.