Claude Code fundamentals
Claude Code is an agentic development environment that can inspect files, search a repository, edit code, run commands, and verify results. Its core working loop is to gather context, take action, and validate the outcome, while allowing the user to interrupt and redirect the work.
Start a project session
Open a terminal in the project root:
cd /path/to/your/project
Check the current repository state:
git status
Start Claude Code:
claude
Before allowing modifications, confirm the active branch, existing uncommitted changes, project instructions, and applicable security requirements.
Understand the codebase before editing
Begin with broad exploration, then narrow the investigation to the relevant feature or issue. Anthropic's workflow guidance recommends asking for a high-level overview before requesting deeper architectural or execution-flow analysis.
Use requests such as:
Give me a concise overview of this codebase.
Include:
- Main directories
- Application entry points
- Architecture patterns
- Testing approach
- Build and validation commands
- Important project conventions
Do not modify any files.
Then narrow the analysis:
Identify the files involved in user authentication.
Explain:
- How the files interact
- The execution flow
- Where validation occurs
- Which tests cover this behavior
Do not make changes yet.
Use a controlled engineering workflow
- Explore — Ask Claude to inspect the relevant files, conventions, dependencies, tests, and execution flow without modifying anything.
- Plan — Request a scoped implementation plan containing assumptions, affected files, risks, validation steps, and rollback considerations.
- Implement — Approve the plan, ask Claude to make focused changes, and avoid unrelated refactoring or dependency upgrades.
- Verify — Run tests, linting, type checks, security checks, and the production build before reviewing the final diff.
Request a plan before implementation
Analyse the requested change and create an implementation plan.
Include:
1. Current behavior
2. Proposed behavior
3. Files that may change
4. Validation and error handling
5. Security considerations
6. Tests to add or update
7. Commands used to verify the result
Do not modify files until the plan is reviewed.
Implement with clear boundaries
Implement the approved plan.
Requirements:
- Keep changes limited to the approved scope
- Follow existing project conventions
- Preserve backward compatibility
- Add type hints or types where applicable
- Include input validation and error handling
- Update or add tests
- Do not modify unrelated files
Give Claude verification criteria
Claude performs more reliably when the task includes a test, build, lint command, expected output, fixture, screenshot, or another measurable completion signal.
After implementation:
1. Run the relevant tests
2. Run linting and type checks
3. Run the production build
4. Review the complete diff
5. Report any remaining risks or assumptions
Do not claim completion if any required check fails.
Review the result
git status
git diff
Review:
- Files changed
- Logic and edge cases
- Error handling
- Security implications
- Test coverage
- Dependency changes
- Configuration changes
- Documentation impact
Continue after successfully exploring a repository, reviewing a plan, completing a small scoped change, running validation, and reviewing the final Git diff.