---
created: 2026-04-21T12:55:04.699Z
updated: 2026-05-10T00:00:00.000Z
title: Sync ccs-instance settings.json OWL/LIVE paths (CLAUDE_CONFIG_DIR-aware)
area: tooling
files:
  - src/owl/plugin_session_start.rs (sync_settings_json — line 180)
  - src/common/owlery.rs (CLAUDE_CONFIG_DIR resolver — line 197)
---

## Status

Narrowed 2026-05-10 from original "Rebounder executable trampolines OWL/LIVE to latest spt binary."

The bulk of the original problem is **already solved** by:
- `version_trampoline()` (`src/owl/plugin_session_start.rs:303`) — SessionStart scans sibling cache dirs, picks newest semver, rewrites `CLAUDE_ENV_FILE` `OWL`/`LIVE`, backfills binary + hooks.json into old version dir.
- `sync_settings_json()` (`src/owl/plugin_session_start.rs:180`, commit `16e4338` quick-260415-ujn) — mirrors trampolined paths into `~/.claude/settings.json` for Bash-tool / settings-json-reading consumers.
- Per-session `CLAUDE_ENV_FILE` env var refresh works in **any** profile (main + ccs instances).

The rebounder-as-third-binary design was abandoned in favor of the above in-binary approach. Remaining gap is narrow.

## Problem

`sync_settings_json()` hardcodes `USERPROFILE`/`HOME` (line 198) → writes only `~/.claude/settings.json`. Does **not** honor `CLAUDE_CONFIG_DIR`, so ccs-instance `settings.json` (e.g. `~/.ccs/instances/bigscreen/.claude/settings.json`) is **never** synced to the trampolined paths.

Combined with the known `CLAUDE_ENV_FILE`-not-sourced-on-Windows bug (Anthropic #27987, memory: `claude_env_file_windows_bug.md`), the Bash tool inside a ccs profile on Windows still reads stale `OWL`/`LIVE` from the ccs settings.json — reproducing the original `1.8.11`-cache-deleted failure mode.

## Solution

Make `sync_settings_json()` `CLAUDE_CONFIG_DIR`-aware, mirroring the resolver pattern in `src/common/owlery.rs:197`:

1. If `CLAUDE_CONFIG_DIR` is set + non-empty → write to `${CLAUDE_CONFIG_DIR}/settings.json` (ccs-instance path)
2. Otherwise → fall back to `${HOME}/.claude/settings.json` (current behavior)

Optionally: also write the main `~/.claude/settings.json` even when in a ccs context (belt-and-suspenders), so a user toggling between ccs and main keeps both in sync.

## Acceptance

- Run a fresh ccs-instance Claude Code session against a stale `OWL` in ccs settings.json; SessionStart trampolines + syncs ccs settings.json to current cache path.
- Bash tool invocation of `$OWL list` in ccs profile on Windows succeeds without manual env-var override.
- Main `~/.claude/settings.json` sync behavior unchanged for non-ccs sessions.

## Related

- Phase 18.8.1 — ccs-aware path resolution (echo-commune jsonl + owlery root); sets the precedent for `CLAUDE_CONFIG_DIR` honoring.
- `src/common/owlery.rs:197` — resolver to copy.
- Memory: `project_claude_env_file_windows_bug.md` — explains why settings.json sync (not just CLAUDE_ENV_FILE) is needed for Bash on Windows.
- Original 2026-04-21 todo (rebounder trampoline executable) — superseded by in-binary trampoline; this is the residual gap.
