Part 3 of 3 in the “Building with Claude Code” series
In Part 1, we set up Claude Code and made our first commit. In Part 2, we built a complete web app using Plan Mode and feature branches. Now let’s talk about the tricks that make you fast.
This post covers the techniques that turned Claude Code from “a cool AI tool” into a permanent part of my workflow.
Git Automation: Let Claude Handle the Tedious Parts
Auto-Generated Commit Messages
Writing good commit messages is important but tedious. Claude Code reads the actual diff and writes accurate messages for you:
Stage all changes and write a commit message following conventional
commits format. Summarize what changed and why.
Claude looks at every changed file, understands the semantic meaning, and writes something like:
feat: add tag filtering sidebar with real-time bookmark count
- Added TagService with methods to aggregate unique tags and counts
- Created /api/tags endpoint returning tag statistics
- Built sidebar component with clickable tag pills
- Integrated frontend filtering via fetch API
- Tags with zero bookmarks are automatically cleaned up
Piping Diffs into Claude for Code Review
This is my favorite trick. From a regular terminal:
git diff | claude -p "Review these changes for bugs, security
issues, and code quality. Be specific about file and line."
I’ve caught real issues this way: an XSS vulnerability in a Thymeleaf template, a missing null check, and an N+1 query problem. It’s not a replacement for human review, but it catches a lot of the obvious stuff before it goes anywhere near main.
Same approach works for pull requests:
gh pr diff 3 | claude -p "Review this PR. Focus on: security,
error handling, and API contract consistency."
The GitHub App for Automated PR Reviews
/install-github-app
This installs the Claude Code GitHub App on your repo. When you open a PR, Claude automatically reviews it and posts comments. Worth setting up once and forgetting about.
Tagging Releases
Create a git tag v1.0.0 with the message "Initial release:
bookmarks manager with CRUD, import/export, tag management,
and web UI". Push the tag to origin.
Then create a GitHub release:
gh release create v1.0.0 --generate-notes
Context Management: The Part Most People Get Wrong
Claude Code has a ~200K token context window. When it fills up, quality drops. You’ll notice it before it becomes obvious: Claude starts forgetting decisions you made earlier, or producing code that contradicts the established patterns. Don’t wait for that.
The /compact Command
/compact
Summarizes the conversation, freeing context while preserving important decisions. Run it before starting each new feature, after long debugging sessions, or whenever Claude seems to be forgetting earlier decisions.
The /clear Command
/clear
Wipes the conversation entirely but CLAUDE.md still loads automatically. Use when switching between unrelated tasks.
When to Use Which
| Situation | Command |
|---|---|
| Starting a new feature | /compact |
| Switching to an unrelated task | /clear |
| Claude forgot something | /compact, then repeat it |
| Long debugging session ended | /compact |
| Starting a fresh work session | Just open Claude, CLAUDE.md loads automatically |
CLAUDE.md as Living Documentation
CLAUDE.md isn’t just documentation. It’s configuration for your AI teammate. Every convention you put here, Claude follows automatically. Include your tech stack, coding conventions, Git workflow, API endpoints, and architecture decisions.
Update it regularly, especially after you’ve made decisions you don’t want to re-explain next session:
Update CLAUDE.md to reflect the current state of the project.
Add any new features, endpoints, and decisions we made.
The Prompt Library System
After a weekend with Claude Code, I formalized my reusable prompts into a system with three layers:
Layer 1: PROMPTS.md in the Repo
A file at the project root with every reusable prompt, organized into categories: feature development, Git workflow, debugging, and code quality. Since it’s in your repo, it travels with the project. Future you will appreciate it.
Layer 2: Cheat Sheet Pinned in IntelliJ
A compact markdown file with just the commands and shortcuts. Open it in IntelliJ, right-click the tab, select Pin Tab. It stays visible no matter what else you open.
Layer 3: Printed Reference Card
A one-page PDF with every command, shortcut, prompt template, and the conventional commit format. After a week, most of it becomes muscle memory and you stop needing it. But it’s useful during the learning phase.
Terminal One-Liners
Power moves that don’t require an interactive session:
# Quick question, no session needed
claude -p "What Kotlin version is this project using?"
# Review uncommitted changes
git diff | claude -p "Review these changes for issues"
# Review a PR
gh pr diff 3 | claude -p "Review this PR for bugs and security"
# Analyze logs
cat app.log | claude -p "Summarize errors and suggest fixes"
# Security scan on changed files
git diff main --name-only | claude -p "Review these files for security issues"
What I’d Do Differently Next Time
- Start with CLAUDE.md on day one, not as an afterthought
- Run /compact proactively, don’t wait until Claude starts forgetting
- Use Plan Mode for everything over 2 files
- Let Claude write every commit message
- Keep PROMPTS.md in the repo from the start
- Feature branches aren’t overhead, they’re a safety net
The Bigger Picture
This tool doesn’t replace coding skill. It amplifies it. When I gave vague prompts, I got mediocre results. When I was specific, when I used Plan Mode, structured my requests clearly, the output was genuinely impressive.
The developers who get the most from Claude Code are the ones who already know what good code looks like and can articulate what they want. The AI handles a lot of the typing. The thinking is still on you.
Full Series
- Part 1: Getting Started with Claude Code. Setup, IntelliJ, CLAUDE.md, and your first commit.
- Part 2: Building a Web App with Claude Code. Plan Mode, feature branches, and debugging.
- Part 3: Claude Code Power User: Git automation, context management, prompt libraries (you are here)
All code is on GitHub.