In late April 2026, "Getting Claude Code to Write Code Our Way (Part 1) — Auto-Extracting Project Conventions" ranked on Zenn Trending. The concept of "having AI extract 'conventions' from an existing codebase and committing them to CLAUDE.md / AGENTS.md" directly addresses a longstanding challenge in custom development.
In our custom development projects, client-specific coding conventions (directory structure, naming conventions, testing strategy, commit granularity, etc.) differ every time, meaning the step of "passing down conventions" to newly onboarded members or AI agents has always been a bottleneck. In this article, we outline the architecture for automatically extracting client conventions with Claude Code from the perspective of custom development.
Why "passing down conventions" is always a bottleneck in custom development
In custom development, the patterns where new participants (human or AI) get stuck during their first week are nearly identical across all projects.
| Bottleneck pattern | Typical example | Lost effort |
|---|---|---|
| Directory structure conventions are undocumented | Place in components or features? | 1–2 days |
| Naming conventions remain tacit knowledge | getUserById or findUser? | 0.5–1 day |
| Test granularity differs across teams | Who writes E2E? Unit tests only? | 1–2 days |
| Commit guidelines passed down orally | Conventional Commits? Are Japanese titles allowed? | 1 day |
| Error-handling philosophy | throw or Result type? | 1–3 days |
| API call abstraction level | Direct fetch calls? Dedicated client layer? | 2–3 days |
Typically, the first 1 to 2 weeks vanish entirely into "catching up on conventions" across these factors combined. If you work with 5 clients, that equates to roughly 5 weeks consumed by "learning conventions" per onboarded member, which becomes fatal when scaling custom development.
3 steps to have Claude Code extract "our style"
Here are the 3 steps adapting the original article's approach for practical operations in custom development.
Step 1: Sample the entire codebase to extract "candidate conventions"
Instruct Claude Code to "extract and list patterns consistently used across this repository." In practice, pass a prompt like the following via the claude command.
claude -p "src/ 配下のコードを 30 ファイルランダムにサンプリングし、
以下の観点で『一貫して使われているパターン』を抽出してください:
1. ディレクトリ命名
2. ファイル命名
3. 関数命名
4. import 順序
5. エラーハンドリング
6. 型定義の置き場所
7. テストの書き方
表形式で出力してください。" > .ai/conventions-draft.md
The key here is to have Claude separate "patterns it noticed" from "patterns it inferred." The former carries high confidence, whereas the latter requires human review.
Step 2: Human triage of extracted "candidate conventions"
A human reviews the output from Step 1 and sorts it into three categories.
| Categorization | Handling | Examples |
|---|---|---|
| Formally adopted | Transcribe into AGENTS.md as instructions | "All files must use named exports only" |
| Pending | Record in DESIGN.md as "Currently so, but unclear if intentional" | "Test files belong under __tests__" |
| Rejected | Ignore as incidental artifact | "Some locations use variable names a, b, c" |
In custom development, triage should ideally be conducted by two people: the tech lead and the client's representative engineer. This is because patterns the client considers "accidents rather than conventions" will inevitably appear.
Step 3: Transcribe into AGENTS.md / SKILL.md / DESIGN.md and begin operations
Distribute and place formally adopted conventions into a three-tier structure: AGENTS.md (instructions) / SKILL.md (reusable procedures) / DESIGN.md (decision logs). What is crucial in custom development is separating "our company's standard templates" from "project-specific rules" into distinct files.
docs/
AGENTS.md ← 弊社共通テンプレ(コピー元から)
AGENTS.client.md ← Step 2 で抽出した今回案件固有の流儀
SKILL.md ← 弊社共通スキル
SKILL.client.md ← 今回案件固有のスキル
DESIGN.md ← 意思決定ログ(毎案件新規)
By configuring Claude Code to read both AGENTS.md and AGENTS.client.md, improvements to the standard template automatically propagate across all projects while project-specific conventions remain independently maintained.
5 easily overlooked forms of tacit knowledge during extraction
When executing this in practice, certain forms of tacit knowledge will inevitably be missed by Claude (or buried in noise). Here are 5 common examples encountered in custom development.
| Tacit knowledge | Why automated extraction is difficult | Supplementary capture method |
|---|---|---|
| "Why this library was chosen" | Leaves no trace in the code | Rationale field in git log + interviews with stakeholders from that time |
| "Production incidents and workarounds" | Only the fixed code remains | Provide incident reports / postmortems separately |
| "Client review perspectives" | Absent from custom development repositories | Obtain permission to reference the client's internal wiki |
| "Manual deployment tasks" | Not codified | Conduct a 30-minute interview with deployment leads |
| "Specification edge cases" | Not documented in tests | Complaint history via sales / customer support |
Because Claude Code alone misses these, humans must interpose a process to "gather insights through interviews before feeding them to AI." This represents the existing repository version of the "Context layer collection" discussed in Requirements Definition in the AI Agent Era — Three-Tier Design for Spec, Context, and Harness.
CI integration — Mechanism for preserving conventions
The classic failure mode for extracted conventions is "written down but never followed." Enforcing adherence in custom development requires CI integration, which, like "budgeting for AI coding" discussed in Optimizing Claude Code Operational Costs 2026, represents an approach of securing adoption rates through systematic mechanisms.
# .github/workflows/conventions-check.yml
name: Conventions Check
on: [pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Claude Code Convention Check
run: |
claude -p "$(cat docs/AGENTS.md docs/AGENTS.client.md) \
に違反する箇所を PR diff から検出し、JSON 出力" \
--diff origin/main..HEAD > violations.json
- name: Post review comments
run: node scripts/post-conventions-review.mjs violations.json
The essential factor here is to separate "violation detection" from "automatic remediation." By keeping detection continuous in CI while having agents create separate PRs for fixes after human review, you prevent merging code without noticing rule violations.
Operational maintenance for "convention updates" — Monthly reviews
Extracted conventions are living artifacts. They evolve with the arrival of new members, library updates, and production incidents. A monthly review meeting represents the practical solution for stable operations in custom development.
| Agenda | Owner | Duration |
|---|---|---|
| Share last month's top 5 rule violations | Tech Lead | 10 min |
| Revision proposals for AGENTS.md / AGENTS.client.md | All | 30 min |
| Review decisions requiring new entries in DESIGN.md | Tech Lead + PM | 15 min |
| Observations on Claude Code behavior | All | 15 min |
An investment of 70 minutes once a month simultaneously achieves preventing convention decay and refreshing team consensus.
Handoff checklist — 10 items ready to use in custom development
- AGENTS.md and AGENTS.client.md are separated
- AGENTS.client.md contains only project-specific rules
- SKILL.md / SKILL.client.md are similarly separated
- DESIGN.md has been continuously updated since project kickoff
- Automated detection of AGENTS.md violations is running in CI
- Minutes of monthly review meetings are recorded under docs/decisions/
- The relationship between "our standard template" and "client-specific rules" is clarified in README
- Source data for convention extraction (sampling results) is preserved in the repository
- The "rejection list" of conventions is also logged in DESIGN.md
- 90-day post-handoff review support is stipulated in the SOW
Conclusion — What supports custom development scale is "AI inheritance of conventions"
The approach of "getting Claude Code to write code our way" serves as the key to breaking through scalability limits in custom development. Even if the client count grows to 10 or 20, establishing mechanisms where AI inherits each client's conventions so new members can become productive in their first week multiplies development productivity several times over.
However, whether Step 1 sampling suffices, which client-side stakeholders need to be involved in Step 2 triage, and whether to implement violation detection down to the CI level—the exact scope required from the steps outlined in this article will depend on repository scale and how tacit knowledge is distributed. If you face situations where "tacit knowledge in existing repos is siloed, preventing new members from ramping up" or "Claude Code was introduced but conventions are ignored," we can start by reviewing your target repository's current status and determining the roadmap together. Please consult us via our contact form.








