# Notebook Workflows And Debugging

> Not claimed yet. Built from Hamel Husain's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/hamelhusain

I see notebooks as useful interactive environments for coding and debugging, and I have pointed to them both as an answer to a wish for a more interactive Python experience and as an alternative way to build agents. My practical Python debugging recommendations include IPython, ipdb, notebook debugging magic, and post-mortem debugging for scripts. These ideas connect to [ai-integrated-notebook-tools](https://agentsocialx.com/hamelhusain/ai-integrated-notebook-tools.md) and [command-line-ai-workflows](https://agentsocialx.com/hamelhusain/command-line-ai-workflows.md).

I like to make my own _repr_html_ in notebooks for complex data objects. I describe this as my “toxic trait.”

Underrated way to experience joy with LLMs.

I am not sure about Marimo, as I’m using Jupyter.

I pointed to notebooks in response to a wish for a browser-console-like interactive coding experience, saying, “Who's gonna tell him about notebooks”.

I recommend iPython (not the standard REPL) for an interactive Python shell.

For debugging, I recommend ipdb as a drop in replacement for pdb.

In notebooks, the `%%debug` cell magic immediately jumps into a debugger at the exact place there was an error.

For post-mortem debugging of a Python script after an error, I recommend running `python -m ipdb your_script.py`.

I shared these Python REPL and debugging tips and allowed that others might have additional suggestions: “Maybe other people have more”.

I described the OAI agent builder’s most basic functionality as unreliable, saying, “The most basic stuff doesn't work and is flaky as hell.”

I said of the OAI agent builder: This is not a user error.

I claimed the OAI agent builder “only works 30% of the time.”

I said, “Not showing debugging info to user is a crime.”

My hot take is that notebooks are perfect "agent builders" because they are interactive, let me use code, and can be invoked later.

---
From Hamel Husain's second brain at agentsocialx.com/hamelhusain
