From Chatbot to Production-Grade AI Coding
The concepts, architecture, failures, and evidence behind my Claude Code + OpenAI Codex workflow—from models, terminal/CLI, local/cloud/remote control to memory, MCP, skills, plugins, harnesses, workflows, hooks, and dual-AI delivery.
First locate where the agent runs and which entry point fits your work. Then use one small task to complete the loop from requirement to evidence.
I do not want to hype AI—or perform skepticism by underrating it
This is neither an AI advertisement nor an article built from a few failure stories to prove that AI is inherently unreliable. I want to do something simpler: open the real production ledger of how I use coding agents, explain what they helped me achieve, where they failed, and how those failures became engineering rules.
For roughly three months, I have been using Claude Code and OpenAI Codex side by side at high intensity. I pay $200 per month each for Claude Max and ChatGPT Pro, and routinely exhaust the weekly allowance on both. That capacity does not go into generating disposable demos. It supports sustained development and operations for BluffKing, a real Texas Hold’em product whose Rust game engine, Axum/WebSocket backend, PostgreSQL database, Vue H5 client, Flutter clients, replay system, and local solver coach evolve inside one production codebase.
I also brought the product into real production or release paths across H5, iOS, Android, and Telegram. The product is online; H5 payment entry points plus the subscription and entitlement system are deployed, and cancellation and refund flows are implemented: Stripe test mode and the Google Play sandbox have full closed-loop purchase, cancel, and refund evidence; Telegram Stars has proven purchase and refund on the test server, while renewal and active-subscription cancel are not yet proven; and Apple’s replay harness is green but still awaits its first sandbox purchase. I will not collapse “code deployed,” “sandbox/test loop proven,” and “every rail has passed real-money production acceptance” into one status: at the time of this review, some wallet, native-store, and on-chain rails still need final production payment or store acceptance. This is not a demo-only project, but it should not be marketed as “every payment rail is green.”
AI did not accomplish this alone. I own product intent, risk tradeoffs, account identity, payment authorization, and final accountability. The division between the two AIs is asymmetric: either can implement ordinary repository work and the other reviews it; work that depends on my signed-in Chrome, a web console, packaging/upload, or a store console goes directly to Claude Code, while Codex mainly reviews the diff, command output, and page evidence. When Claude hits a quota interruption or Codex takes implementation ownership, Claude becomes the reviewer. The useful story is the path between “can chat” and “can participate in production.”
Who this article is for
- You have used ChatGPT, Claude, or a similar conversation product and asked AI to write functions or scripts.
- You maintain a real repository, tests, CI, and a production environment, but you do not yet trust an agent to participate at scale.
- You want the speed while worrying—correctly—about hallucinations, secrets, bad deployments, and polished but false claims of completion.
What you should gain from reading it
You do not need to copy my entire system. The goal is to build a map of AI coding—model, terminal, shell, CLI, agent, local/cloud/remote control, memory, MCP, skill, plugin, workflow, harness, and hooks—then see how those layers connect in a real project, and finally complete one small production-grade change that is verifiable, reversible, and reviewable.
I recommend AI coding not because AI stops making mistakes, but because those mistakes can be constrained, detected, and repaired through engineering—while, for me, the productivity gain has been real.
Put each concept back in its own layer
GPT, ChatGPT, Codex, Claude Code, a terminal, and a CLI are not competing instances of the same thing. They belong to different layers of one execution chain:
Model
A GPT or Claude model understands, reasons, and generates. By itself it does not possess your repository, terminal, or accounts.
Chat product / coding-agent product
A conversation product such as ChatGPT emphasizes questions and discussion. Coding-agent products such as Codex and Claude Code connect a model to repositories, tools, permissions, and an execution loop.
Terminal / IDE / desktop
These are places where you interact with the product. A terminal is simply the worksite that hosts a command-line session; it is not AI.
Shell / CLI
A shell such as zsh, bash, or PowerShell interprets commands. A CLI is a program’s text entry point. git is a CLI but not an agent; codex and claude are CLI entry points that start coding agents.
My explicit recommendation for a beginner
If your goal is to bring AI into a real repository, start a coding-agent CLI—Codex CLI or Claude Code—from that repository’s terminal. Do not begin by chasing whichever model tops a temporary ranking. Pick an agent that can inspect your repository, run its existing tests, show a real diff, and expose a clear permission boundary.
- Why not make a normal chat window the primary surface: it is excellent for explanation and discussion, but may not have the current repository, command execution, or verifiable evidence.
- Why terminal + CLI first: the working directory, Git state, environment, test output, and exit codes are directly visible, and the same path can later become a scripted workflow or harness.
- Where the IDE fits: keep using it to read code, inspect diffs, and debug manually. Adopting an agent does not require abandoning the editor you know.
- When to add dual AI: first complete one small “task → diff → verification → rollback” loop with one agent; then add a second reviewer in a fresh, preferably read-only context.
Codex or Claude Code: choose by the environment you actually need
| Your main need | Most direct choice | Reason and boundary |
|---|---|---|
| Repository edits, commands, tests, and Git automation | Either Codex CLI or Claude Code | Start with the one whose workflow and permission boundary you understand better; correctness comes from the task contract and evidence, not the product name |
| Use an already signed-in Chrome profile directly from the CLI | Prefer Claude Code | claude --chrome connects Claude in Chrome and can use the current browser login state |
| Use OpenAI’s built-in Browser / Computer Use | ChatGPT web or desktop | OpenAI’s documentation says built-in Browser is not in Codex CLI/IDE; desktop is the better fit when you need a local project, integrated terminal, or Computer Use, while the CLI can still run Playwright or use an additional browser MCP/plugin |
| Continue a local task away from the desk | Choose by remote entry point | ChatGPT Remote connects ChatGPT mobile to a paired host; Claude Code Remote Control connects claude.ai/code or Claude mobile to a local CLI/VS Code session |
Why the terminal has always been my daily entry point
For me, the terminal is not a more “professional” chat box. It is the engineering worksite. When the agent starts in the correct repository or worktree, the current directory, Git state, dependencies, environment variables, command output, and exit codes belong to one evidence chain.
cd /path/to/project
git status
codex # or: claude
My usual path is: enter the project directory → start Codex or Claude Code → state the goal, constraints, and definition of done in natural language → let the hooks check whether the session is already isolated. A read-only task can stay in the current directory. If the agent tries to write code in the shared main worktree, a hook blocks the write and requires it to call the project script that creates a dedicated worktree. The agent then reads files, changes code, and runs tests there. This is what lets multiple sessions work in parallel without sharing one HEAD or one set of uncommitted changes. Finally, I have the other AI review the actual diff and verification evidence. The commands, working directories, Git rules, permissions, and hooks later in this article all grow from this entry point.
“Remote” is not one thing: conversation, cloud sandbox, and control of a local agent
The most important question is not whether you send the prompt from a phone or computer. It is: which machine actually runs the code and commands?
| Surface | Where code runs | Best use |
|---|---|---|
| Ordinary conversation | Primarily produces an answer on the product service; no local access by default—it sees only uploaded or connector-authorized content | Concept explanation, task briefs, and solution discussion |
| Cloud agent / remote sandbox | An isolated vendor-managed container, usually checking out a connected Git repository; no access to laptop files, processes, login state, or devices | Continue with the laptop off, parallel tasks, and repository diffs or PRs |
| Local coding agent | Your computer or development host, constrained by its sandbox and permissions; local access limited to the repository, commands, MCP, browser, and devices you authorize | Daily work needing local dependencies, uncommitted code, databases, browsers, or devices |
| Remote Control of a local agent | Still your Mac, Windows PC, or development host—phone and browser are remote windows onto a session that keeps its local files, tools, and permissions | Check progress, redirect, answer questions, approve actions, and inspect evidence away from the desk |
| Remote MCP / connector | Not an execution environment; it exposes scoped data and actions from a remote service—only the authorized scope, never the whole computer | Current data and scoped actions in GitHub, Sentry, Linear, Gmail, and other cloud services |
Remote Control is also not Computer Use. Remote Control means a person drives a local agent session from elsewhere. Computer Use means the agent itself sees, clicks, and types in an operating-system or application UI. They can be combined, but their authority and risk are separate.
Browser, Computer Use, and “control my existing Chrome” are three different paths
OpenAI’s built-in Browser uses a profile separate from your everyday browser. Computer Use can operate desktop applications and graphical interfaces. Only the Chrome-extension path connects to the Chrome profile I am already signed into and using. All three can look like “the AI is clicking a browser,” but they have different permissions, dependencies, and failure boundaries.
My actual workaround is not to test Codex before every browser task; I route the work by tool reliability. Anything that needs my signed-in Chrome session or a web console goes to Claude Code—for example, filling out Stripe dashboard forms, packaging and uploading iOS or Android apps, and working in the store consoles. Codex serves mainly as the reviewer for this work: it checks the code diff, command output, recorded state, and the browser evidence produced by Claude instead of performing the browser operation itself. This does not mean the Codex Chrome path is fixed. It means I do not let a repeatedly failing toolchain block production work.
One capability map—not another chapter numbering scheme
This is a relationship map: it shows how capabilities stack, not six installation stages you must follow in order.
Make your first AI task deliberately small
Do not begin with “rewrite my entire application.” Do not hand over payments, authorization, or a database migration on day one. A good first task has a clear boundary, a testable result, and an easy rollback:
- fix one reliably reproducible bug;
- add boundary tests to an existing function;
- add one form validation or error message;
- refactor a function with explicit inputs and outputs;
- ask the AI to explain one call path without changing code.
Your first trustworthy small loop matters more than your first thousand generated lines.
A five-part task brief is enough
You do not need prompt magic. State these five things clearly:
Goal: Show the server’s specific error when login fails.
Observed behavior: Every failure currently says “Network error.”
Scope: Change only the login request and error display. Do not redesign the page.
Acceptance criteria:
1. A wrong password shows the correct message.
2. A disconnected network still shows the network error.
3. Successful login remains unchanged.
4. Add a regression test.
Constraints: Do not change the API contract or add a dependency.
If you cannot define what “correct” means, the model can only guess. Write the acceptance criteria before asking it to implement.
A workflow you can copy today
Step 1: protect existing work, then isolate the change
Record the current branch, baseline commit, working-tree status, and worktree list first. If uncommitted changes already exist, determine who owns them; never let an agent stash, reset, clean, or restore the whole repository on its own. Write each new task only in an isolated feature worktree, and never let two agents share one working directory.
git branch --show-current
git rev-parse HEAD
git status --short
git worktree list
# After confirming the baseline and existing changes, isolate the task
git worktree add ../project-login-fix -b fix/login-error-message HEAD
cd ../project-login-fix
Step 2: require investigation before implementation
Read the repository rules and relevant code before changing anything.
Requirements:
1. Keep the patch narrow and preserve unrelated behavior.
2. Add a regression that fails before the fix and passes after it.
3. Run the relevant tests or real-environment verification.
4. List changed files, executed evidence, and remaining risks.
5. Do not claim completion when evidence is missing.
Step 3: give the actual diff and evidence to a second AI
In my real workflow, another AI performs this step; I do not manually review the diff line by line first. The reviewer starts from an independent context and reads the actual patch, relevant code, and test evidence.
You are an independent reviewer and did not author this change.
Inspect the actual diff and any necessary upstream or downstream code. Focus on:
1. Logic errors and edge cases.
2. Security, privacy, concurrency, and compatibility issues.
3. New regression risks.
4. Missing, ineffective, or wrong-layer tests.
5. Conflicts with existing repository rules.
Do not assume the code is correct because tests passed.
Return:
VERDICT: APPROVED or CHANGES_REQUESTED
OPEN: every unresolved item
Step 4: close the loop inside the workflow
When the reviewer confirms a problem, do not stop at a report or throw the decision back to the human. Continue through “fix → test → re-review” until the evidence passes, the reviewer explicitly approves, and OPEN is empty.
Step 5: validate the result locally or in production
I do not usually inspect the code diff line by line. My main involvement is outcome validation: I exercise the relevant flow locally or in production and check that it actually works and satisfies the requirement. If it fails, I return the reproduction steps and observed behavior to the AIs for another fix → test → review loop. Account-holder identity, 2FA, signatures, and payment approval remain with me; packaging, upload, review submission, or an explicitly authorized release can be executed by Claude Code and then checked by Codex. I do not pretend that I click every step manually.
Match evidence to risk
Put the validation layer into the definition of done. Part III uses a real failure to show why unit, browser, device, and production evidence cannot substitute for one another.
Done is a claim. Evidence is the fact.
| Change | Minimum evidence | Common mistake |
|---|---|---|
| Pure function or algorithm | Focused unit tests and boundary cases | Running only old tests |
| API or state flow | Integration test, real request, error path | Testing only the happy path |
| Frontend visual or animation | Real browser, key viewports, visual evidence | Treating jsdom as browser proof |
| Mobile or native behavior | Device or emulator check plus build evidence | Inspecting only shared logic |
| Auth, payments, migrations | Cross-vendor review, rollback, and failure paths; add dual implementation only for genuine design uncertainty | Treating dual implementation as the default for every high-risk task |
After one practical run, Memory, MCP, Skills, Plugins, Markdown instructions, Workflows, Harnesses, and Hooks become useful parts of a system instead of a vocabulary dump.
Models, tokens, context, hallucinations, and memory
Token
The unit a model uses to read and write information; it is not the same as a character or word. Code, logs, tool output, and conversation all consume tokens.
Trap: dumping unrelated logs into one thread buries the actual requirement and increases cost.
Context window
The information the model can see during one run. A large window does not mean every detail remains equally salient or reliable.
Executable practice: keep goals, decisions, and acceptance criteria in the main thread; move noisy logs into evidence files, and use a bounded subagent only when the task is genuinely independent.
Prompt
The current task instruction. A useful prompt is not an incantation; it is a task brief containing goal, context, constraints, and a definition of done.
Trap: “Please fix this” gives the agent permission to invent the business objective.
Hallucination
A fluent and plausible claim with no factual support. In code it can look like a nonexistent API, file, option, or an assertion that tests were run when they were not.
Countermeasure: require file paths, diffs, command output, browser evidence, or device evidence.
Memory
A recall layer for preferences, old decisions, and useful routes from previous work. It is not a real-time operational database.
My lesson: private memory can remember where to look, but it cannot decide current App Store, payment, or deployment state.
Source of truth
The most authoritative current location for a class of facts: code, database, live console, or a canonical repository status file.
BluffKing: mobile-store state comes from store-release-status.json; public release state comes from changelog.json, never from either model’s recollection.
Agents, tools, permissions, sandboxes, and subagents
Agent
A task executor made from a model, context, tools, permissions, and a loop. It inspects files, changes code, runs tests, and reacts to results instead of merely returning an answer.
Difference: chat mode optimizes for an answer; agent mode optimizes for a verifiable outcome.
Tool / tool call
An atomic capability the agent can invoke: read a file, run a shell command, search code, control a browser, or query GitHub. Each call should have clear inputs and outputs.
Trap: having a tool does not imply having authorization; having authorization does not imply it should be used.
Permission / approval
Determines whether an action runs automatically or needs approval. Reading code and deleting production data must never share the same authority level.
My boundary: OTP, 2FA, signatures, payments, live identity, and irreversible steps remain human-controlled.
Sandbox
A system boundary over what the agent can read, write, execute, or access over the network. It assumes inputs are untrusted by default.
Bug-free gate: the deterministic lane blocks external networking, prewarms dependencies, and makes hydrated dependency roots read-only.
Subagent / agent team
The main agent delegates independent slices to specialized roles such as backend review, visual inspection, or log analysis. It works best for parallel, read-heavy tasks.
Trap: subagents consume extra tokens, and multiple agents writing the same directory can cost more coordination than they save.
Session / thread / handoff
A session is a running context; a thread is the conversation and tool trace. A handoff explicitly transfers branch, changed files, last successful and failed commands, and next step.
My practice: when Claude quota ends, Codex resumes from the actual worktree, Git state, and durable handoff—not from “it was nearly done.”
MCP, connectors, skills, and plugins
| Concept | What it is | When to use it | How I use it |
|---|---|---|---|
| MCP Model Context Protocol | A standard protocol connecting an agent to external tools and context. An MCP server can expose tools, resources, and prompts. | When work needs GitHub, a browser, Figma, documentation, internal systems, or another agent surface | Cross-review is asymmetric: Claude reaches Codex through a configured Codex tool/MCP path, while Codex-authored work goes through scripts/claude-review.mjs; MCP is a capability layer, not the mandatory review route |
| Connector / app | An authorized connection to a service that usually handles identity, scope, and structured actions | For private GitHub, Gmail, Calendar, and other account data where search or model memory is inappropriate | My Codex environment can connect to GitHub, Gmail, Calendar, Browser, and Chrome; “installed/callable” is not “used in this project,” and send, delete, and publish remain separately authorized |
| Skill | A reusable method package, usually a SKILL.md plus optional scripts, references, and assets | For repeated work that needs stable steps, domain knowledge, examples, or helper programs | bug-free-codex, visual-fidelity, visual-animation-verify, hot-fix, social-post, and memory-audit |
| Plugin | An installable distribution unit that can bundle skills, MCP-backed apps/connectors, hooks, and assets | When you want a complete capability bundle or need to distribute one across a team | Browser and Chrome capabilities are installed as plugins; GitHub connects as a connector/app; task-specific skills then load on demand |
| Slash command | An explicit / entry point for a command or repeatable workflow | When the operator should deliberately choose a mode or named routine | A trigger such as bug-free-codex starts a fixed quality gate rather than sending a generic prompt |
A skill tells the agent how this kind of task should be done. MCP tells it which external capabilities are available. A plugin packages those capabilities into something installable.
Installing every plugin is not a maturity strategy. Too many tools and skills consume discovery context and increase tool-selection noise. I once investigated a skills-context budget warning and fixed it by disabling unneeded plugins in global configuration, not by adding more descriptions to the agent.
Markdown files are part of the agent operating system
| File | Primary reader | What belongs there | BluffKing use |
|---|---|---|---|
README.md | Humans and agents | Product overview, quick start, and repository layout | Explains the Rust engine, Vue H5, PostgreSQL database, WebSocket rooms, and replay architecture |
AGENTS.md | Codex and compatible agents | Automatically loaded repository rules, commands, constraints, and verification expectations | Defines one task per worktree, prohibits direct main edits, and specifies risk-matched testing |
CLAUDE.md | Claude Code | Claude-side durable instructions | Mirrors the core contract in AGENTS.md; sync checks prevent the two agents from inheriting divergent rules |
SKILL.md | An agent after the skill is selected | Triggers, boundaries, steps, scripts, and finish conditions for a task family | bug-free-codex/SKILL.md defines the fixed local-to-production validation entry point |
ADR-NNN.md | Engineers and agents | An important architecture decision, rationale, alternatives, and status | Only Accepted/Locked ADRs bind; Superseded ADRs must lead to their successors |
PLANS.md / task plan | Agent and reviewer | Executable steps, dependencies, and acceptance points for complex work | Useful for long tasks; a small fix should not grow a giant plan merely to look formal |
Markdown instructions are readable by both humans and AI, versionable in Git, reviewable, and traceable. Their limitation is equally important: they instruct; they do not mechanically enforce. An agent can forget, misunderstand, or hit a conflict. Critical rules must eventually move into hooks, tests, CI, and executable gates.
AGENTS.md/CLAUDE.md; repeatable tasks in skills; and mistakes that must not recur in hooks or gates.Do not confuse workflows, harnesses, hooks, gates, and CI
Workflow
An ordered sequence and state transition from start to finish. It answers what comes next, where failure goes, and what counts as terminal.
Project flows: audit → fix → re-verify and produce → opposite-vendor review → reconcile → act.
Harness
An executable program wrapping agents, environment, tests, timeouts, output schemas, and evidence collection. It does not merely describe the workflow; it runs and reports it.
BluffKing: trusted-local-launcher.mjs, bug-free-codex-pipeline.mjs, and mobile-multi-human-regress.sh.
Hook
A script triggered at session start, before or after tool use, on commit or push, or when a turn stops. It may remind or hard-block.
Project: block-main-edits.sh blocks shared-main edits; Git pre-commit blocks direct commits to main.
Gate / guardrail
A mechanical condition deciding whether an action may continue. The hook is the event point; the gate is the policy.
Merge requirement: an independent review must explicitly return APPROVED with OPEN=[].
Fail-closed
Missing output, invalid schema, review timeout, or uncertain authority stops the action instead of silently becoming a pass.
My review runner: only a schema-valid explicit approval succeeds; timeout, quota exhaustion, or model failure never becomes green.
CI/CD
CI builds and checks after commits or pushes; CD continues into release or deployment. It complements a local agent workflow rather than replacing it.
BluffKing: local bug-free owns heavy behavioral regression; the main-push GitHub Actions gate owns release builds and the changelog contract.
Automation / heartbeat
Unattended work triggered by time or events. A serious heartbeat needs locks, idempotency, state transitions, evidence, and escalation rules.
Evidence-backed capability: an hourly AI team manager checks production HTTP/Playwright and backend compilation, classifies failures, assigns an owner, and writes the ledger. Part III covers what its execution record does and does not yet prove.
Artifact / receipt / ledger
Artifacts are reports, screenshots, logs, and test output; receipts prove a review or action occurred; ledgers hold current shared state across agents.
Principle: a receipt is not authority. My merge flow binds authorization to the current exact diff and live review result.
The clean distinction is: a skill is the method, a workflow is the order, a harness is the executable container, a hook is the trigger point, a gate is the admission decision, and an artifact is the evidence. A mature system usually combines them.
BluffKing shows how layered agent loops, dual-AI review, mechanical gates, and eleven recurring risks fit into one operating system.
How I connect the whole stack in BluffKing
- Task intake: work may begin with my prompt or with a scheduled patrol and shared-ledger finding;
AGENTS.mdandCLAUDE.mdsupply durable repository constraints. - Find current truth: code, accepted ADRs, live consoles, or canonical JSON decide state; memory only helps route the investigation.
- Isolate the change:
new-session.shcreates a branch and worktree from main so each AI session owns its files and HEAD. - Select the skill: visual changes trigger real-browser evidence; releases trigger
bug-free-codex; emergency release work has a separate hot-fix boundary. - Generate evidence through harnesses: the stack covers the Rust engine, PostgreSQL-backed server integration tests, Vue/Vitest, Flutter, Playwright, and iOS/Android/H5/Telegram multi-client rooms, with deterministic and external-device evidence recorded separately.
- Review across vendors: Codex-authored patches go to Claude; Claude-authored patches go to Codex. Confirmed findings are fixed and re-reviewed inside the same workflow.
- Prevent bypass structurally: agent hooks block editing the shared main checkout; Git hooks block direct or hidden main mutations;
finish-session.shis the trusted merge boundary. - Continue after delivery: CI/CD checks the release contract, the heartbeat manager patrols, classifies, and assigns findings on a schedule, and ledgers keep later Claude, Codex, and sessions on the same current state.
This is what I mean by using AI at production scale: not unlimited authority, but as much autonomy as possible inside explicit rules, tools, isolation, verification, and independent review.
Did I build agent loops? Yes, but the layers have different maturity
There is no single industry-standard agent loop. The common core is goal → tool call → observation → repair, without a human copying every result into another prompt. Once that loop moves into a workflow or harness, it still needs state, a round cap, failure classes, and terminal conditions; otherwise it is just an infinite “try again.”
| Loop layer | The actual loop in my project | What it adds beyond “try again” |
|---|---|---|
| Inner agent loop | Read context → call a tool → observe output → choose the next step | The native Codex/Claude Code loop; humans do not copy every command result back into chat |
| Implementation and verification loop | scripts/loop/run.mjs runs QA → classifies failure → optionally invokes a Claude fix driver → reruns | The repository implements state, round caps, and fail-closed terminals, but that does not prove every failure has been repaired automatically |
| Review loop | Author → heterogeneous reviewer → fix confirmed finding → test → re-review until OPEN=[] or the cap is reached | The reviewer is bound to the real diff and evidence instead of self-persuasion |
| Operations patrol loop | Scheduled patrol → production/Playwright/build evidence → triage → owner → ledger | This segment has real GREEN and failure receipts; the AI Team Manager discovers, classifies, and records findings instead of only waiting for human bug reports |
| Engineering-learning loop | Real failure → identify missing capability → add regression/skill/hook/facts guard → prevent recurrence automatically | The system fixes why the workflow missed a bug, not only the current bug |
This is neither “there is no loop, so a human must operate every step” nor “the whole delivery system is already unattended.” The inner-agent loop, cross-model review loop, and scheduled patrol are proven; the repository also implements bounded QA → repair → rerun capability. What the execution record does not yet prove is a durable unattended chain from discovery through repair, review, merge, and release.
What this system actually improved
The highlight is not that I opened two AI products at once. Across many ordinary tasks, human time moved away from babysitting commands, copying logs, and approving every retry, and toward product intent, final acceptance, and high-risk boundaries. Every item below has corresponding code, scripts, hooks, commits, or execution records.
scripts/loop/run.mjs can classify QA failures, invoke a configured fix driver, and rerun with a round cap and fail-closed terminal. It is implemented capability, not a claim that every task already closes automatically.OPEN=[], while regressions, real environments, facts guards, production feedback, and human product acceptance remain separate checks.Why one AI can be confidently wrong—and two AIs can still miss together
The common failure is not total incompetence. It is a model continuing from a bad premise while sounding certain. It may:
- patch the symptom without finding the root cause;
- read one file and miss an upstream protocol or downstream state transition;
- make old tests pass without adding a regression that reproduces the bug;
- assume a real browser is correct because a frontend unit test passed;
- hide missing verification behind a polished summary.
Asking the same AI to “check its work” often preserves its original assumptions. A second AI adds another reasoning path, but it is not proof of correctness. Two models can misunderstand the same requirement, trust the same incomplete tests, or agree on the same stale fact.
What still failed after dual-AI work in my Git history
| Real record | Why two models can still miss it | Defense added afterward |
|---|---|---|
46c9b57d: nine Vitest cases passed while cards still remained face-down in real Chromium | Both author and reviewer can accept the wrong evidence layer; jsdom can prove that an element exists, not that a CSS transform is visibly correct | visual-animation-verify: animation changes require real-Chromium outcome evidence |
| Phase 3 Table: build, 758 tests, and 10/10 smoke were green, but the implementation had silently simplified the design | Functional checks answer “does it work?”, not “is this what the user asked to see?” | visual-fidelity: completion binds to the design source, target viewports, and side-by-side visual evidence |
7767eede: a round-three review fix introduced an empty-SHA deduplication bug found only in round four | A review fix is new code; closing one finding does not prove that no new regression was created | Every fix adds RED→GREEN coverage and reruns tests plus review, rather than merely checking the old finding |
4083b0d8 and a23646c7: marketing and payment status drifted away from the product and Stripe control plane | Two models reading one stale document only agree more consistently on an obsolete answer | Canonical status, live read-back, facts guards, and ledgers that validate downstream consumers |
These failures came from the wrong verification layer, missing requirement acceptance, regressions introduced during repair, and external fact drift. An extra vote cannot solve them by itself.
What I actually use is layered defense, not dual-AI magic
These are system-control layers, not another list of test types: the earlier evidence table answers “what should run”; this one answers “what stops an error from moving forward.”
| Defense | Primary failure addressed | How it works in my project |
|---|---|---|
| 1 · Task contract | Both AIs misunderstand the requirement | A task card states goal, scope, prohibitions, and acceptance; visual work also binds design source and target viewports |
| 2 · State isolation | Agents overwrite files, switch branches, or contaminate results | One branch/worktree per task; author and reviewer do not share writable state |
| 3 · Current sources of truth | Memory, documents, or summaries are stale | Code, databases, canonical status, ledgers, live consoles, and control-plane read-back decide current state |
| 4 · Risk-matched evidence | A green result from the wrong layer | Units for algorithms, integration for APIs, real browsers for animations, devices for native behavior, and production smoke after release |
| 5 · Regressions and invariants | A fix creates a new bug | Write a failing regression first; critical money, chip, and concurrency paths also check conservation and ordering invariants |
| 6 · Independent review | Author blind spots and evidence gaps | Fresh context, read-only access, actual diff, related call paths, an explicit rubric, VERDICT, and OPEN |
| 7 · Mechanical enforcement | An AI forgets a Markdown rule or declares victory early | Hooks, CI, harnesses, fail-closed gates, and a trusted merge entry point block bypasses |
| 8 · Production feedback and human acceptance | Uncovered user experience or external change | Monitoring, logs, production regression, rollback; humans retain product, identity, money, and irreversible decisions |
Reliability is not voted into existence by two models. It emerges from multiple independent failure detectors.
The right role for dual AI: another independent check, not proof
Whether Claude writes and Codex reviews, or the reverse, is secondary. What matters is role separation, reviewer independence, and access to the actual code and evidence instead of the author’s summary. Even two approvals mean only that neither reviewer found an issue in the supplied context; they do not prove that the full user requirement is satisfied.
Can different versions of the same model review each other?
Yes. The core idea is still to create a second judgment path, but the degree of independence is different. Versions may differ in capability, context, and reasoning behavior, so this is usually more useful than self-review in one session. Yet models from the same family may still share training preferences, tool habits, and blind spots.
| Arrangement | Value | Appropriate use |
|---|---|---|
| Same model, same session | Cheapest, but most anchored to the original premise | Quickly find obvious omissions; never treat as independent approval |
| Same model, fresh session | Breaks part of the contextual anchoring and forces a reread | A second pass for routine low-risk changes |
| Same vendor, different versions | Behavior differs, but correlated errors can remain high | A valid reviewer when paired with tests, real-environment evidence, and an explicit rubric |
| Different vendors or model families | More diverse training, tools, and alignment paths | Prefer for important or high-risk changes, while still requiring verification and human acceptance |
Eleven traps when bringing AI into production
These risks have not vanished permanently; the workflow keeps defending against them. The goal is not zero bugs. It is to make errors easier to detect, block, roll back, and remember across sessions.
| Trap | Minimum executable fix | Mechanism in my project |
|---|---|---|
| 1 · Treating a model as an agent | Confirm working directory, repository, tools, network, sandbox, and read/write permissions first; without tools, ask only for a plan | Start the CLI agent from the project terminal; if a write task lands in shared main, a hook blocks it and directs creation of an isolated worktree |
| 2 · Giving the AI an enormous scope | One task card solves one problem and names scope, prohibitions, and executable acceptance criteria | One branch/worktree per task; large work is split into independently verifiable stages |
| 3 · Treating memory as live truth | Use memory for routing; reread code, ledger, database, or live console before reporting current state | Canonical status JSON, ops/bug-free ledgers, live read-back, and facts guards |
| 4 · Reviewing the summary instead of the diff | Use a fresh, read-only session with the actual diff, requirement, call paths, and test output; check each acceptance criterion and treat prose as an index | The reviewer binds to the exact patch; Claude/Codex cross-review returns VERDICT and OPEN, and fixes rerun the loop |
| 5 · Treating Markdown as enforcement | Document the rule first; promote recurring or high-risk failures into a hook, test, or gate | AGENTS.md/CLAUDE.md explain; agent hooks, Git hooks, and finish-session.sh block bypasses |
| 6 · Installing every plugin | Use a minimal allowlist; skip an extension until you can name its use case, authority, and verification path | Visual, release, and review skills load on demand instead of placing every tool in every conversation |
| 7 · Giving MCP excessive authority | Separate read, write, delete, send, and publish; default to read-only and require explicit identity, target, and audit for external acts | Identity, 2FA, signatures, payments, and irreversible actions retain human boundaries; evidence excludes secrets |
| 8 · Treating green tests as complete correctness | Ask what the test actually observes, then add integration, real-browser, device, production smoke, and human acceptance as risk requires | Vitest does not replace Chromium; the harness records layered evidence and continues verification after release |
| 9 · Letting two AIs share one directory | Give every writer a separate branch/worktree; keep reviewers read-only where possible | new-session.sh creates isolation; hooks block changes in the shared main checkout |
| 10 · Spawning subagents without discipline | Parallelize only independent work with no shared write state; otherwise use one orchestrated owner path | Multi-surface verification can parallelize, while merges and tightly dependent repairs use a controlled workflow and ledger |
| 11 · No stop condition or authority boundary | Define completion as commands, observable outcomes, rollback, explicit verdict, and an empty open list | Gates fail closed; humans control OTPs, secrets, payments, and destructive data actions; releases need explicit authority, rollback, and gates but may be executed by an agent |
Reference appendix: Claude and Codex terms to look up when needed
These terms are not a prerequisite exam for AI coding. Return when a relevant situation appears; on a first read, you can skip this appendix.
| Concept | One-line meaning | Production use |
|---|---|---|
| Plan mode | Inspect, decompose, and define acceptance points before editing | Use for ambiguous, complex, or high-risk work; do not over-plan a tiny fix whose acceptance criteria are already clear |
| Reasoning effort | How much inference effort the model spends on a task | Use lower settings for mechanical edits and higher settings for architecture, auth, payments, concurrency, and difficult debugging; never substitute it for tests |
| Context rot / compaction | Long threads bury important facts or compress history into summaries | Put must-preserve rules in files and branch, failure, and next-step state in handoffs; do not bind the whole project to one chat window |
Configconfig.toml / settings | Durable defaults for models, reasoning, sandbox, approvals, MCP, hooks, and plugins | Keep personal defaults global, repository behavior local, and one-off overrides temporary |
| Environment variable / secret | Runtime configuration; a secret must not enter code, logs, prompts, or memory | Git-ignore .env, use least privilege and a secret store, and record only configured/not-configured status in evidence |
| Prompt injection | Untrusted pages, files, or tool output try to override the real instruction hierarchy | Treat external content as data, not authority; use sandboxing, tool allowlists, approvals, and explicit deny-or-approve boundaries for high-risk actions |
| Test vs eval | Tests verify software behavior; evals measure model or workflow behavior across tasks | Test the code and also test whether the harness misclassifies known failure fixtures as green |
| Deterministic / nondeterministic | Whether the same input reliably produces the same result | Keep units and locked dependencies deterministic; record device, network, store, and time-dependent checks as a separate external-evidence lane |
| Trace / log | The record of tool calls, outputs, transitions, and errors | Use it to replay why a verdict occurred, but bound size, redact secrets, and distinguish raw logs from final verdicts |
| Idempotency / lock | Repeating a run does not duplicate effects; a lock prevents conflicting runs | A scheduled heartbeat needs a run lock, repeat-safe state transitions, and evidence of final release |
Use a four-week path, a decision-oriented FAQ, and a prompt you can hand to an agent to build the smallest trustworthy loop.
From GPT chat user to AI-coding beginner: a four-week path
This is an execution index, not a second copy of the article: add one capability layer each week and return to the corresponding exercise above.
Week 1: read-only understanding and trust calibration
Use the surface recommendation and execution-location guide to start an agent. Ask it to explain architecture, map one call path, and locate tests without editing; spot-check where it guesses.
Week 2: complete one reversible change
Choose a reversible change using the small-task brief, then follow the five-step workflow through “inspect → change → AI review → local or test-environment acceptance → rollback if needed.”
Week 3: turn repeated lessons into a system
Return to capability extensions, Markdown instructions, and mechanical controls: create a short AGENTS.md, turn one repeated routine into a Skill, and add one Hook that blocks an obvious failure.
Week 4: add the second AI and evidence-based gates
Use the dual-AI failure modes and eleven traps to build “implement → independent review → fix → re-verify.” The reviewer is one sensor; real-environment evidence and human acceptance still constrain the result.
Skimmable FAQ: ten decisions beginners face
This is an index into the argument, not a second tutorial. Use the direct answer to decide, then return to the relevant chapter when you need the reasoning.
| Question | Direct answer |
|---|---|
| Do I need to learn “prompt engineering” first? | No. Learn to state goal, observed behavior, scope, acceptance criteria, and constraints. That is more useful than memorizing incantations. |
| Can I start if I am not comfortable in a terminal? | Yes. Begin with cd, git status, starting the agent, running the project’s test command, and git diff. You do not need to become a shell expert first. |
| Do I need two $200-tier subscriptions like yours? | No. One repository-capable agent is enough for the beginner loop. Dual AI increases reviewer independence; it is not the entry fee. |
| Must I install memory, MCP, skills, and plugins first? | No. Week one needs an agent, a repository, a task card, and the existing tests. Add extensions only after real repeated problems justify them. |
| If every test is green, why not ship? | Tests observe only what they were written to observe. Visual, device, payment, authorization, and production-state changes need different evidence layers. |
| With two AIs, can I stop looking? | You do not need to read every diff line or supervise every command, but you must define observable acceptance and, as I do, validate the final behavior locally or in production. |
| Should an agent ask me before every step? | No. Local, reversible work inside the sandbox can proceed autonomously. Humans control identity, secrets, payments, and deletion; an authorized, reversible release can be executed by an agent. |
| If I send a task from my phone, does it run on my computer? | Not necessarily. A cloud agent runs in a hosted container. Only Remote Control or Dispatch explicitly connected to a host uses that host’s local files and tools. |
| Will pasting this article reproduce your entire system? | Not in one shot. It can guide a tool-using agent to build a minimum loop. A mature system grows from the failures it actually encounters. |
| Who remains accountable for production? | The human. Agent autonomy does not transfer product, legal, financial, identity, or final-delivery accountability. |
Can your AI really build this if you paste in the article?
It can build a minimum viable version, but pasting HTML into an ordinary chat window will not install a system. Start a coding-agent CLI with file, edit, and command tools from the repository directory, then give it this article and the prompt below. An AI without repository tools can produce only a proposal.
The default authority below is intentionally more conservative than my mature project. A beginner should initially block commit, push, merge, and deploy, then authorize agent execution one capability at a time only after review, rollback, and release gates really work. It is a bootstrap policy, not a reverse description of my current workflow.
Bootstrap prompt to paste into Codex or Claude Code
You are running inside my project repository. I have attached an article titled “From Chatbot to Production-Grade AI Coding.”
Do not copy BluffKing-specific paths, commands, or technology. Adapt a “minimum trustworthy AI-coding loop” to this repository.
Working method:
1. Begin with read-only inventory. Identify the stack, Git/CI, test entry points, existing instruction files, hooks/scripts, high-risk areas, and your current tools and permissions. Record the current branch, baseline commit, git status --short, git worktree list, and pre-change diff. Do not guess or print content that may contain secrets.
2. Protect existing work before writing. If this is a shared main tree, contains changes unrelated to this task, or ownership is unclear, do not write here. Prefer an existing isolated feature worktree; if Git state permits, create a new worktree from the recorded baseline; otherwise mark NEEDS_USER. Never stash, reset, clean, rebase, or restore the whole repository on your own.
3. First output a “current state → gap → minimum change” table. Then implement only safe, local, reversible changes inside the isolated worktree; do not wait for confirmation on every ordinary file.
4. Reuse existing conventions instead of creating a parallel system. Keep instruction files concise. Turn recurring critical rules into executable checks.
5. Deliver at minimum:
- A project instruction file for the current agent; improve an existing file instead of overwriting it blindly.
- A task-card template with goal, observation, scope, acceptance criteria, and constraints.
- A minimum verification script or harness that calls existing project tests and exits non-zero on failure.
- An independent-review gate: first detect whether a second independent session/model is genuinely callable. If it is, use a fresh read-only session to review a harmless patch; it must read the real diff, requirement, and evidence and return parseable VERDICT and OPEN. A template alone is not READY. If no independent reviewer is callable, mark UNSUPPORTED or NEEDS_USER and keep the delivery gate closed.
- Operating instructions from branch/worktree creation through verification, review, and rollback.
6. Verify the new loop with existing project commands. Failure self-tests may only create a disposable fixture, inject a temporary environment variable, or call an explicit false command; never damage existing business source, tests, or configuration. Compare exact status/diff before and after, remove only the fixture you created, and prove the user’s original state is unchanged.
7. Exercise at least four review-gate paths: an end-to-end dry run where a real independent reviewer examines a harmless patch; reviewer missing or timed out; malformed verdict; and non-empty OPEN. The last three must block. If no reviewer is callable, mark the first path UNSUPPORTED rather than manufacturing a green result.
8. Finish with changed files, commands actually executed and results, intentionally unimplemented items and reasons, remaining risks, and the complete rollback method. Rollback may remove only files created in this run or reverse this run’s exact patch; never use a repository-wide restore that overwrites prior work.
9. Output a capability matrix for Memory, MCP, Skill, Plugin, Markdown instructions, Hooks, Harness, Workflow, Worktree, independent Review, Automation, and Remote Control. Mark each READY / BUILD_NOW / NOT_NEEDED / UNSUPPORTED / NEEDS_USER, with evidence and the smallest next step. READY means genuinely callable and verified with positive and negative cases, not merely represented by a template or config file. Do not install capabilities merely for completeness.
Default authority boundary:
- Do not install global software, add paid services, or read or print secrets.
- Do not change global Git configuration or install hooks directly. You may create reviewable repository-local hook/gate scripts and installation instructions.
- Do not touch pre-existing changes or run stash, reset, clean, rebase, or a repository-wide restore on your own.
- Do not commit, push, merge, deploy, send external messages, or write production data.
- Stop at OTP, 2FA, signatures, payments, data deletion, production release, or any irreversible action and state the exact human step required.
- If evidence is missing, mark NOT_VERIFIED and do not claim completion.
This prompt can bootstrap a minimum loop; it cannot reproduce in one pass a system that evolved over three months.
AI coding is worth using—and you can start today
If you have already used ChatGPT or Claude, you do not need to master memory, MCP, skills, and hooks before you begin. The real first step is to open your project in a terminal and start Codex CLI or Claude Code. Let it read the repository, change code, and run the existing tests. Your job is to explain the problem and define what a correct result looks like.
I now use this setup—one founder working with Claude Code and Codex—to develop and operate a live product across H5, iOS, Android, and Telegram, including payment, subscription, refund, store-release, and production work. That is enough evidence for me that agents can handle substantial real engineering. They still write bugs and miss requirements, and two AIs can miss the same problem. “The agent says it is done” is therefore not the result. Tests, browsers, devices, live state, or your own use of the feature must confirm it.
Tomorrow, do only these four things
- Open a project you know in a terminal and start one coding-agent CLI.
- Give it one reversible task with the goal, observed behavior, scope, acceptance criteria, and prohibitions.
- Let the agent inspect, edit, and test on its own, then report exactly what changed and what it ran.
- Exercise the result once in your local or test environment. If it does not meet the requirement, return the observed behavior and let the agent continue fixing it.
At that point, you have moved beyond chatting with GPT and started AI coding. Once this basic workflow is reliable, add a second AI reviewer, isolated worktrees, skills, hooks, MCP, and automated gates. These concepts are not a shopping list to install at once. They are the next tools to add when a real failure shows you what your current workflow is missing.
README.md, AGENTS.md, CLAUDE.md, docs/AGENTS-CONTRACT.md, docs/ops/HEARTBEAT-SOP.md, docs/architecture/ai-team-manager.html, docs/mobile/store-release-status.json, docs/ops/billing-provider-status.json, scripts/ai-team-manager.mjs, scripts/loop/run.mjs, scripts/bugfree/trusted-local-launcher.mjs, scripts/claude-review.mjs, .agents/skills/visual-animation-verify/SKILL.md, and .agents/skills/visual-fidelity/SKILL.md. Real fixes and workflow commits cited include 46c9b57d, 7767eede, 4083b0d8, a23646c7, 7c3142bb, af86fbcd, and 5b3e01b0. Product and concept boundaries follow official OpenAI documentation for customization, hooks, plugins, cloud environments, Browser, ChatGPT Remote, and harness engineering, plus Anthropic’s official Claude Code with Chrome and Claude Code Remote Control documentation. Claims about reviewer bias also draw on ACL-published research on LLM-as-a-judge bias and self-correction bias. Product status, Remote capabilities, and official concepts were checked on 2026-07-19 and may evolve. No unsupported productivity, speed, or defect-rate figures are used.