Skip to content
Chapter 03 · 11 min

Claude Code: 7 keys in settings.json

These live in ~/.claude/settings.json (user-level) or .claude/settings.json (project-level, which takes precedence). The seven below are the ones the article says actually move the needle on context budget and cost.

Every tool you leave plugged in draws power. A bench with twelve idle machines running is a bench that trips its own breaker.

9. enabledPlugins: disable, don't uninstall

What it does: sets which installed plugins load on session start. Why it matters: every active plugin loads its hooks, SKILL.md content, and tool schemas into your context budget before you've typed anything. The article reports going from 14 enabled plugins to 4.

{
  "enabledPlugins": {
    "some-plugin@marketplace": false
  }
}

Setting a plugin to false keeps it installed but unloaded; re-enable per session with /plugin enable when you actually need it.

10. permissions.deny, and the bug to know about

What it does: blocks Claude from running specific tools or reading specific files, with the intent of preventing rm -rf, reading .env, or writing outside the project.

{
  "permissions": {
    "deny": ["Read(./.env)", "Bash(rm -rf:*)"]
  }
}
  • Add a filesystem-level layer too: chmod 600 .env so the OS refuses even if a deny rule doesn't fire.
  • Verify with /permissions inside Claude Code; if your rules don't appear, restart the session.

11. hooks.SessionStart: load only what this directory needs

What it does: SessionStart fires when you open Claude Code in a directory; it can run anything: print env info, lint git state, inject a context file. Why it matters: most people over-inject, growing CLAUDE.md to thousands of tokens because every project rule went in. SessionStart lets you load only the rules relevant to the current branch or directory.

{
  "hooks": {
    "SessionStart": [
      { "command": "cat .claude/context-$(git branch --show-current).md 2>/dev/null" }
    ]
  }
}

Each branch loads its own small context file, so the budget stops bleeding. (Confirm the exact hook schema against current docs; hook config shapes change between versions.)

12. disableAllHooks: the panic switch

What it does: the article describes a single toggle that disables every hook at once. Why it matters: when Claude Code behaves strangely (phantom commands, hangs on start, mysterious writes) a misfiring hook is a common cause, and killing them all at once is faster than bisecting one by one.

{
  "disableAllHooks": true
}
  • Keep it off normally. When something breaks, flip it on, restart, and see if the problem disappears.
  • If yes, re-enable hooks one at a time; if no, the bug is elsewhere. (This key is unverified; check current docs for the exact name.)

13. model: the per-project override

Where: .claude/settings.json at the project root. What it does: sets the default model for that project, overriding your global choice. Why it matters: people set the deepest model globally for hard work, then open a project that's mostly markdown or shell scripts and pay top-tier rates for work a cheaper model handles fine.

{
  "model": "claude-haiku-4-5"
}

Project-level wins. Open the project, get the right model, move on.

14. mcpServers: use the enabled flag

What it does: MCP servers connect Claude to external tools, and each connected server loads its full tool schema into context. Why it matters: people connect servers to test and never disconnect; the article estimates each idle server still costs context schema on every session start. Keep them configured but unloaded with an enabled flag.

{
  "mcpServers": {
    "my-server": {
      "command": "npx",
      "args": ["-y", "@scope/my-mcp-server"],
      "enabled": false
    }
  }
}

Toggle enabled to true per session when you need it. (Verify the enabled flag is honoured in your version; exact MCP config keys vary.)

15. cleanupPeriodDays: the cache nobody mentions

What it does: sets how many days Claude Code keeps transcripts, debug logs, and intermediate session data (default 30). Why it matters: features that learn from your history, and your own later grep through old sessions, can only see as far back as this window. A longer window gives more signal at a small disk cost.

{
  "cleanupPeriodDays": 180
}

In one line each

  • enabledPlugins and mcpServers: keep things installed/configured but set to false/disabled so they don't pre-charge your context.
  • permissions.deny is one layer only; back it with filesystem permissions and verify it actually applies.
  • hooks.SessionStart loads per-branch context to keep CLAUDE.md small; disableAllHooks is the panic switch when hooks misbehave.
  • Set a per-project model override for light repos, and raise cleanupPeriodDays to keep more session history.