Developer · Article
AI Vibe Coding Harness Framework: Run Claude Code on a Budget
· 8 min read · BitKitTools
The problem with vibe coding at scale
Hand an AI agent “build me an app” in one go and it moves fast at first. But as the conversation grows, the agent forgets the rules you set, reshapes the folder structure on its own and piles up code without tests. Part of the cause is that every earlier trial and error keeps accumulating in a single session’s context.
What is a harness framework?
A harness is a device that keeps the agent on a fixed path. It is not a prompt-writing trick but a way of designing the environment and procedurethe agent works in — which is why it is also called “harness engineering.” It comes down to five things.
- Docs are the source of truth — write the PRD, architecture, technical decisions (ADR) and rules (
AGENTS.md) first. - Plans broken into small pieces —
/harnessreads the docs and splits the work into step instructions (phases/{phase}/step{N}.md). A human reviews and approves them. - A fresh session per step —
scripts/execute.pyopens a new Claude session for each step, injects the rule docs every time and passes along only summaries of previous steps, so the context never gets polluted. - Self-verification — each step must pass an executable completion check (e.g.
npm run check). On failure the error is fed back for up to 3 fix attempts. - Safety nets — hooks block dangerous commands and implementations without tests, and
/reviewdoes one more pass at the end.
The harness workflow
Write docs (PRD · ARCHITECTURE · ADR · specs) ↓ /harness ── generate step plan → human approves ↓ execute.py ── new session per step: implement → verify → commit ↓ /review ── detect & fix rule violations ↓ Human tests manually via milestone checklist → PR
The human writes the docs, approves the step plan and tests at the end of each milestone. In between, the harness repeats implement → verify → commit one step at a time.
The hidden cost of a harness: tokens
A harness opens a new session for every step, and each one reads the full rule docs. You get a clean context, but tokens melt. Claude subscriptions have 5-hour and weekly usage limits, so kicking off a phase before bed tends to go like this:
- Kick off a phase at night and go to sleep.
- At 3 a.m. the usage limit hits and the step ends as a failure.
- Wake up, discover it, and wait for the reset all over again.
- Manually hit “continue.”
A harness for the poor: harness_framework_poor
So instead of paying for extra usage, I (the person behind BitKitTools) built a harness that does the waiting, too. The name is honest: harness_framework_poor. You pay in time instead of money.
⏳ Auto-wait & resume on usage limits
- Runs
claude -pwithstream-jsonto check the 5-hour and weekly usage plus reset times on every call. - At 95% usage or higher it won’t start a new step — it waits until the reset time, then starts on its own.
- If a step is cut off mid-run by the limit, it doesn’t count as a failure. After the reset it uses
--resumeto continue the same session with its context intact. - Change the threshold with e.g.
--limit-threshold 0.9. On Windows it keeps the PC from sleeping while it waits.
py -3 scripts/execute.py m0-foundation # Windows python3 scripts/execute.py m0-foundation # macOS / Linux py -3 scripts/execute.py m0-foundation --limit-threshold 0.9 # stop earlier
📚 A documentation system that cuts rework
Saving tokens teaches you that getting it right the first time is the cheapest option, so the docs were strengthened.
docs/progress.md— milestone checklist and a pending-decisions (blockers) table. One checklist item = one step = one commitdocs/milestone-checklist.md— tests a human runs by hand when a milestone is donedocs/specs/— per-system specs; no code before a spec. Only the specs a step needs are injected, to save tokens.docs/tech-debt-tracker.md— agents don’t read git log, so known debt is recorded here and passed to every step
🧭 Stronger /harness and /review
/harness— splits steps by checklist item, keeps the layer order (pure logic & tests → server → client → E2E) and asks first when a spec is missing or a decision is open./review— replaces the eyeball checklist with grep-based detection ofanytypes, layer violations, exposed secrets and missing tests, looping until violations reach zero.
Compared with the original harness
| Item | harness_framework (original) | harness_framework_poor |
|---|---|---|
| /harness · execute.py · /review · hooks | Provided | Kept as-is, strengthened |
| Hitting the usage limit | Step fails | Waits for the reset, resumes the same session |
| Progress, milestone, spec and debt docs | Base templates | Adds progress · milestone-checklist · specs · tech-debt |
The whole skeleton comes from the original jha0313/harness_framework; the poor version adds budget-friendly features and stronger docs and commands on top.
This site was built with a harness
BitKitTools was built by running 18 phases and 72 steps through a harness between July 3 and August 7, 2026 — from the foundation to 16 tools such as the JSON Formatter and JWT Decoder, deployment automation, and GA4 / Search Console / Clarity data collection with automated weekly reports. The token problems hit along the way are why harness_framework_poor exists.
Quick start
You need the Claude Code CLI, Python 3.10+, Node 20+, git and bash (Git for Windows on Windows).
- Copy the repository files into a new project folder, run
git initand make the first commit. - Fill in the
{ }parts ofAGENTS.md,docs/PRD.md,docs/ARCHITECTURE.mdanddocs/ADR.md. - Write a milestone checklist in
docs/progress.mdand the first milestone spec indocs/specs/. - Run
/harnessin Claude Code, then review and approve the step plan. - Run
execute.pyand go to sleep. When you wake up:/review→ test by hand with the milestone checklist → PR.
Before you use it
- Step sessions run with
--dangerously-skip-permissions(file edits and commands without permission prompts). Use it only in a repository you trust and keep the hooks on. - Auto-wait works off Claude subscription usage. With a pay-as-you-go API key you get a bill instead of a limit, so it doesn’t apply.
- If you burn through the weekly limit you may wait for days. Closing the laptop lid defeats the sleep prevention, so keep it plugged in.
https://github.com/oshion/harness_framework_poor
Frequently Asked Questions
- What is vibe coding?
- Vibe coding is building software by describing what you want to an AI coding agent in natural language and steering it by looking at the result, instead of writing most of the code yourself. It is fast for small projects, but as a project grows the agent tends to forget rules and drift into inconsistent structures — which is the problem a harness addresses.
- How is a harness different from just writing a CLAUDE.md file?
- A CLAUDE.md file only tells the agent the rules. A harness enforces them: it splits the work into small approved steps, runs each step in a fresh session with the rule documents injected, requires an executable completion check to pass, and uses hooks to block dangerous commands or code without tests.
- What does harness_framework_poor add to the original harness_framework?
- It keeps the whole skeleton of jha0313/harness_framework (the /harness command, execute.py, /review, hooks and doc templates) and adds automatic waiting and resuming on Claude usage limits, a documentation system (progress checklist, milestone checklist, specs, tech-debt tracker), and stronger /harness and /review commands.
- What happens when the harness hits the Claude usage limit?
- At 95% or more of the 5-hour or weekly usage window it does not start a new step; it waits until the reset time and then continues on its own. If a step is cut off mid-run by the limit, it is not counted as a failure — after the reset the same session is resumed with --resume, so the context is kept. The threshold can be changed with --limit-threshold.
- Does the auto-wait feature work with a pay-as-you-go API key?
- The harness itself works, but the auto-wait feature is based on Claude subscription usage windows (5-hour and weekly). With a pay-as-you-go API key there is no usage window to wait for — you are billed instead — so the feature does not apply.
- What do I need to run it?
- The Claude Code CLI, Python 3.10+, Node 20+, git and bash (Git for Windows on Windows). Step sessions run with --dangerously-skip-permissions, so use it only in a repository you trust and keep the hooks enabled.
Related Tools
JSON Formatter & Validator
Instantly format, pretty-print, or minify JSON. Catches syntax errors and highlights the exact line — no login, no uploads, all in your browser.
JWT Decoder
Instantly decode JWT tokens and inspect Header, Payload, and standard claims — exp, iat, sub, iss, aud and more — with human-readable explanations. Everything runs in your browser; your token never leaves your device.
JSON to SQL Converter
Convert JSON objects or arrays into SQL INSERT statements — supports MySQL, PostgreSQL, Oracle, and MSSQL. Generates CREATE TABLE and batch INSERTs with dialect-correct quoting and type inference. All processing happens in your browser; nothing is sent to any server.