ctx
查看和管理当前目录的层级上下文
📖 中文导读:查看和管理当前目录的层级上下文 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: ctx description: View and manage hierarchical context for the current directory user_invocable: true
/ctx - Hierarchical Context Viewer
Shows the resolved context for the current working directory, aggregated from all levels of the hierarchy.
Usage
/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:
python3 ~/.claude/plugins/agent-swarm/ctx/resolver.py resolve .
For tree view:
python3 ~/.claude/plugins/agent-swarm/ctx/resolver.py tree .
Context File Format
# 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)