All articles

Setting Sensible Defaults for a New Project

Starting a new repo is the best moment to set up Claude Code well. A small project settings file gets the whole team a sane baseline from day one. Here's a starter you can adapt.

A starter project file

Drop this into .claude/settings.json and commit it:

{
  "model": "sonnet",
  "permissions": {
    "allow": [
      "Read",
      "Grep",
      "Glob",
      "Bash(npm run test:*)",
      "Bash(npm run lint)"
    ],
    "deny": [
      "Bash(git push:*)"
    ]
  },
  "env": {
    "NODE_ENV": "development"
  },
  "includeCoAuthoredBy": false,
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [
          { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATHS\"" }
        ]
      }
    ]
  }
}

What each part buys you

  • model pins the model so every teammate starts on the same one.
  • permissions pre-approves reading and your test and lint scripts, and blocks pushing, so nobody gets surprise prompts on safe work while risky commands stay guarded.
  • env sets the mode the project expects.
  • includeCoAuthoredBy keeps the commit history in whatever style your team agreed on.
  • hooks auto-formats files right after Claude edits them, so the code stays tidy without anyone thinking about it.

Tune it to the project

This is a starting point, not a law. Swap npm for your package manager, change the allowed scripts to match your setup, and adjust the model to fit the work. Keep secrets out — the project file is committed, so anything sensitive belongs elsewhere.

With a file like this in place, everyone who clones the repo gets a working, safe, consistent setup without any manual fiddling.

Comments

Be the first to comment.