Skip to content

Config Hierarchy

SANDCODE has a three-tier configuration system. Each layer overrides the one above it:

┌─────────────────────────────────┐
│ Distro defaults │ ← src/distro/defaults.ts
│ (lowest priority) │
├─────────────────────────────────┤
│ User config │ ← ~/.sandcode/config.json
│ (personal preferences) │
├─────────────────────────────────┤
│ Project config │ ← .sandcode/settings.json
│ (highest priority) │
└─────────────────────────────────┘

Built into the codebase at src/distro/defaults.ts. These define SANDCODE’s identity:

  • Default provider: zai
  • Default model: GLM-5.1
  • Features: auto memory, project tracker, recipes, startup tips
  • Branding: amber primary color (#F5A623)

You never edit these directly.

Located at ~/.sandcode/config.json. Applies to all projects:

{
"model": "GLM-5.1",
"provider": "zai",
"theme": "dark",
"autoAccept": false
}

Located at .sandcode/settings.json in your project root. Overrides everything:

{
"model": "GLM-5.1",
"allowedTools": ["Bash", "Edit", "Read"],
"hooks": {
"postToolUse": "npm test"
}
}

There’s also .sandcode/settings.local.json for personal project overrides (add to .gitignore).

If distro defaults set theme: "dark", user config sets theme: "light", and project config sets nothing — the resolved value is "light" (user config wins).

If project config sets theme: "dark-ansi", that wins over everything.