How do I deploy the settings?

Table of Contents

The authoritative source for .claude/settings.json is Claude Code Settings (doc/llm/claude_code_settings.org). Never edit the JSON file directly. For CMake setup and preset names see CMake setup.

Question

How do I regenerate .claude/settings.json from its literate org source?

Answer

compass build --direct settings deletes the existing .claude/settings.json and runs Emacs in batch mode to tangle doc/llm/claude_code_settings.org in its place. It calls Emacs directly (no cmake, no vcpkg), so it works in a light environment. The tangle output path is derived from ores/repo-root (defined in projects/ores.lisp/ores-babel.el), so no hardcoded relative path appears in the org source.

./compass.sh build --direct settings

Expected output:

Removing settings file
Loading …/projects/ores.lisp/ores-babel.el (source)...
Tangled 1 code block from claude_code_settings.org
Settings deployed to …/.claude/settings.json

This must be run outside the sandbox (Emacs and the ores-babel.el project detection need a full environment); use dangerouslyDisableSandbox: true on the Bash tool call.

In a full environment the equivalent deploy_settings CMake target (cmake --build --preset <preset> --target deploy_settings) runs the same script; prefer the compass command above.

Prerequisites

  • Emacs on PATH. (No cmake configure step is required for --direct.)

Verify

python3 -m json.tool .claude/settings.json

The output should be valid JSON with a permissions.allow array and a sandbox object. The number of allow entries is small by design (25 as of the initial version); if the count grows unexpectedly the source file should be audited.

Script

projects/ores.lisp/src/ores-build-settings.el is the Emacs script the target invokes. It:

  1. Loads projects/ores.lisp/ores-babel.el to make ores/repo-root available.
  2. Sets org-babel-default-header-args:json with the absolute tangle target path derived from ores/repo-root, so the org file itself carries no path.
  3. Calls org-babel-tangle-file on doc/llm/claude_code_settings.org, which assembles the JSON via noweb-referenced permission blocks.

compass build --direct settings runs this script directly via Emacs. The equivalent deploy_settings CMake target (used for full-environment builds) lives in CMakeLists.txt near add_custom_target(deploy_settings ...) and invokes the same script.

Tested by

Manual. Run the target and verify .claude/settings.json is valid JSON. Tested 2026-05-22 against preset linux-clang-debug-ninja; CMake reconfiguration was not required on a warm build.

See also

Emacs 29.1 (Org mode 9.6.6)