# WORKFLOWS.md - How I Work With Claude Code

_Nine workflows, written down so other people can copy them._

Krasimir "Krasi" Kralev, krasikralev.com. I work in Claude Code (Anthropic's CLI) with many agents.
Nothing here is private; all of it runs every day. The page shows three; this is all nine, as steps.

## 1. The crew that built this page
1. One director writes the design and reviews the art: the biggest Claude. It never edits site files.
2. Builders (the middle-size Claude) implement it; each owns its own files, nobody edits another's.
3. A smaller Claude runs the research errands: counting, fetching, listing.
4. A second model, from OpenAI, critiques screenshots only. It never sees the code.
5. Nothing ships without the test suite and a screenshot pass on a local server that enforces the same
   strict Content-Security-Policy as production.
Lesson: the tests decide, not the agent's word.

## 2. Refute before you fix
1. Every finding (bug report, review comment) goes to two refuter agents on a fresh copy of the branch.
2. They default to "not real" when unsure. Only findings that survive both get a fixer.
3. The fixer writes a failing test first, fixes every sibling call site, then goes green.
4. The whole batch ships as ONE pull request: one review, not ten.
Lesson: findings travel between agents as a file path, never pasted into a prompt. A truncated list once
silently dropped real defects.

## 3. Test on a real box
1. One agent owns one ClawBox test box at a time, under a lock.
2. Every change it makes is restored afterwards and proven.
3. "Update finished" is read from the box itself, never from a log line.
Lesson: a log says it finished. The box knows.

## 4. Ask the harness first
1. ClawBox runs on OpenClaw and Hermes. Before building anything they might already do, search a
   version-exact knowledge base of the pinned harness release: its docs, CLI help, config schema.
2. Use what the harness already does before re-inventing it.
Lesson: the harness has usually done it; the question is where.

## 5. Guardrails are code, not reminders
1. A hook checks every shell command an agent runs and refuses the ones that once hurt: git stash across
   parallel worktrees, force-pushing or deleting main or beta, rewriting the commit author.
2. Credentials live in locked-down files and reach a command only by file, never on a command line.
3. Another guard makes every sub-agent run on the model it is meant to.
Lesson: a rule in a prompt is a suggestion; a rule in a hook is a rule.

## 6. A second model, not a second boss
1. The OpenAI model gives an independent verdict on pull requests and screenshots.
2. Its "no" is read. Its "yes" never replaces the tests.
Lesson: a second opinion is a helper, not a gate.

## 7. The page counts itself
1. A local script re-counts the GitHub numbers and the merged-PR feed with my own gh login.
2. It refuses to write if any count drops or a page comes back short.
3. Then it tests, builds and deploys. No GitHub count on the page is typed by hand.
Lesson: if a number can’t be counted, it isn’t on the page.

## 8. Memory as files
1. One fact per file; a one-line index loaded every session.
2. Rule at the top of the index: a memory that names a file, flag or commit is a snapshot. Re-check it
   before acting on it.
Lesson: memory is a snapshot, not the truth.

## 9. The night shift
1. An OpenClaw agent runs a night batch on its own: it starts at 22:00.
2. It checks on its workers every 20 minutes.
3. It writes a morning report at 08:00.
Lesson: lobsters are nocturnal. So is the batch.

_Copy what helps. Soul: https://krasikralev.com/soul.md_
