Book a free call

How to Build an AI App With Claude Code

Claude Code is a command-line coding assistant that reads your project, edits files and runs tests from short prompts. Here is how to build an AI app with it.

Hertiv engineering teamReviewed by a senior engineer
7 min read
How to Build an AI App With Claude Code
On this page

Short answer

To build an AI app with Claude Code, set up a project folder with a short plan, write a CLAUDE.md file that explains the project, then ask Claude Code to plan each feature before it writes code. Build one feature at a time, run the tests after each step, and keep your model API key on the server, never in the browser.

What is Claude Code, and what can it build?

Claude Code is a command-line coding assistant from Anthropic that reads a project, edits files, runs commands and tests, and explains its changes, all driven by short prompts from the developer. You describe what you want in plain language, and it does the typing.

It can build a full AI app: the interface, the server, the database, the calls to a language model, and the tests. It works best on a clear, small scope, where each feature can be described in a sentence or two and checked by running the app.

Part of the appWhat Claude Code doesWhat you still do
Project scaffoldCreates files, folders and configChoose the stack and the scope
FeaturesWrites the code for each featureDescribe the feature and test it
TestsWrites and runs test casesDecide what correct looks like
ReviewExplains each change it madeRead the diff before you ship

It is not a replacement for a developer. It writes code fast, but it cannot decide what the product should do, which trade-offs matter, or whether a feature is safe to ship. For a comparison with the other main AI editor, see Claude Code vs Cursor.

What do you need before you start?

You need four things before you start: a Claude account with access to Claude Code, a computer with Node.js and Git installed, an empty project folder, and a one-page plan of what the app will do. If any of these is missing, the build will stall on setup instead of on the product.

The setup list is short:

  • A Claude account. Claude Code runs through your Anthropic account, so sign in and check your access first.
  • Node.js and Git. Most Claude Code projects use Node, and Git tracks every change the assistant makes.
  • An empty folder. Start clean, so the assistant cannot confuse old files with new ones.
  • A one-page plan. The app's job, its three main features, and the data it stores.

Keep the plan short: the app's job, its three main features, and the data it stores. A plan longer than a page is a sign the scope is too big for a first build, and the assistant will drift without a clear target.

How do you set up a project with Claude Code?

You set up a project by creating the folder, starting Claude Code inside it, and writing a CLAUDE.md file that tells the assistant how the project works. That file is the most important part of the setup, because the assistant reads it every time it starts.

  1. Create the folder and start Git. Make the directory, run git init, and add a short readme with the app's job.
  2. Start Claude Code. Open a terminal in the folder and run the claude command to begin a session.
  3. Write CLAUDE.md. List the stack, the folder layout, the commands to run and test, and the rules the assistant must follow.
  4. Ask for a plan. Describe the first feature and ask for a plan before any code is written.
  5. Approve and build. Read the plan, fix what is wrong, then let the assistant build it.

Plan mode matters: ask Claude Code to plan first and show you the steps before it writes code. A plan you can read is cheaper to fix than code you have to rewrite, and it teaches you how the assistant sees the problem.

How do you build the app step by step?

Build one feature at a time, in the order users need it, and run the app after each step. Small steps keep mistakes small, and each working step gives you something to show while the rest is still being built.

  1. Scaffold the project. Ask for the basic app with a home page and a working server, then run it.
  2. Add the data model. Describe what the app stores, such as users, notes and files, and let the assistant create the tables.
  3. Build the main feature. The one thing the app exists for, such as uploading a file or writing a note.
  4. Add the AI feature. Connect the model call on the server, with a clear prompt and a saved result.
  5. Add accounts. Sign-in and per-user data, so one user's work stays private from another's.
  6. Add tests. A test for each feature, run after every change, so a fix in one place cannot break another.
  7. Polish the interface. Fix the rough edges last, once the features work.

After each step, ask Claude Code to run the tests and fix what fails. If it goes in circles on one bug, stop, read the error yourself, and give it a narrower instruction with the exact file and line to look at.

How do you add AI features to the app?

You add AI features by calling a model API from your server, never from the browser, so your API key stays private. The app sends a prompt, the model replies, and your server stores the result alongside the user's data.

AI featureHow it worksWhat to watch
Summarise textSend the text, get back a short versionLong inputs cost more and need chunking
Chat with dataSend the question plus the relevant recordsOnly send the records the user may see
Classify contentSend the item, get back a labelCheck the labels on real examples first

Keep prompts short and specific, and store them as files you can edit without redeploying the app. Test each prompt with real examples before you ship it, because a prompt that works on one example can fail on the next.

Handle errors on the server: if the model call fails, show the user a clear message and save the work they already did. An app that loses a user's text when the model is slow will not get a second chance.

Example (hypothetical): a small team builds a meeting-notes app

Example (hypothetical): a three-person team builds a meeting-notes app with Claude Code. They budget 120 hours over four weeks, which is three people at 10 hours a week each, and they keep the scope to one job: record a meeting, transcribe it and write a summary.

The work splits into seven parts: scaffold 8 hours, accounts 16, file upload 20, transcription 24, summaries 24, interface polish 16, and tests 12. The parts add up to 120 hours, which matches the budget exactly, so nothing is left unplanned.

By week two the app records and transcribes a meeting. By week four it writes summaries and stores them per user. The team spends the last 12 hours on tests, not new features, which is why the first release works instead of needing a week of fixes.

The lesson is the order, not the tool: scaffold first, main feature second, AI feature third, polish last. Teams that start with polish run out of time before the app does anything useful.

What are the common mistakes?

The most common mistakes when building with Claude Code are vague prompts, skipping tests, and letting the assistant change too much at once. Each one turns a fast tool into a slow debugging session.

  • Vague prompts. 'Make it better' gives the assistant no target. Name the file, the behaviour and the result you expect.
  • Skipping tests. Without tests, a fix in one feature quietly breaks another, and you only find out from a user.
  • Huge changes at once. Asking for five features in one prompt produces code nobody can review. One feature per prompt.
  • Secrets in code. API keys pasted into source files end up in Git. Use environment variables from the start.
  • Shipping without review. The assistant's code can look right and still be wrong. Read the diff before every release.

Most of these are habits, not tool problems. A short checklist taped to the monitor, one feature per prompt and tests after every change, prevents almost all of them.

How do you ship and maintain the app?

You ship by deploying the server, setting the model API key as an environment variable, and checking the app end to end with a real user account. Then you watch the first week of use before adding features, because real users find the gaps your tests missed.

Keep a short list of what to watch: errors, model costs, slow requests, and user feedback. Fix the top item each week, and ask Claude Code to help with the fix, not to redesign the app. Small, steady fixes beat big rewrites.

If you want a broader guide to the build, how to build an AI app covers the same ground without a specific tool.

And if the build is bigger than a side project, custom software development can help put the team and the process around it.

Key takeaways

  • Claude Code writes code from short prompts, but you decide what to build
  • A CLAUDE.md file and a plan-first habit keep the assistant on target
  • Build one feature at a time and run the tests after each step
  • Call model APIs from the server, never from the browser
  • Read the diff before every release; the assistant's code can look right and still be wrong

Frequently asked questions

What is Claude Code?

Claude Code is a command-line coding assistant from Anthropic. It reads your project, edits files, runs commands and tests, and explains its changes, all driven by short prompts you type in the terminal. It works with the code in your folder, not in a separate editor.

Do I need to know how to code to use Claude Code?

Some coding knowledge helps a lot. Claude Code writes the code, but you still need to describe what you want, read the changes it makes, and judge whether the result is correct. A beginner can build small apps, but a developer will get further, faster.

How much does it cost to build an app with Claude Code?

Costs vary with the plan you use and the model calls your app makes, so no single figure is honest. The coding assistant itself is billed through your Anthropic plan, and your app's model calls are billed per use. See vendor site for current pricing.

Can Claude Code build a full app on its own?

It can write the code for a full app, including the interface, server, database and tests, but it cannot decide what the product should do or whether a feature is safe to ship. You still own the plan, the review and the release decision.

Is Claude Code better than Cursor?

It depends on how you work. Claude Code suits developers who live in the terminal and want an assistant that edits files and runs commands, while Cursor suits those who prefer an AI-first editor. Both use similar models, so the choice is about workflow, not capability.

How do I keep my API key safe in an app built with Claude Code?

Store the key as an environment variable on your server and never put it in source code or in the browser. Ask Claude Code to use environment variables from the start, and check that no key appears in your Git history before you deploy.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building an AI app and want a team behind it? Talk to Hertiv.

A senior engineer replies within one business day. Or see our Custom Software Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call