
📺 Recording of Bekhzod Masharipov and Martin Foldyna's talk at Ackee Meets: Agentic Web Dev (the talk is in Czech):
Rewrite an application with ten years of history, 3,800 commits and 46,500 lines of code. In one week. With two people and an AI agent that has the keys to everything in the terminal. It sounds like a bet no reasonable person would take, and that is exactly why it's worth describing how it turned out.
📋 TL;DR
- An internal company system with six modules: ten years of history, 3,800 commits, 46,500 lines of code, an outdated tech stack and libraries nobody maintains anymore. The assignment: rewrite it. The deadline: one week.
- The tool was Claude Code. The backend went first, and the old frontend kept running as live validation that the new backend really works.
- Speed didn't come from better prompts but from preparation: Claude Code in a dev container, the rewrite in a new codebase, rules in a
CLAUDE.mdfile, library documentation via Context7 MCP. - The manual "babysitting" of the first module was packaged into Claude skills: rewrite, verify, E2E test, each step in its own context window.
- The frontend initially failed with a naive "copy the styles based on screenshots" approach. What worked was a combination of v0 for the base components and Figma MCP for fine-tuning details.
- Billing through the Claude API shot up to $150 in three days. A subscription would have come out significantly cheaper.
- The result: all six modules in seven days, deployed to the dev environment, and manual testing found very few bugs.
🧟 Starting point: legacy that nobody wanted to touch
The starting situation was textbook: an application the whole company uses every day, with a first commit from 2016, on a stack that had long since stopped being modern, and with libraries whose authors had long since moved on.
Maintaining an application like that isn't work, it's negotiation. Every change carries risk, every upgrade opens three new questions. So in February 2026 the decision was made that is almost always made in this situation: we'll rewrite it. What was unusual was what followed: a deadline of one week and two developers, one backend and one frontend.
🤝 Claude Code as a partner who doesn't sleep

Claude Code took on this role: an AI agent that runs right in the terminal and worked side by side with the developer all week. No, the developer didn't become redundant. The role just shifted: instead of writing code line by line, you become an architect and a reviewer. Which, let's admit it, is work most people are no more used to than they are to writing tests.
Why Claude Code specifically? At the time of the decision, Anthropic's models were clearly ahead on SWE benchmarks. So the choice of tool wasn't ideological, just pragmatic: we reached for what had the best numbers at that moment.

The division of work was clear from the start, with the same goal for every step: not to go mad.
- Start with the backend. A clear interface, clear business logic, a measurable result.
- Let the old frontend live. We connect it to the new backend and get instant feedback that things work.
- Pay through the API. For one week of real usage it surely can't be that much. (Spoiler: we'll come back to this one.)
🧱 Preparing the ground: Context7, a dev container and context engineering
Before the first prompt came three preparatory steps. In hindsight, they are what decided that the deadline was met.
Context7: so the model doesn't invent functions
All LLMs generate code from training data, which inevitably ages. The result is hallucination, where the model confidently uses a library function that doesn't exist in that version at all. Context7 is an MCP server that feeds the documentation for a specific function into the context, in exactly the library version the project uses. The agent gets up-to-date documentation quickly and doesn't have to hallucinate, and because it receives only what it needs, it also saves tokens.
Dev container: let's keep the keys to the house
The question the audience got at the talk sounds innocent: who here runs an AI agent directly on their own machine? Hands went up almost everywhere. It's understandable, it's convenient and it's a risk.
There is a case going around the internet where an AI agent running on the host deleted a production database with a Terraform command. An agent running directly on your machine has access to everything you have access to: files, keys, credentials, databases. Essentially total ownership of your computer.
You'll object that Claude Code asks about every command. It does. But after the twentieth confirmation, and especially when you have several agents running in parallel, the approval process looks roughly like this:

So manual approval doesn't work as a safety measure. What does work is a dev container: a Docker container configured as a full development environment, meaning with an editor, extensions and SDKs. You connect to it through your IDE and work as if you were sitting on your own machine. The difference is that the agent can't reach beyond the container's boundary.

The dev container solved three things at once: security (an isolated environment, no access to the host), hands-off mode (inside the container you can give the agent broader permissions and not confirm every command) and control (you can connect through the IDE at any moment and take over).
Context engineering: existing code is part of the prompt
The last preparatory step was the decision to rewrite in a new, clean codebase. The reason is inconspicuous but fundamental: existing code is part of every prompt, and probably its most influential part. The agent adapts to what it sees around it. If the rewrite had run in the old repository, it would have carried over old constructs with iron regularity, and the whole rewrite would have lost its point. The old code stayed in the project, but only as a read-only reference, so the agent knew what it was rewriting, not how it had been written.
On top of that came the rules in the CLAUDE.md file: project description, goal, a link to the style guide, conventions, architecture, a link to the old codebase. In short, everything the agent can't easily find out on its own. And finally tooling: a configured linter and formatter that the agent runs after every code change.
🔁 Backend workflow: from babysitting to Claude skills
The rewrite itself happened in three steps that repeated for every module.
Step 1: dependency graph. Claude Code analyzed the old code and built a dependency graph of the modules. It determined the order in which to rewrite.
Step 2: specifications, in parallel. We ran several agents at once, each given one module. The agent went through the legacy code, understood the business logic and wrote a detailed specification. That then served as the assignment for the rewrite. In hindsight it was the most valuable artifact of the whole week: the specifications are what ensured nothing important was left out during the rewrite.
Step 3: babysitting. On the first module Claude Code wrote the code while the developer stood over every output, went through it and gave feedback. Every mistake he had the agent write into CLAUDE.md as a rule so it wouldn't repeat. It worked great and it took a whole day. Six modules at this pace don't fit into a week.
Claude skills: a packaged workflow
The solution was Claude skills: a packaged workflow that the agent runs on its own or on request. Ideal for routine you've debugged by hand once and don't want to debug again. So: "Write down all the steps we went through together and turn them into a skill."
A skill is an ordinary markdown file. At the top a description by which the agent recognizes when to use it, below it the steps. In simplified form it looked like this:
---
name: rewrite
description: Detailed instructions how a module must be rewritten.
Use it when rewriting a module based on specification
---
## Steps
1. Read the module specification
2. Create an implementation plan
3. Write the tests first - they must fail
4. Write the minimal implementation that makes them pass
5. Refactor the implementation
6. Repeat until the whole plan is doneAt the core is TDD, and not out of ideology. When you tell the agent "write a module", it invents five abstractions nobody needs. When you tell it "make this test pass", it writes exactly what's needed.
Rewrite → verify → E2E test
But one skill for rewriting a module isn't enough. Verification was missing, so two more were created.
Verify first checks that the implementation matches the specification (all endpoints are there, the business logic fits) and then does a classic code review: it looks for vulnerabilities and checks compliance with the style guide and the defined rules. Every mismatch is sent back to the agent that wrote the code.
E2E test spun up the old frontend, connected it to the new backend and used Playwright to click through the main scenarios from the specification. It logs the bugs it finds and sends them back. The loop repeats until everything passes.

Each of the three steps ran in its own context window. On purpose. An agent that wrote the implementation has a strong tendency to overlook its own mistakes, just like a person proofreading their own text. So verification is done by someone else, even if that is "just" another instance of the same model.
“The goal was that we wouldn't touch the code at all. When I saw it was making some mistakes, I told it what to do differently, but editing the code by hand, no.”
💸 What it cost: Claude API vs. subscription
We already mentioned API billing in the TL;DR, but it's worth staying on it a paragraph longer. In the middle of the week a colleague sent a message along the lines of have you looked at the usage? He hadn't. $150 in three days, and the work wasn't done yet.
By itself that's not a tragedy, but a monthly subscription on a higher tier costs around a hundred dollars. The lesson is boring and applies generally: if you're going to work with an agent more intensively than for one day, go with a subscription and calculate the costs in advance.
🎨 Frontend with v0 and Figma MCP: measure twice, generate once
The frontend part, handled by Martin Foldyna, had the same assignment but different problems. Design can't be verified with a test.
The first attempt was, let's say, bold: the strongest model available at the time in plan mode, copying the styles from the original application into the new codebase, with screenshots attached showing how it should look. Expectation versus reality were two very different screens.

AI builders: v0 or Lovable
The second attempt started with tools built specifically for generating UI. Brief research narrowed the choice to two names:
| Tool | Good for | Code quality |
|---|---|---|
| v0 (Vercel) | generating React components | good, you can keep building on it |
| Lovable | quick fullstack apps and MVPs | MVP-style, less suitable as a codebase foundation |
The choice fell on v0 precisely because the output was meant to serve as a foundation to build on. The generated components were copied into our own Next.js template, and Claude Code wrote the rest of the pages. The final UI wasn't perfect, but compared to the first attempt it was a jump of a whole category.
Figma MCP: magic, but with an asterisk
The whole design lives in Figma, so Figma MCP looked like a savior. And to a large extent it was: it's ideal for fine-tuning specific details so the layout fits and charts appear where they should.

The catch is that the official plugin is fairly stripped down and its rate limit on the Pro plan is strict, on the order of two hundred calls a day. When fine-tuning a design, that's a ceiling you hit before lunch. The alternative became the unofficial Figma Context MCP (Framelink), which goes through the API with significantly more generous limits. According to the comparison in its documentation, it also returns smaller and better-structured output: descriptive JSON instead of pre-chewed React and Tailwind, with style names preserved.

Wiring up the logic, because a pretty UI does nothing on its own
A polished UI is nice until you click something. Wiring up the logic then looked similar to the backend: the frontend is modular too, so we went module by module. The agent first generated a specification for the module, and was given written conventions and best practices, a stack definition, a list of the libraries in use and their documentation via Context7.

The new module was then compared against the old one with Playwright CLI. If it passed, the module was done. If not, it went back into the loop. And since this approach proved to work, it ended up, of course, packaged into a skill.
Code review stayed with humans
One thing wasn't automated. AI-generated code didn't go to the dev environment without a human seeing it. Code review was always done by a senior frontend developer, after which the agent pulled the comments from the merge request itself, addressed them and sent it for another review. Around and around, until the merge request was approved.

📈 The result after seven days
All six modules rewritten. The new backend deployed to the dev environment, connected to the original frontend and working. Manual testing by the QA team found very few bugs. That was no doubt helped by the original application having decent test coverage, since both internal and client projects here aim for ninety percent coverage.
The most time ended up going to two things, and neither was code generation itself: babysitting the first module on the backend and fine-tuning the design on the frontend, where details were polished until they matched the original application one to one.
Put more energy into specifications: the more detailed the assignment, the better the rewrite. On the frontend, start with an AI builder right away and skip the naive copying of styles from screenshots. And reach for the newest available model.
Frequently asked questions
🎯 Key takeaways
The rewrite in a week wasn't the result of AI writing code faster than a human. It was the result of preparation that looks like stalling at first glance: an isolated environment, a clean codebase, rules in CLAUDE.md, current documentation in context and above all detailed specifications as the assignment. Only on top of that does it make sense to package routine into skills and let the rewrite → verification → E2E tests loop run by itself.
What remained for humans was to define what should actually be built and to put their name to it in code review. The rest is delegable, and the jump between "AI completes my lines" and "AI rewrites modules while I do the review" is bigger than benchmarks make it seem.
You can find the whole story, including questions from the audience, in the recording of the talk (in Czech). Follow Eventbrite for the dates of upcoming Ackee Meets, and sign up for our newsletter (in Czech) so the next piece like this lands straight in your inbox.




