cd /news/developer-tools/how-i-set-up-claude-to-actually-work… · home topics developer-tools article
[ARTICLE · art-113223] src=dev.to ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

How I Set Up Claude to Actually Work Like My Pair Programmer

A developer detailed how they configured Claude Code, Anthropic's CLI coding assistant, to function as an effective pair programmer by adding a minimal CLAUDE.md context file, targeted rule files, reusable skills, and simple hooks. The setup eliminated about 80% of trivial corrections and streamlined workflows like PR reviews and commit message formatting.

read3 min views2 publishedAug 27, 2026

For the first few weeks with Claude Code, I used it like an overqualified search engine paste an error, grab the snippet, fix whatever it broke, and repeat. It got the job done, but it felt like pairing with a brilliant junior dev who suffered total amnesia every time I cleared the terminal. After getting fed up with constantly correcting the same package manager slip-ups and component styles, I spent a weekend configuring our repo's context files and hooks so it would actually stop behaving like a complete stranger in the codebase.

The single highest-leverage change was dropping a minimal CLAUDE.md

in the repo root. Don't write a novel here. Mine is around fifteen lines covering the core stack, package manager quirks, and test commands:

- Next.js (App Router), TypeScript, Tailwind CSS
- Package manager: pnpm (never use npm or yarn)
- Test runner: vitest

- Prefer React Server Components unless client interactivity is required
- Strict TypeScript: no explicit `any`
- Run `pnpm lint` before marking tasks complete

Before adding this, the CLI constantly hallucinated npm install

flags in our pnpm workspace and defaulted to old class-based patterns. Putting this baseline in place eliminated about 80% of trivial corrections on day one.

Context files set the mood, but when you need strict constraints, separate rule files work much better. I keep short instructions inside .claude/rules/

that target specific recurring mistakes:

Every rule in that folder exists because the model burned me on something specific. If an instruction runs longer than two or three sentences, it belongs in documentation, not a rule.

If you find yourself typing the same multi-step prompt every morning, turn it into a skill. Skills are essentially reusable markdown prompt recipes that the CLI triggers on command.

I set up a PR review skill (.claude/skills/review-pr.md

) that systematically inspects git diffs, flags missing edge cases, checks error boundaries, and surfaces security red flags before pushing. Another small one formats commit messages following our team's conventional commit schema:


When generating a commit message:
1. Use conventional commit syntax (`feat:`, `fix:`, `refactor:`, `chore:`).
2. Keep the summary line under 50 characters, present tense.
3. Include a bulleted body explaining *why* the change was made if the diff spans multiple modules.

It saves only thirty seconds each time, but across fifty commits a week, that friction adds up.

Hooks run commands automatically on specific lifecycle events—like pre-tool execution or right after a file edit.

I keep two active:

prettier --write

on touched files so diffs stay clean.A quick word of caution: don't overbuild hooks. I initially chained five separate linters and build checks, only to spend half my afternoon debugging why the CLI was hanging on background tasks. Keep them dead simple.

For multi-file refactors or new features, letting an agent blindly edit files across a repository is asking for merge conflicts. I set up a custom command (/loop-feature

) that enforces a strict 4-stage loop:

Catching flawed architectural assumptions during step 1 takes twenty seconds; debugging a half-broken state machine spread across eight files takes an hour.

Start with just a 15-line CLAUDE.md

. Don't try to build an entire automation suite upfront—just add rules and hooks as you run into actual papercuts during your daily work. Over a couple of sprints, those small adjustments compound into an assistant that genuinely matches your engineering cadence.

What’s your go-to setup for keeping CLI coding assistants from drifting off-track? Have you experimented with project-level rules or automated hooks yet? Let me know in the comments below!

Note: The core setup, rules, and configurations in this post come directly from my own workflow experiments, but I used AI to help structure and polish the presentation.

── more in #developer-tools 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/how-i-set-up-claude-…] indexed:0 read:3min 2026-08-27 ·