How to use Claude Code CLI for full-stack development
Claude Code CLI installed, git repository
What this does
Using Claude Code CLI enables developers to leverage an AI coding assistant directly in the terminal for full-stack development tasks. The CLI agent can read and edit files, run shell commands, manage git operations, and iterate on code changes across frontend and backend codebases. This workflow accelerates feature development by handling boilerplate, debugging, and refactoring while keeping the developer in control of the review-and-commit cycle.
Steps
Launch Claude Code from the project root with claude code. The interactive session begins with the agent scanning the repository structure. Start with a broad task description: "Build a REST API endpoint for user profiles with GET and PUT handlers." The agent reads existing route files, identifies patterns, and proposes implementations. Review each change before accepting with the diff view. For frontend work, specify the framework: "Create a React dashboard component that fetches and displays profile data from the /api/profile endpoint." Use the --apply flag for non-interactive mode: claude code --apply "Fix all TypeScript errors in src/components". When satisfied, commit changes with git add -A && git commit -m "feature: add user profile API and dashboard".
Record the local run evidence. Save the exact command, runtime or package version, model name if applicable, and observed output so the result can be reproduced later.
Confirm the local starting state. Print the active binary, package version, model name, or configuration path before changing the workflow.
Run the smallest complete path. Execute the minimum command or script that proves the guide works end to end on the local machine.
Compare against expected output. Check the final line, status code, generated artifact, or model response against the verification section before expanding the setup.
Record the local run evidence. Save the exact command, runtime or package version, model name if applicable, and observed output so the result can be reproduced later.
Verification
Run the project test suite with npm test or pytest and confirm all tests pass. Start the development server and manually verify the new endpoints respond correctly—for the profile endpoint, send curl http://localhost:3000/api/profile/1 and check for a 200 response with JSON data. Run the linter with npm run lint and confirm zero errors. Check the git diff between the original and modified files to verify only intended changes were made. If using TypeScript, run npx tsc --noEmit to confirm type safety.
Common failures
Agent generates code files without importing dependencies: Review each new file for missing import statements and add them before accepting changes. Git history becomes cluttered with undo commits: Use git commit --amend or interactive rebase to squash WIP commits before pushing. Agent misunderstands framework conventions: Provide a code snippet demonstrating existing patterns so the agent matches style. API call fails due to missing environment variable: Set all required env vars in .env before running the agent. Test failures after agent refactor: Run tests incrementally and isolate the failing test to understand which change broke it.
- Version mismatch - The installed package or runtime differs from the command shown; check the version first and rerun the smallest verification command.
- Local environment drift - Another service, virtual environment, model, or path is being used; print the active binary path and configuration before changing the guide steps.
Related guides
- build-code-generation-agent-local-models
- setup-agent-tool-use-function-calling
- implement-guardrails-ai-agents