Sharing My Claude Code Setup: How I Configure Claude in VS Code for Team Infrastructure Work



A colleague on a client project asked me this week: "How did you set up Claude? I want mine to behave the same way." Fair question. Over the past months Claude Code has become my daily co-worker on an Azure AI platform: Bicep landing zones, an API Management gateway, Container Apps, Foundry agents and a stack of Azure DevOps pipelines. Along the way I collected a small set of settings that make it behave predictably in a team.
The nice surprise when writing it down: most of it isn't on my machine at all. It lives in the repositories. This post walks through the whole setup so you can copy it.
The three layers
Claude Code reads configuration from three places, and it helps to think about them separately:
| Layer | Where | Shared with the team? |
|---|---|---|
| Repository instructions | CLAUDE.md in each repo root |
Yes, it's in git |
| User settings | ~/.claude/settings.json, hooks, global CLAUDE.md |
No, per person |
| Memory | ~/.claude/projects/<project>/memory/ |
No, per person |
The rule I follow: anything the whole team should agree on goes into the repo. Personal taste and personal integrations stay in ~/.claude.
Layer 1: a CLAUDE.md in every repo
Every repository on the project has a CLAUDE.md at its root. Claude reads it automatically when it works in that repo, so a colleague gets the same behaviour the moment they git clone.
The gateway repo has the biggest one, about 130 lines:
- what the repo is (infrastructure as code, not an app you build and run);
- the deploy commands per submodule, such as backend onboarding, access contracts and in-place upgrades;
- how to validate Bicep changes and run the validation notebooks;
- the mental model of the platform (contract-driven onboarding of use cases).
The smaller repos only carry one rule that saved us real pain: LF line endings everywhere, enforced by .gitattributes, with instructions for a one-time refresh of old Windows clones. Before that rule existed, half the team saw every file as "modified" because of CRLF. Now Claude knows not to "fix" that by adding core.autocrlf overrides.
Tip: write a CLAUDE.md for the questions a new team member asks in week one. Claude is that new team member every single session.
Layer 2: user settings
settings.json
My ~/.claude/settings.json does two things: it turns off Claude attribution in commits and PRs, and it runs a formatting hook after every file edit.
{
"attribution": {
"commit": "",
"pr": "",
"sessionUrl": false
},
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit|MultiEdit",
"hooks": [
{
"type": "command",
"command": "~/.claude/hooks/format-markdown.sh",
"timeout": 30,
"statusMessage": "Formatting Markdown"
}
]
}
]
}
}Why no attribution? The commits are mine. I review and own every change, and client repos don't need a Co-Authored-By line in their history.
A Markdown hook that closes the loop
We write a lot of documentation: delivery proposals, runbooks, pipeline plans. Claude writes good Markdown, but not always lint-clean Markdown. A classic is a code block inside a numbered list that isn't indented, which silently splits the list in two.
The hook runs after every Write or Edit. For Markdown files it:
- formats the file with prettier;
- lints it with markdownlint-cli2;
- sends any remaining lint errors back to Claude as extra context, so Claude fixes them in the same turn.
That third step is the important one. A hook that only formats is cosmetic; a hook that reports back turns the linter into feedback Claude acts on.
#!/bin/bash
# PostToolUse hook (Write|Edit): format Markdown with Prettier, lint with
# markdownlint-cli2 and hand remaining errors back to Claude.
input=$(cat)
file=$(jq -r '.tool_response.filePath // .tool_input.file_path // empty' <<<"$input")
session=$(jq -r '.session_id // "unknown"' <<<"$input")
case "$file" in
*.md|*.MD|*.markdown|*.mdx) ;;
*) exit 0 ;;
esac
[ -f "$file" ] || exit 0
# Project-local install first (walk up from the file), then PATH, then nvm.
find_tool() {
local name=$1 dir found p
dir=$(dirname "$file")
while [ "$dir" != "/" ]; do
if [ -x "$dir/node_modules/.bin/$name" ]; then
echo "$dir/node_modules/.bin/$name"
return
fi
dir=$(dirname "$dir")
done
found=$(command -v "$name" 2>/dev/null)
if [ -z "$found" ]; then
for p in "$HOME"/.nvm/versions/node/*/bin/"$name"; do
[ -x "$p" ] && found="$p"
done
fi
echo "$found"
}
prettier=$(find_tool prettier)
markdownlint=$(find_tool markdownlint-cli2)
context=""
if [ -n "$prettier" ]; then
"$prettier" --write --log-level warn "$file" >/dev/null 2>&1
fi
if [ -n "$markdownlint" ]; then
errors=$(cd "$(dirname "$file")" && "$markdownlint" --config "$HOME/.claude/hooks/.markdownlint.jsonc" ":$(basename "$file")" 2>&1 | grep -E ' (error|warning) MD[0-9]+' | head -25)
if [ -n "$errors" ]; then
context="markdownlint found issues in $file after formatting. Fix them now. For MD029, indent content inside numbered list items so the list isn't split. For MD040, give every code fence a language.
$errors"
fi
fi
missing=()
[ -z "$prettier" ] && missing+=("prettier")
[ -z "$markdownlint" ] && missing+=("markdownlint-cli2")
marker="${TMPDIR:-/tmp}/claude-md-tools-missing-$session"
if [ ${#missing[@]} -gt 0 ] && [ ! -e "$marker" ]; then
touch "$marker"
context="${context:+$context
}Markdown formatting hook: ${missing[*]} not installed, so $file was not fully formatted/linted. Tell the user and propose installing it: \`npm i -g ${missing[*]}\`."
fi
[ -z "$context" ] && exit 0
jq -n --arg c "$context" '{hookSpecificOutput: {hookEventName: "PostToolUse", additionalContext: $c}}'A few design choices worth stealing:
- Project-local tools first. If a repo pins its own prettier in
node_modules, the hook uses that one. - nvm fallback. Hooks don't always get your shell's
PATH, so the script also looks under~/.nvm. - Missing tools are reported once per session, not after every edit. Claude then tells you and proposes the install command.
The lint base config sits next to the hook in ~/.claude/hooks/.markdownlint.jsonc. A repo's own .markdownlint* file still wins:
{
"default": true,
"MD013": false,
"MD033": false
}I turn off MD013 because prose isn't hard-wrapped, and MD033 because READMEs use inline HTML for badges and <details>.
A short global CLAUDE.md
~/.claude/CLAUDE.md holds rules that apply to every project. Mine is short on purpose:
# Personal rules (all projects)
- Never credit Claude in git: no Co-Authored-By trailer, no "Generated with Claude Code" in PRs.
- In client repos, use my client git identity per repo (user.email), never my private address.
- Merge PRs and start deploys only after my explicit instruction for that specific item.
- Team chat messages in Dutch, paste-ready.The git identity rule exists because I work for several clients and on my own projects from the same machine. A per-repo git config user.email plus this rule means no more commits from the wrong address.
Permissions: autonomy with a hard stop
I run Claude Code in auto mode. It reads files, runs az queries, edits code, commits and pushes feature branches without asking each time. That's where the speed comes from.
But anything that touches shared environments stops and waits for me: a pipeline deploy, merging a PR, a change to production-like resources. The permission classifier blocks those until I give an explicit "go" for that specific item. This morning, for example, Claude found that a merged fix had never been deployed (the pipeline is manual), proposed the deploy, got blocked, and waited. I said "go ahead and run it", it started the pipeline, watched it to completion and handed me a ready-to-paste message for the colleague who was testing at the time.
If you're new to this, start in the default mode, where every action needs approval, and loosen up as you learn what Claude does.
Memory: personal, and that's fine
Claude Code keeps per-project memory files: what we decided, which PRs are merged, gotchas like "every gateway deploy rewrites the routing fragments, so check the re-apply step". I sync mine between my two Macs through cloud storage with a small symlink script.
I deliberately don't share memory with colleagues. Memory is a working notebook, full of half-finished context. Anything the team should know gets promoted to a CLAUDE.md or a doc in the repo, through a PR.
Onboarding a colleague in ten minutes
For my colleague, the whole setup came down to this:
- Install VS Code, the Claude Code extension, Git, Azure CLI (plus Bicep and the
azure-devopsandcontainerappextensions), jq, Node.js, andnpm i -g prettier markdownlint-cli2. az loginand set the Azure DevOps defaults.- Clone the repos into a normal folder. Not OneDrive, iCloud or Google Drive: git repos and sync clients don't mix.
- Set the client git identity per repo.
- Copy
settings.json, the hook and the lint config into~/.claude. - Verify:
/memoryshows the global and repoCLAUDE.md;az account showworks from Claude;- editing a
.mdfile shows "Formatting Markdown"; - a test commit has no attribution trailer and the right email.
What I left out on purpose: my personal MCP servers (my own M365 tenant, this blog, O'Reilly), personal skills and a local LLM setup. They're great for me and irrelevant to the project.
Takeaways
- Put team rules in the repo's
CLAUDE.md; that's the part that scales. - Use hooks that report back to Claude, not just hooks that reformat.
- Give Claude real autonomy, with a hard stop on shared environments.
- Keep memory personal; promote what matters to the repo.
If you have a setup trick I should steal, let me know.
Start writing your content here...