inflearn logo

Claude Code Harness in Practice — 14 Steps to Make AI Remember, Follow Rules, and Self-Verify

Instead of writing longer prompts, I create rule files, logs, permissions, hooks, and validation routines one by one whenever something goes wrong in a real project. With a news alert bot that I actually built and deployed to a server in five days, 211 screenshots and 87 instructions exactly as originally written.

5 learners are taking this course

Level Intermediate

Course period Unlimited

JavaScript
JavaScript
PostgreSQL
PostgreSQL
Business Productivity
Business Productivity
AI
AI
claude
claude
JavaScript
JavaScript
PostgreSQL
PostgreSQL
Business Productivity
Business Productivity
AI
AI
claude
claude

What you will gain after the course

  • Rule files and record structures that keep a new session from forgetting yesterday’s decisions (CLAUDE.md, fact files, thought records)

  • Permission files and hooks that prevent a session from doing what it shouldn’t, and how to verify that it’s really blocked

  • A verification routine and deployment skills that don’t take “done” on faith, but verify through commit, service, and run logs

  • A bot that actually runs on a server, reading the news every hour, sending keyword-related articles via Telegram, and sending an AI summary in the morning.

16 video lessons (approximately 1 hour 20 minutes) + text lessons — 282-page PDF, 211 screen captures, 87 original instructions, practice repository made public

Each chapter begins with a video lesson featuring real work screens and visual explanations. The orientation, Lesson 0, and Lesson 1 are available as free previews. This course is for those who want to go beyond vibe coding and properly use Claude Code as a productivity tool for work.

Instead of writing longer prompts, build one safeguard at a time whenever something goes wrong

Anyone who has used Claude Code for a few days runs into the same three problems. A new session today doesn’t know the rules you set yesterday. It does what you told it not to do. It says, “Completed,” but when you open it, it isn’t done. If you’ve ever tried and failed to fix these three issues by writing longer prompts, this course is for you.

This course is not a theoretical book. Starting from an empty folder, you will build a bot that actually runs—a bot that reads RSS feeds from 20 news outlets every hour, sends only articles matching your keywords to Telegram, and delivers an AI summary report every morning. Claude Code writes all the code. The author’s role was to give instructions and turn each problem into a single line of rules. All 87 of those instructions are included verbatim in the practice repository, and all 211 screenshots are from actual terminal screens.

Every chapter has an incident. A new session nearly overturns yesterday’s decision (Chapter 1), a display number determines what gets stored (Chapter 2), one dead feed brings everything to a halt (Chapter 3), a session writes an uncounted number as fact (Chapter 4), the deployment light is green but no alert arrives (Chapter 5), someone else’s server gets hit 18 times per second (Chapter 6), what was believed to have been ‘blocked’ leaks out (Chapter 7), the system quietly dies when the database connection drops (Chapter 8), the rules file grows to 503 lines (Chapter 9), a summary made in nine seconds becomes nine Telegram messages (Chapter 10), we hear “deployed” three times, but the server is still running the old code (Chapter 11), and 17 sentences in the record become outdated in a day (Chapter 12). We also recorded the incidents that were planned but never happened.

Each incident leaves behind one harness. A rules file (CLAUDE.md), incident records and fact files, data decision documents, permission files, hook sets and git hooks, deployment skills, a set of verification routines, a ledger of requests and costs, and a record linter. In the final chapter, these are organized into seven elements, distinguishing what should be put in place on the first day from what only gets created after an incident occurs.

Learn through 16 video lessons and text. Each chapter begins with a video lesson (about 1 hour and 20 minutes), accompanied by a 282-page PDF (Chapter S, Chapters 0–13, and Appendices A–G) and class notes. Practice repository: https://github.com/JCLab-coder/news-radar (public, code licensed under MIT, chapter tags ch00–ch12).

After completing the course, you’ll be able to build a deliverable like this

  • A bot that actually runs. It reads the news every hour on a server (Railway), sends only the articles matching my keywords via Telegram, and delivers an AI-generated summary report every morning. Just change the keywords and you can use it as is.

  • One harness. One rules file, 23 project documents, one permissions file, one skill, three Claude Code hooks and one git hook, and ten scripts. The full contents of the files and templates for other projects are included in the appendix.

  • One habit. The habit of turning an incident into a one-line rule. You may eventually stop using the bot, and you’ll rewrite the rules file for each project, but this habit will remain.

First Telegram alert (1 page)

Only articles matching the keywords, with their titles and links. This is also when I learn to split the 4,096-character limit into line-by-line messages.

AI Summary of the Morning Report (Chapter 10)

It summarized 87 items in 9.2 seconds, and the next incident was “nine Telegram messages.”

The format of 'uploaded' (Chapter 11)

A commit, a service, and an episode log must all be in place for it to count as “uploaded.” The report service is still “uploading” until the next morning.

The repository as of Chapter 13

docs/facts, docs/lessons, scripts/hooks, .claude/skills — these mechanisms, rather than the code, are the true core of this repository.

  • You can directly build the rule files and record structure that keep a new session from forgetting yesterday’s decisions — CLAUDE.md for rules only, fact files containing evidence and measurements, incident records, and data decision documents.

  • You can use permission files and hooks to prevent the session from doing what it is not supposed to do, and verify with mock inputs that it is truly blocked instead of simply trusting that it was “blocked.”

  • You can solidify the verification routine that “it’s done” must be accompanied by a commit, a service, and a run log through deployment skills and scripts.

  • We understand why you should set limits and a ledger first when calling someone else’s server and paid APIs, from incidents involving 18 requests per second and nine Telegram messages.

  • Knowing that records become outdated in a day, you can create a structure that checks them again with a linter by attaching a verification command to every factual statement.

Learning Content

  • 14 stages (Chapters 0–13), plus a preparation chapter S and seven appendices. Each chapter proceeds in the order of mistake → cause → rule → verification. This is not a book that introduces features one by one; instead, the problem comes first and the mechanism follows, so it should be read in order.

  • Every chapter includes session screen captures and the instructions the author actually entered (P numbers), along with a reader checklist at the end of the chapter.

Chapter 1 — Where the First Rules File, CLAUDE.md, Was Created

Section 1. Preparation and Part 1 — Making Sure It Isn't Forgotten (Chapters S, 0–2)

Only create the materials needed specifically for this project. In the first session without a rules file, you see the same instructions being structured differently every time; in a new session that knows nothing about yesterday, the first rules file emerges, and in a place where display numbers were determining storage, a data decision document is created.

Section 2. Part 2 — Making the Rules Stick (Chapters 3–7)

The first verification routine comes from a single dead feed bringing everything to a halt; incident records from writing down numbers that were never counted; deployment skills from a deployment where the light was green but no alerts came through; caps, ledgers, and permission files from hitting someone else’s server 18 times per second; and hook sets and git hooks from “blocked” leaking out.

Chapter 7 — The Chapter Where Hooks Prevent Access to .env

Chapter 11 — Every Hour, the Service Was Running Old Code

Section 3. Part 3 — Making It Validate Itself (Chapters 8–11)

When the database disconnected, it quietly died; from that came a failure-handling framework and a run limit. From the rules file that grew to 503 lines came the separation of four records and a reporting service. From nine Telegram messages came a cost ledger and a daily cap. From “it was deployed” three times while the server was running old code came a third verification routine that marks commits on the 🏁 line.

Sections 4 and 5. Operations and Retrospective, Appendix (Chapters 12–13, Appendices A–G)

In a single day, a record lint is created from 17 outdated records, and the final chapter summarizes the seven elements of the harness and 'what to put in place on day one if building it again from scratch'. The appendices include the full text of CLAUDE.md, five templates, the full hooks and scripts, 20 incident→rule tables, 52 checklists, reference materials and copyright information, and a complete summary of keys, environment variables, and server settings.

Chapter 12 — The Linter Catches 17 Sentences in an Outdated Record

Things to Know Before Taking the Course

  • This course consists of 16 videos and text. Each section begins with a video lesson, followed by lessons that include a PDF and class notes. The final lesson contains the complete PDF (282 pages).

  • Installation, sign-up, and payment procedures are not covered. For installing Claude Code and selecting a plan, as well as signing up for Telegram, Railway, and OpenRouter, follow each service’s instructions.

Practice environment

  • Operating system: The author used macOS. Any environment where the terminal and Node.js run will work.

  • Tools used: Claude Code (you should already be using it), Node.js 20.12 or later, local PostgreSQL, a Telegram account (one bot), and git.

  • Paid: From Chapter 5, a Railway server (Hobby, under $5 per month—the exercises in this book cost only $0.03 for two days); from Chapter 10, an OpenRouter API key (all of the Chapter 10 exercises in this book cost only $0.1).

  • PC specifications: No special requirements. A GPU is not necessary.

Learning Materials

  • PDF: 282 pages (one complete edition plus 8 unit-specific editions; page numbers refer to the complete edition). Approximately 165,000 characters of main text and 211 screenshots.

  • Practice repository (public, MIT): https://github.com/JCLab-coder/news-radar. At the end of each chapter, there are tags (ch00–ch12), so you can return to any point and try running it in a new folder. The 87 prompts the author entered into the session are included verbatim in prompts/.

  • The appendix includes the full rules file, five templates, the complete hooks and scripts, the thought-to-rule table, the complete checklist, and a comprehensive summary of the prerequisites.

Prerequisites and Important Notes

  • Prerequisite knowledge: You should have used Claude Code for at least a few days and be able to read JavaScript. You don’t need to know how to write it.

  • Read it in order. The reason hooks appear in Chapter 7 is that the incident occurs first in Chapter 6. I recommend building it yourself; use the repository for comparison when you get stuck. Claude Code writes things slightly differently each time, even with the same instructions—your code is not wrong just because it differs from the book.


  • Please post your questions on the course’s Q&A board, and I will answer them. The Claude Code interface and the screens of each service may change, and any changes will be announced in the news section.

  • Copyright: The content, screenshots, and PDF may only be used by the purchaser for their own learning purposes. Sharing them with others or uploading them to a public place is not permitted. The code in the practice repository is subject to the repository’s license (MIT)—the code and the book have different terms.

Recommended for
these people

Who is this course right for?

  • I’ve been using Claude Code for a few days, and the new session today didn’t know the rules we set yesterday.

  • Anyone who has heard “It’s done” and opened it to find that it wasn’t.

  • Someone who failed while trying to fix the problem by writing a longer prompt

Need to know before starting?

  • You must already be using Claude Code. Installation, pricing plans, and the sign-up process are not covered.

  • You only need to be able to read JavaScript. You don’t need to know how to write it. Starting in Chapter 5, you’ll need Railway (under $5 per month), and in Chapter 10, you’ll need an OpenRouter API key ($0.1 for all the exercises).

Hello
This is jclab

Career Verified

19

Learners

3

Reviews

3.7

Rating

2

Courses

I’m a developer who builds and operates services.

I’m sharing what I experienced using Claude Code in real-world work and the rules that emerged from it. I’ll talk through actual incidents and original code rather than theory.

I build and use whatever I need, from development and operations to data and automation.

More

Curriculum

All

25 lectures ∙ (1hr 21min)

Course Materials:

Lecture resources
Published: 
Last updated: 

Reviews

Not enough reviews.
Please write a valuable review that helps everyone!

Similar courses

Explore other courses in the same field!

25% off for new members

$57.00

25%

$77.00