/ctx - Hierarchical Context Viewer
Shows the resolved context for the current working directory, aggregated from all levels of the hierarchy.
Usage
code
/ctx # Show resolved context /ctx tree # Show context hierarchy as tree /ctx edit # Edit context at current scope
What This Shows
Context is resolved by walking up from the current directory:
- •Feature/Component level -
.context/CONTEXT.mdin current or parent dirs - •Repo level -
.claude/CONTEXT.mdat repository root - •Project level - Context above the repo
- •User level -
~/.claude/CONTEXT.mdfor global preferences
Each level can:
- •Inherit from parent (default)
- •Override specific sections with
@override: section_name - •Ignore parent sections with
@ignore: section_name
Implementation
When invoked, run:
bash
python3 ~/.claude/plugins/agent-swarm/ctx/resolver.py resolve .
For tree view:
bash
python3 ~/.claude/plugins/agent-swarm/ctx/resolver.py tree .
Context File Format
markdown
# Context: [Scope Name] @inherit: true # Default, inherit from parent @override: conventions # Override this section completely @priority: high # Mark as high priority ## Purpose What this scope is for. ## Conventions Coding standards for this scope. ## Patterns Common patterns used here. ## Pitfalls Known issues to avoid.
Creating Context
To add context at current scope:
- •Create
.context/CONTEXT.mdin the directory - •Add relevant sections
- •Use
@overridefor sections that shouldn't merge with parent
Memory vs Context
- •CONTEXT.md - Static, intentionally written knowledge
- •MEMORY.md - Distilled learnings from sessions (see
/distill)