Dev Tools
How to Use Claude Code on an Existing Project
Start with a small change you can verify against an existing test suite. This walkthrough uses an illustrative input-validation bug so you can adapt the steps to your own repository.
Start from a clean branch
Rungit status --short and preserve any work in progress. On a clean checkout, run git switch -c fix/input-validation. Run the project’s documented checks and record existing failures.
Inspect before editing
Open Claude Code from the repository root. Follow Anthropic’s setup guide if needed. In Plan Mode, ask it to locate where empty input is parsed, identify relevant tests, and propose the smallest fix without editing files. Verify that the named files and commands exist.Make one change and review it
Ask Claude Code to reject empty input using the existing validation error and add one focused regression test. Reviewgit diff for unintended changes and git status --short for new files. Rerun the focused test and the project’s normal checks. If the baseline already failed, compare the new failures with the baseline before attributing them to the patch.
Discover more from CortexHub
Subscribe to get the latest posts sent to your email.
