How do I deploy the settings?
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:
- Loads
projects/ores.lisp/ores-babel.elto makeores/repo-rootavailable. - Sets
org-babel-default-header-args:jsonwith the absolute tangle target path derived fromores/repo-root, so the org file itself carries no path. - Calls
org-babel-tangle-fileondoc/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
- Claude Code Settings — the literate source; edit permissions here.
- How do I deploy the skills? — parallel target for Claude Code skills.
- CMake setup — preset names and output layout.