Claude Code as Your Cofounder
I built Solus - a personal finance app and companion AI agent that runs entirely over iMessage, SMS, and WhatsApp in about six months.
Claude Code was my lead engineer, Humza and I were the testers.
Most of the advice online about building with AI is either too vague or written by people who haven't shipped anything with it. This is how it actually works when you're trying to get a real product out the door.
The setup
I used Cursor as an IDE with Claude Code in the integrated terminal.
I had Cursor handle the visual layer so I could see inline diffs, handle tab completions, and run multi-file Composer edits. But whenever I needed heavy lifting, I ran Claude Code in the terminal. Claude did things like running commands, debugging across files, iterating on failing tests autonomously.
I also run standalone Claude Code sessions in my terminal for infra work, CI/CD pipelines, and anything where I don't need an editor open.
The stack for Solus looks like this:
Four files in this tree matter more than the rest of the codebase combined: CLAUDE.md, .cursorrules, tasks/todo.md, and tasks/lessons.md. These are the system files that make the AI agent actually useful.
The CLAUDE.md file
Boris Cherny, the person who built Claude Code at Anthropic, posted his internal workflow on X and it went viral. The idea is pretty simple: keep a CLAUDE.md in your repo root and every time the agent does something wrong, add a rule. Over time, the file compounds and your agent gets better the longer you work with it.
My file isn't just a list of don'ts but rather it's a system for how the agent should think, plan, and verify its own work.
Here's the core of it:
# Workflow Orchestration
## 1. Plan Node Default
- Enter plan mode for ANY non-trivial task (3+ steps or architectural decisions).
- If something goes sideways, STOP and re-plan immediately.
- Use plan mode for verification steps, not just building.
- Write detailed specs upfront to reduce ambiguity.
## 2. Subagent Strategy
- Use subagents liberally to keep main context window clean.
- Offload research, exploration, and parallel analysis to subagents.
- For complex problems, throw more compute at it via subagents.
- One task per subagent for focused execution.
## 3. Self-Improvement Loop
- After ANY correction from the user: update tasks/lessons.md with the pattern.
- Write rules for yourself that prevent the same mistake.
- Ruthlessly iterate on these lessons until mistake rate drops.
- Review lessons at session start for relevant project.
## 4. Verification Before Done
- Never mark a task complete without proving it works.
- Diff behavior between main and your changes when relevant.
- Ask yourself: "Would a staff engineer approve this?"
- Run tests, check logs, demonstrate correctness.
## 5. Demand Elegance (Balanced)
- For non-trivial changes: pause and ask "is there a more elegant way?"
- If a fix feels hacky: implement the elegant solution instead.
- Skip this for simple, obvious fixes — don't over-engineer.Let me walk through why each section exists.
Plan before you build. The first rule is that the agent enters plan mode for any non-trivial task (three or more steps), or anything with an architectural decision. If something goes sideways mid-implementation, it stops and re-plans instead of pushing forward.
Subagents for everything parallel. I use subagents to keep the main context window clean. Research, exploration, parallel analysis is then all offloaded. For complex problems I spin up multiple subagents, one task per agent.
How to improve the agent. After any correction from me, Claude updates tasks/lessons.md with the pattern. Over a few weeks on Solus, the mistake rate dropped noticeably, and Claude had a growing, compounding list of things it knew not to do. Cherny's team does the same. They update CLAUDE.md during PR review so the fix lives in the system, not just the code.
The lessons file looks like this after a month:
# Lessons Learned
## Twilio
- Webhook handlers MUST return 200 even on internal errors. Never 500.
- Messages over 1600 chars need segmentation before send.
## Supabase
- Never create new tables without updating db/types.ts.
- Always use the db/ module for queries. No raw SQL in handlers.
## Testing
- Don't skip failing tests. Don't comment them out. Fix them.
- Edge cases to always test: empty strings, Unicode, null values.
## Architecture
- All message routing goes through src/router.ts. No new entry points.
- Environment variables are typed in src/env.ts. Add new ones there first.
- The Supabase client lives in src/lib/supabase.ts. Import from there.The .cursorrules file
CLAUDE.md is for Claude Code's terminal-based agentic workflow. .cursorrules is for Cursor's in-editor AI, completions, Composer, chat. You want both if you're running the hybrid setup.
You are working on Solus, a conversational finance app.
Stack: Node.js, TypeScript, Twilio, Supabase, Vercel.
## Style
- Functional patterns. Avoid classes unless wrapping a third-party SDK.
- Prefer early returns over nested conditionals.
- Keep functions under 40 lines. If longer, break it up.
## Project-Specific
- All message routing goes through src/router.ts. No new entry points.
- Supabase client is in src/lib/supabase.ts. Import from there only.
- Environment variables are typed in src/env.ts. Add new ones there first.
## Do Not
- Do not add dependencies without asking.
- Do not refactor files outside the current task scope.
- Do not write comments that restate the code.Task management
Every feature starts the same way. Claude reads CLAUDE.md, scans the relevant files, and writes a plan to tasks/todo.md before touching any code.
# Add receipt scanning via MMS
## Plan
- [ ] Parse inbound MMS webhooks for image attachments
- [ ] Download and validate image (JPEG/PNG, <5MB)
- [ ] Send to GPT-4V for receipt extraction
- [ ] Map extracted items to user's budget categories
- [ ] Store transaction and notify user via reply
- [ ] Add integration tests for each step
## Review
(filled in after completion)With these files, A five-minute plan saves hours of rework. Claude doesn't have to guess what you meant, and you catch scope issues before any code gets written.
A typical session
Open Cursor. Start Claude Code in the integrated terminal. Describe what I want.
$ claude
> Add rate limiting to the webhook endpoint.
Max 60 requests per minute per phone number.
Use the existing Redis client in src/lib/redis.ts.
Write tests.Claude reads the context files, plans in tasks/todo.md, implements across files, runs the test suite, and reports back. If something fails, it reads stderr, traces the issue, and proposes a fix autonomously.
Cherny calls this "autonomous bug fixing." You point at the problem, the agent resolves it. Zero context switching from you.
For bigger features, I write a short spec first, like two or three paragraphs describing what it does, how it works, and what the edge cases are.
When a user logs a transaction via text, Solus should automatically assign it to a budget category based on the merchant name and transaction description.
Use the existing category list from the user's profile. Fall back to "Uncategorized" if confidence is below 0.7. The user can override via reply within 5 minutes.
Edge cases: merchant names with typos, transactions in non-English languages, amounts with currency symbols vs plain numbers. Write tests for each.
What actually makes this work
Three things.
Scope tight. Vague task → vague code. Tight task with clear inputs and outputs → nailed almost every time. One feature, one bug, or one refactor per session. Five things? Do them sequentially.
Mistakes become rules. Every error Claude makes becomes a line in CLAUDE.md or tasks/lessons.md. After a month on Solus, Claude rarely made the same mistake twice. The system self-corrects.
Verify everything. I don't trust output just because Claude says it works. Run the tests. Check the logs. Try it manually. Skip verification and you're just accumulating hidden bugs.
If you're starting today
Start with CLAUDE.md. Even five lines. Even just your stack and two rules. It's the single highest-leverage file in your repo.
# Project Context
- Stack: Next.js, TypeScript, Supabase
- All API routes are in src/app/api/
# Rules
- Run tests before marking anything complete.
- Never add dependencies without asking.Use Cursor and Claude Code together. Cursor for diffs, completions, Composer. Claude Code for agentic tasks. You don't pick one.
Write specs before you prompt. Commit after every working feature. Throw away 10-20% of what Claude produces, Cherny's number, not mine, though my experience tracks. That still means 80-90% usable output at dramatically higher throughput than writing everything by hand.
The honest version
Claude Code isn't magic. It writes bugs. It misunderstands requirements. It sometimes edits files you didn't ask it to touch. The rate limits can be annoying during long sessions.
But it is by far the fastest way I've found to go from idea to working product as a small team. Solus exists because I could move at the speed of a five-person engineering team while being one person with a terminal and an IDE.
Set up the hybrid workflow. Write your CLAUDE.md. Start building.
– Q