🪝 Lesson 7 of 11 · 03:10:22 → 03:33:48

Hooks, Skills & the Ralph Loop

Intercept the agent's lifecycle and encode reusable expertise.

What you'll learn

  • Manage context with compaction and conversation forking
  • Wire user-prompt, tool-use, and stop hooks into your workflow
  • Choose between skills and plugins and run a Ralph loop

In a nutshell

Intercept the agent's lifecycle and encode reusable expertise.

A richer, curated recap and references for this lesson are being prepared.

Key concepts

Compaction
Conversation Forking
User Prompt Hook
Tool Use Hook
Stop Hook
Ralph Loop
Skills vs Plugins
Custom Grammar Interceptors

Make it stick

Interactive exercises, a quiz, and hands-on challenges for this lesson are being prepared.

Moments worth pausing on

Screens captured from this part of the workshop — click any to open full size.

Dark terminal/conversation context during the post-lunch compaction discussion.
Terminal prompt area during the setup for explaining user prompt, tool use, and stop hooks.
Terminal/file-list view before the browser documentation walkthrough fully appears.
OpenAI Developers Hooks documentation page with the MarkSnip extension overlay visible.
Terminal view rendering generated hook/project instructions and script text.
Terminal prompt context while preparing the custom #human hook trigger example.
Split workspace with terminal logs on the left and a live typing-game dashboard in the browser.
GitHub repository view for johnlindquist/better-plugins showing plugin folders.
GitHub repository view inside better-plugins, showing individual plugin/script files.

Questions from the room

Do you have any ideas on how to create levers for agents so they can do big data stuff without having all the data in their context?rosa
not separately captured; see chunk final reconciliation.
i saw you use /compact, when do you use this skill? what is the skill?Tyler Newman
not separately captured; see chunk final reconciliation.
are you organizing your general knowledge somehow? pulling in meeting transcripts, emails, conversations with agents, and organizing them in such a way to retrieve them later as needed, agents having access to all, but perhaps synthesizing (basic memories) and mining for insights... i saw earlier you use pieces mcp, bee.computer, etc...Tyler Newman
not separately captured; see chunk final reconciliation.
Hey John, I am finding some of the back and forth content hard to follow, I am coming from using Cursor and wanting to get to grips with the more advanced features offered by Codex. Maybe I should have read the description and understood this is maybe more advanced than I was expecting. Is it possible, if appropriate to do a bit more context setting in the 2nd half. Thank youKelly
not separately captured; see chunk final reconciliation.
John do you subscribe to this idea that the context window has a smart zone (first 100k tokens) and dumb zone and to try and keep the work in the smart zone? If so how do you keep the /goal sessions in the smart zone? I have noticed long running goals really chew through tokens which makes me think there might be context management sacrifices being made to unlock long running tasks.rosa
not separately captured; see chunk final reconciliation.