back / blog
8 min read

My AI-native dev workflow — how I actually use Claude Code daily

A no-hype look at integrating Anthropic's Claude Code CLI into a daily production workflow, focusing on context management, token spend, and agent failures.

I have been running Claude Code directly inside my local terminal environments for several months now. It has fundamentally shifted how I approach mundane refactoring and boilerplate generation across my personal projects and client builds at PrimoDevStudio. However, the internet is currently flooded with low-effort hype pieces claiming that AI has completely replaced the need for software engineering. That narrative is nonsense.

If you treat an agentic CLI tool like a magic wand that can autonomously ship entire production features while you get a coffee, you will quickly end up with an exploded token bill, corrupted local git state, or a subtle logic bug that takes hours to trace. Claude Code is a powerful tool, but using it effectively requires understanding its hidden cost structures, its specific structural limitations, and knowing exactly when to take back manual control of the keyboard.

The mechanics of the agentic loop

Unlike basic IDE autocomplete extensions or web-based chat wrappers that simply suggest text code blocks, Claude Code operates within an active agentic execution loop. When you feed it a terminal prompt like "fix the broken validation logic inside our auth middleware," the utility doesn't just guess a patch; it moves through distinct phases of context ingestion, command execution, and verification.

It reads the file tree, targets the relevant source files, alters lines directly on your local disk, and runs your test commands or linter suites natively inside your shell environment to confirm that its changes actually pass your project's validation rules.

# Starting a clean session pinned to the project repository
cd /path/to/project-repo
claude

The friction point here is the geometric expansion of your context window. Every time Claude Code executes a tool — whether running npm test, reading a file block, or applying a unified diff patch — that complete interaction trace gets appended to the ongoing session history.

By turn fifteen of a continuous debugging session, your input footprint isn't just your latest prompt; it is the entire accumulated weight of every prior file read and terminal output trace combined. If you are not paying attention to your session length, a single final prompt can easily resubmit 150,000 background tokens straight into Anthropic's inference engines, burning through your rolling 5-hour usage caps in a matter of minutes.

The strategic setup of CLAUDE.md

To keep the agent functioning efficiently without continuously wasting tokens on basic layout explanations, you have to establish a hard contract using a local CLAUDE.md file saved at the absolute root of your project directory. Claude Code reads this file automatically at the start of every single message turn, making it the perfect mechanism to enforce structural guidelines.

# PrimoDevStudio Project Conventions

## Tech Stack
- Frontend: Vue 3 (Composition API, Script Setup, TypeScript)
- Style: Tailwind CSS (Utility classes only, no @apply)

## Code Standards
- Use explicit TypeScript interfaces; avoid 'any' completely.
- Keep component files under 150 lines; extract logic to composables where possible.
- Use British English spelling for all descriptive tokens (e.g., colour, optimise).

## Commands
- Build: `npm run build`
- Lint: `npm run lint`
- Test: `npm run test:unit`

Providing explicit, exact system commands inside this layout blocks Claude from hallucinating random test scripts or executing incorrect build tools when trying to verify its work.

Equally critical is setting up a thorough .claudeignore file inside your repository. By default, if the agent attempts an open-ended codebase search, it will try to traverse every file it can find. Explicitly ignoring directories like .next/, dist/, node_modules/, and heavy assets or image folders keeps your local context footprint incredibly lean and stops the agent from getting stuck in deep recursive loops inside compiled lockfiles.

Where the agent breaks down: refactoring a 600-line file

A great use case for Claude Code is splitting up old, messy files into clean, decoupled structures. I recently tasked it with taking a bulky, 600-line legacy Vue component from an old layout iteration and breaking the inner logic pieces out into standalone TypeScript composables.

The task started smoothly. The agent read the component file, isolated the internal state machines, and generated a clean, external composable file exactly as requested. The failure occurred when it attempted to rewrite the original component file to import and consume the new composable. Because the file was long and contained heavy inline template structures, the generated patch failed to align cleanly with the existing lines on disk, causing the execution loop to hit a patch collision error.

Instead of backing out and evaluating the error safely, the agentic loop entered an automated correction cascade. It re-read the file, generated a slightly different diff, hit the same collision, and tried again.

// The correction loop error signature that signals it is time to exit
[Agent Tool Use]: write_file (Applying patch...)
[Terminal Output]: Error: Patch could not be applied cleanly at line 412
[Agent Tool Use]: write_file (Retrying alternative patch structure...)

Within four rapid-fire cycles, this automated iteration loop consumed nearly 80,000 tokens trying to force an invalid diff format onto the disk.

When you see an agent attempt the exact same file edit or terminal command twice in a row with slight syntax alterations, you need to intervene immediately. Hit Ctrl+C to interrupt the execution chain, look at the partial file state on disk, and manually clean up the import lines yourself. The tool excels at generating pure logical abstractions, but it still struggles with massive, multi-context layout compositions.

Trade-offs and what doesn't work

The biggest trap when integrating Claude Code into your daily engineering loop is the psychological erosion of your own critical code-review habits. Because the CLI moves quickly, executes tests automatically, and outputs highly confident diff summaries, it is incredibly easy to simply review its terminal logs, assume everything is perfect, and commit the changes blindly to your git branch.

I have caught the agent subtly changing the runtime behaviour of edge-case conditional checks because a test suite lacked complete code coverage to flag the deviation. If your test matrix doesn't actively assert the specific safety limits of an architectural boundary, the model will occasionally refactor away vital defensive code branches simply because it interpreted them as redundant syntax.

Additionally, using the tool for complex configuration plumbing — like setting up deep Docker Compose networks, managing localised reverse-proxy settings, or debugging obscure Webpack/Vite compilation errors — frequently results in a circular waste of time. The model relies heavily on standard public documentation paradigms; the moment it runs into a nuanced, machine-specific environment variable mismatch, its automated shell commands will simply guess alternative parameter flags until your usage budget is entirely drained.

Closing take

Claude Code is a permanent fixture in my development terminal, but I treat it strictly as a highly efficient, text-driven junior pair programmer, not an autonomous engineering department. Use it to generate repetitive boilerplate patterns, write boring unit test files, and scaffold isolated data types, but manage the execution session continuously. Keep your CLAUDE.md boundaries strict, use the /compact or /clear commands frequently to wipe away accumulated context history, and never let an automated agent run through a failing tool loop without hitting the break switch.