BOHICA-LABS / BOHICA-LABS/vsdd-factory

Orchestrator sub-cwd inherits unrelated parent CLAUDE.md chain — ~25-30k tokens of off-topic context per turn

Open
#352 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
2
Forks
1
Avg merge
6h 43m
Merged PRs (30d)
29

Description

## Summary

When a vsdd-factory orchestrator session is launched in a product sub-cwd (e.g. \`/Users/x/work/parent-orchestrator/product-name/\`) that lives inside a larger parent project (with its own CLAUDE.md, charter.md, vision.md, decisions/index.md, .claude/rules/_index.md, and transitive @-imports), Claude Code's per-cwd CLAUDE.md resolution walks **up** the directory tree from cwd and loads every CLAUDE.md it finds, plus all @-imported files. The product session inherits the entire parent context chain even though almost none of it is relevant to the product.

For a vsdd-factory pipeline, the standing context cost is ~25-30k tokens / turn that the orchestrator demonstrably does not need: orchestration needs the vsdd-factory orchestrator skill, the product's `.factory/STATE.md`, the spec corpus, and the product's own CLAUDE.md (if any). It does **not** need the parent project's bedrock/frontier/session-log, decision index, project rules, or knowledge graph.

## Concrete instance

Working on ArcavenAE/akey inside `/Users/skippy/work/aae-orc/akey/`. Every turn auto-loads:

- `~/.claude/CLAUDE.md` (personal directives — fine)
- `/Users/skippy/work/aae-orc/CLAUDE.md` (parent orc — multi-thousand lines)
- `aae-orc/SOUL.md`, `charter.md` (Last updated session 045+, very large session log), `vision.md` (~376 lines), `decisions/index.md`
- `aae-orc/.claude/rules/_index.md` + transcluded `git-commits.md`, `bash.md`, `task-workflow.md`, `agent-tools.md`, `tooling-friction.md`

None of these mention the product. The orchestrator skill itself, the `.factory/` state, and the product's own conventions are the load-bearing context.

## Root cause hypothesis

This is partly a Claude Code harness behavior (per-cwd discovery walks up) and partly an engine gap: vsdd-factory does not ship a `.claude/settings.local.json` (or equivalent) skeleton at product-init time that scopes the orchestrator session's context inheritance.

The harness behavior is upstream and may not be changeable. The engine-side fix is local and cheap.

## Suggested fix shape

At pack init (or as part of the orchestrator-skill greenfield-sequence P0 setup), write a `.claude/settings.local.json` (or document equivalent setting) in the product repo root that:

- Either disables parent-CLAUDE.md inheritance for sessions launched in the product cwd, OR
- Pins a curated inherited-context list (just `~/.claude/CLAUDE.md` and the product's own CLAUDE.md), OR
- Adds an explicit `# Product context boundary` note at the top of the product's CLAUDE.md instructing the orchestrator to disregard parent-orchestrator context.

A reasonable default is option 1 — products run in their own context boundary, opt in to parent context only when cross-product orchestration is actually needed.

## Severity

**P2 — inconvenient.** Doesn't break correctness; visible as elevated token cost per turn and elevated context-window pressure (more frequent compaction, less head-room for spec corpus).

## Cross-references

- aae-orc charter F22 (charter management) + F25 (stage rig — backdrops as authored summaries) — the user's own meta-project frames this as a parent-side concern, but the engine-side mitigation is independently valuable for any vsdd-factory product nested in a larger workspace.
- akey HANDOFF-PHASE-3-ENTRY.md §PG-4

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.