How I AI – Advanced Claude Code Techniques: Context Loading, Mermaid Diagrams, Stop Hooks, and More
Host: Claire Vo
Guest: John Lindquist
Episode Date: January 26, 2026
Episode Overview
In this episode, Claire Vo welcomes John Lindquist (educator, founder at Egghead.io, AI superuser) for a deep dive into advanced workflows with AI-powered coding assistants—specifically Anthropic’s Claude Code. The discussion is aimed at senior engineers and technical leaders eager to push beyond entry-level usage. John demonstrates practical techniques such as context preloading with diagrams, defining efficient terminal aliases, customizing automated quality hooks (stop hooks), and scripting custom command line interfaces (CLIs) for creative AI-driven engineering and documentation.
Key Discussion Points & Insights
1. Preloading Context: Using Diagrams and Structured Files (Mermaid Diagrams)
[00:15], [04:09], [04:37], [07:53]
-
Why Context Matters:
LLM-powered dev tools (like Claude) start from scratch with every session, unaware of codebase connections unless provided up front. Loading relevant context—especially as diagrams—drastically improves response quality and speed."Every time an AI starts, it has no memory, no idea of what's going on in your application... so you get a lot of really bad edits because it doesn't understand if it modifies A, how does that impact B."
—John Lindquist [04:37] -
How to Structure Context:
- Use a
/memorydirectory in your repo for markdown files rich with context (e.g. agents, flows, diagrams). - Mermaid diagrams compress complex flows into compact, AI-readable text—ideal for LLMs to digest, even if they’re visually overwhelming for humans.
- Preload all these markdown files into Claude at session start using terminal commands and the
append system promptoption.
- Use a
-
Benefits and Trade-Offs:
Fast, contextually-accurate outputs; the downside is increased upfront token usage."The time that you spend on these tasks is more valuable than that to me."
—John [08:51]
Notable Workflow Example:
- Command:
Concatenate all markdown/diagram files and pass them to Claude via theappend system promptbefore giving user instructions.
2. File Types as AI Context Containers
[10:31], [12:16], [13:08]
- Markdown, JSON, and diagram formats now serve double duty: they help bridge human/AI understanding and make structured context ingestion more effective.
- Non-code file types (including images or video with embedded metadata) are increasingly useful; John mentions using Gemini to process full workshop videos, extracting FAQs and highlights.
3. Automating Documentation & Diagrams
[13:59], [15:10], [16:17]
- Diagrams aren’t just for internal clarity—they address external demands, e.g. security & compliance (SOC2), customer support flows.
- John and Claire automate diagram/doc generation on PR closure (via GitHub Actions), ensuring up-to-date, always-relevant assets for both humans and AI workflows.
"You can really pull the thread on documentation from one asset... It can start to become customer facing and all sorts of interesting things."
—Claire [17:05]
4. Efficient Aliases and Custom Commands in the Terminal
[19:28], [20:31]
- Using short aliases or project-specific command shortcuts accelerates workflow ("live dangerously" mode for full permissions, diagram-loading mode, etc.).
- Discusses feasibility across platforms (Mac ZSH, Windows PowerShell) and tailoring per-project or per-context.
5. Bespoke Command Line Tools with AI Backends
[21:05], [23:30]
-
John builds small tools (like Sketch), using Gemini via CLI scripts—generating website mockups, theme variations, and more.
- This approach leverages constrained, distraction-free terminal UIs for rapid iteration and automation.
"If you were creating like a little WYSIWYG walkthrough web editor thing here... I would have gotten really distracted about how it looks... I actually like the constrained UI space for speed..."
—Claire [23:30] -
Encourages a "just build it" philosophy and using dictation for fast idea capture.
"You have nothing, you can’t iterate on nothing."
—John [25:49]
6. Claude Code Stop Hooks: Automating Quality Control and Actions
[26:58], [31:22]
-
What Are Stop Hooks?
Custom scripts triggered when Claude "stops" (thinks work is done).
Examples:- Run type checks (e.g., TypeScript errors)
- Auto-fix linter/code issues
- Automatically commit clean code
-
Workflow Example:
If errors exist after code generation, the hook sends the error report to Claude for revision before proceeding. -
How it Works:
- Define hooks in project settings (
settings.local.json) - Script determines if files changed; runs checks; communicates outcomes to Claude via JSON
- Can add project- or team-wide hooks for standardized quality gates
"So we set up this workflow of once a conversation is finished, check to see if any files have changed... And if there are none, then go ahead and commit. And this saves you a lot of the overhead in your mind of here’s all this extra stuff I have to do once something’s done."
—John [29:50] - Define hooks in project settings (
Expanded Use Cases for Hooks
[36:55], [38:15]
- Formatting, pre-commit linting, import checks, circular dependencies, code duplication detection—all are candidates for automation via stop hooks.
- These hooks are widely applicable, even outside code:
"These post tool call hooks or post stop hooks in Claude can also be used when you're working on non code. ...what do I want automated after Claude finishes writing my document?"
—Claire [38:15]
7. Bridging CLI, IDE, and AI Interfaces
[41:13], [42:26]
- Both command-line tools and IDEs (like Cursor, VS Code) have a place in AI engineering workflows.
- CLI excels at launching specific, highly-configured sessions or quick prototypes; IDE integrations allow in-depth per-file or per-line editing and deeper extension ecosystems.
"For one IDE to stand out above the other, they have to separate themselves... people are not going to give you much time to convince them."
—John [44:49]
8. Making the Case for AI Coding Tools in Skeptical Organizations
[45:35], [46:32]
-
Senior engineers should view AI tools as virtual junior engineers:
- Automated code exploration, history tracing, risk analysis, and context summarization.
- AI can handle the "drudgery" and surfacing of unknowns, accelerating onboarding and issue triage.
"Everything I just said over the past 30 seconds is a prompt, which I could have just dictated, right? ...It blows my mind that people be hesitant for those sorts of tools."
—John [48:25] -
Don’t focus on task-level automation but on scaling optimal, not just minimal, workflows.
9. Additional Insights, Notable Quotes & Memorable Moments
-
On Editing vs. Authoring
"It's easier to edit than author. So let's get the authoring out of the way..."
—Claire [26:28] -
On Better Commit Messages
"Commit messages used to be like second attempt or like please work word swear words."
—John [51:11] -
On Resetting When Claude Goes Off the Rails
"Start over from ground zero and revising your original prompt is better than trying to steer it to where you are when you've drifted so far away."
—John [52:23] -
On Planning Mode
"The recent planning modes that have been released with Claude code and cursor... have eliminated a vast majority of that drift."
—John [54:55]
Timestamps for Key Segments
- [00:15] – Why context is critical for AI coding tools
- [04:37] – Using mermaid diagrams for compressed, machine-friendly context
- [08:51] – System prompt techniques to preload context
- [13:59] – Automated documentation/diagram workflows in dev cycles
- [19:28] – Creating and using terminal aliases for rapid contextual setup
- [21:05] – Building AI-driven CLI tools for creative ideation
- [26:58] – Stop hooks: automating quality checks after Claude code execution
- [36:55] – Examples: additional quality gates and checks via hooks
- [42:26] – IDE vs. CLI: strengths and use cases
- [46:32] – Making the AI coding case for skeptical senior engineers
- [52:23] – What to do when AI output is off course
- [54:55] – Improvements from planning modes in Claude and Cursor
Summary of Actionable Techniques
- Structure context directories in your repo (
/memory) with markdown and diagrams for AI preloading. - Automate documentation generation via CI/CD hooks (e.g., on PR close).
- Leverage terminal aliases and custom CLIs for context-driven, fast sessions.
- Define stop hooks for quality automation: type checks, linting, formatting, and custom project logic feeding natural-language corrections back to Claude.
- Consider both CLI and IDE workflows; optimize each for your use case.
- For org-wide efficiency, make common hooks/settings reusable and standardized.
- Encourage engineers to embrace AI tools as "infinite juniors"—optimizing not only for code writing but also context gathering, history tracing, documentation, and code health.
- When workflow drifts, restart or bring in a “second-opinion” AI for fresh assessment.
Where to Find John Lindquist
- Egghead.io (AI engineering courses & workshops)
- Newsletter: AI Dev Essentials
- X (Twitter): [@johnlindquist]
- Workshops: Reach out for hands-on advanced AI tooling training
"My workshops are fun and we go way deeper into this super advanced stuff."
—John [55:22]
If you want to level up your AI coding toolkit—especially on big, complex projects—this episode is a practical, idea-rich, and inspiring resource.
