13 Proven Claude Code Practices to Supercharge Your Development Workflow
This article shares thirteen practical tips from Claude Code co‑creator Boris Cherny, covering concurrent sessions, hybrid local‑cloud setups, model selection, team‑wide CLAUDE.md documentation, automated PR updates, plan mode, slash commands, subagents, formatting hooks, fine‑grained permissions, MCP integration, long‑task safeguards, and verification loops to treat Claude as a manageable development infrastructure.
Claude Code Best Practices
Author "煎鱼" summarizes the thirteen best‑practice tips posted by Claude Code co‑creator Boris Cherny, showing how to treat Claude as a manageable engineering infrastructure rather than a simple chatbot.
1. Run 5 Concurrent Claude Instances
Boris opens five terminal tabs, each hosting an independent Claude session numbered 1‑5, and uses iTerm2 system notifications to alert when input is required.
2. Hybrid Local + Web Sessions with Teleport
In addition to the five local instances, Boris runs 5‑10 parallel sessions on claude.ai/code. He synchronises context between local and web sessions using the --teleport flag and occasionally launches tasks from the iOS client.
3. Use Opus 4.5 (Thinking Mode)
He prefers the larger Opus 4.5 model with the thinking mode because it requires fewer correction steps and more accurate tool calls, ultimately being faster than smaller models. The current recommendation is Opus 4.6.
4. Team‑Shared CLAUDE.md
The team checks a CLAUDE.md file into the Git repository and updates it multiple times per week. Any case where Claude makes a mistake is added to the file to prevent recurrence.
# CLAUDE.md 示例(节选)
## 代码规范
- 提交信息格式必须是 `type(scope): description`
- 不要直接修改 main 分支,必须通过 PR
- TypeScript 文件禁止使用 `any` 类型
## 常见错误
- 不要在测试文件里导入 production 依赖
- 处理异步操作时必须加 error boundary5. Auto‑Update CLAUDE.md in PRs via @claude
During code review, Boris tags @claude in a teammate’s PR, triggering a GitHub Action that updates CLAUDE.md automatically.
# .github/workflows/claude-review.yml
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize]
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}6. Plan Mode Followed by Auto‑Accept Edits
Most sessions start in Plan mode (triggered by pressing Shift+Tab twice). The workflow is:
Enter Plan mode.
Iteratively discuss the plan with Claude until it looks reasonable.
Switch to auto‑accept edits mode.
Let Claude generate the implementation in one go.
7. Slash Commands for Frequent Operations
Repeated actions are encapsulated as slash commands stored under .claude/commands/. Example command /commit-push-pr:
# .claude/commands/commit-push-pr.md
---
description: Commit changes, push to remote, and create a PR
---
当前 git 状态:
$(git status --short)
当前分支:$(git branch --show-current)
请帮我:
1. 根据改动内容生成合理的 commit message(遵循 conventional commits 规范)
2. 执行 git add -A && git commit
3. push 到远端
4. 用 git 命令创建 PR,标题和 commit message 保持一致8. Subagents for Automated Workflows
Subagents act like specialized slash commands. Boris uses: code-simplifier: automatically simplifies code after Claude finishes a task. verify-app: runs end‑to‑end tests on Claude Code itself.
Example code-simplifier agent:
# .claude/agents/code-simplifier.md
---
name: code-simplifier
description: 在代码实现完成后,检查并简化代码
---
请检查刚才修改的所有文件,找出以下问题并修复:
1. 重复代码,提取成函数
2. 过于复杂的逻辑,简化表达
3. 未使用的变量或导入
4. 可以用更简洁的语法替代的地方
不要改变功能,只优化代码质量。9. PostToolUse Hook for Automatic Formatting
After Claude edits a file, a PostToolUse hook runs prettier to ensure code passes CI.
{
"hooks": {
"PostToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "prettier --write $CLAUDE_TOOL_INPUT_PATH 2>/dev/null || true"
}
]
}
]
}
}10. Fine‑Grained Permission Management
Instead of using --dangerously-skip-permissions, Boris defines allowed commands in .claude/settings.json and invokes them via a /permissions command.
{
"permissions": {
"allow": [
"Bash(git:*)",
"Bash(npm:*)",
"Bash(gh:*)",
"Bash(bq:*)",
"Bash(grep:*)",
"Bash(find:*)"
]
}
}11. MCP Integration for External Tools
Claude can call Slack, BigQuery, and Sentry through an MCP server defined in .mcp.json.
{
"mcpServers": {
"slack": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-slack"],
"env": {"SLACK_BOT_TOKEN": "${SLACK_BOT_TOKEN}"}
},
"sentry": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-sentry"],
"env": {"SENTRY_AUTH_TOKEN": "${SENTRY_AUTH_TOKEN}"}
}
}
}12. Stop Hook or ralph‑wiggum Plugin for Long Tasks
For long‑running jobs, Boris either spawns a background verification agent, uses a Stop hook, or the ralph-wiggum plugin to confirm completion. Example Stop hook:
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "npm run verify:quick 2>&1 | tail -5"
}
]
}
]
}
}When running entirely in a sandbox, he adds --permission-mode=dontAsk to avoid interruptions.
13. Verification Loop – Let Claude Check Its Own Work
Boris stresses a feedback loop where Claude validates results, increasing quality 2‑3×. Verification methods include:
Backend logic: run unit/integration tests, e.g. npm run test -- --testPathPattern="src/features/payment" Frontend UI: use the Claude Chrome Extension to manually test interactions.
CLI tools: execute commands and check output, e.g. ./cli --help | grep -E "^ [a-z]" | head -20 API: send real requests and verify status code and payload, e.g.
curl -s -o /dev/null -w "%{http_code}" -H "Authorization: Bearer $TOKEN" http://localhost:3000/api/usersThe core idea is to embed these checks into the workflow so Claude can self‑verify without human review.
Conclusion
All thirteen practices form a consistent theme: treat Claude as a manageable piece of engineering infrastructure. CLAUDE.md stores team conventions, slash commands and subagents automate workflows, hooks extend CI/CD, MCP integrates external tools, and concurrent instances provide personal compute scheduling.
By systematising these patterns, teams can get more reliable, token‑efficient results from Claude Code.
IT Services Circle
Delivering cutting-edge internet insights and practical learning resources. We're a passionate and principled IT media platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
