Skip to content

feat(config)!: .sctx/ resources folder and .sctx/config.json - #231

Merged
mindsocket merged 3 commits into
mainfrom
claude/project-thread-atltk9
Nov 13, 2026
Merged

mindsocket merged 3 commits into
mainfrom
claude/project-thread-atltk9

Conversation

@mindsocket

@mindsocket mindsocket commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Requested by Rog · project thread

What

Local resources now live in a hidden .sctx/ folder, and the config can live there too.

  • Config root: the folder that holds .sctx.json or .sctx/. Discovery walks up to find either .sctx.json or .sctx/config.json. Every relative path (space paths, ./ schemas, includeSpacesFrom, plugin format: path values) resolves from the root. A .sctx/config.json therefore resolves from the vault, not from .sctx/.
  • Both files in one folder: refused with the new code E_CONFIG_AMBIGUOUS.
  • Resources: .sctx/plugins/, .sctx/schemas/ and .sctx/map-views/. The global config keeps these subfolders in its own folder, ~/.config/structured-context/.
  • Schemas: a bare schema name ("schema": "mine.json") is looked up in .sctx/schemas/ first, then in the root. schemas list shows that folder's schemas as configured.
  • Breaking: a plugins/ folder beside a local config is no longer found. Move it to .sctx/plugins/.

Public API (agreed in principle)

  • ResolvedConfigPath gains root, and SpaceConfig.sourceDir now holds the root.
  • New export resourceDir(root, name), for map-views, the eval harness (.sctx/evals/) and the Obsidian plugin.
  • SctxErrorCode gains E_CONFIG_AMBIGUOUS.

Notes

Checks

bun run test (904 pass), bun run test:hook, bun run typecheck and bun run lint all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_019XphpeYqF5Au42ALp2Cw5m

A config root is the folder holding .sctx.json or .sctx/. Relative paths
resolve from it, so .sctx/config.json behaves like .sctx.json beside it.
Local plugins, schemas and map views go in .sctx/; the global config keeps
them beside config.json. plugins/ beside a local config still works with a
deprecation warning until 1.0. A folder holding both config files is
refused with E_CONFIG_AMBIGUOUS.

resolveConfigPath() returns the root, and resourceDir(root, name) is
exported so other tools find their resources the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpeYqF5Au42ALp2Cw5m
@claude

claude Bot commented Nov 12, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Comment thread docs/concepts.md Resolved
Comment thread docs/config.md Resolved
Comment thread src/config/index.ts Resolved
Comment thread src/config/layout.ts Resolved
Comment thread src/config/layout.ts Resolved
BREAKING CHANGE: local plugins and map views are found only in the config
root's .sctx/ folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XphpeYqF5Au42ALp2Cw5m
@mindsocket mindsocket changed the title feat(config): .sctx/ resources folder and .sctx/config.json feat(config)!: .sctx/ resources folder and .sctx/config.json Nov 13, 2026
@mindsocket
mindsocket merged commit dabf163 into main Nov 13, 2026
12 checks passed
@mindsocket
mindsocket deleted the claude/project-thread-atltk9 branch November 13, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants