Context Bundle Loader
Context bundles are deep domain briefings that give Claude Code instant operational knowledge for a technology stack or work domain. Instead of discovering patterns through trial and error, load a bundle and skip the ramp-up.
There are two bundle classes:
- User bundles:
~/.claude/contexts/-- private, project-specific, stateful bundles - Community bundles: shipped inside this installed skill -- static stack briefings
User bundles take priority when names conflict.
Bundle lookup
Use these paths in order for community bundles and stop at the first existing directory:
BUNDLE_DIR=""
for d in \
./.claude/skills/ctx/bundles \
"$HOME/.claude/skills/ctx/bundles" \
./skills/ctx/bundles
do
[ -d "$d" ] && BUNDLE_DIR="$d" && break
done
[ -n "$BUNDLE_DIR" ] || echo "Community bundle directory not found"
Use ~/.claude/contexts/ for user bundles.
Commands
/ctx list or /ctx (no args)
List all available bundles from both locations.
echo "=== Your Bundles ==="
for f in ~/.claude/contexts/*.md; do
[ ! -f "$f" ] && continue
[ "$(basename "$f")" = "_template.md" ] && continue
name=$(basename "$f" .md)
desc=$(head -5 "$f" | grep '^> ' | sed 's/^> //')
lines=$(wc -l < "$f")
printf " %-18s (%3d lines) %s\n" "$name" "$lines" "$desc"
done
BUNDLE_DIR=""
for d in ./.claude/skills/ctx/bundles "$HOME/.claude/skills/ctx/bundles" ./skills/ctx/bundles; do
[ -d "$d" ] && BUNDLE_DIR="$d" && break
done
if [ -d "$BUNDLE_DIR" ]; then
echo ""
echo "=== Community Bundles ==="
for f in "$BUNDLE_DIR"/*.md; do
[ ! -f "$f" ] && continue
[ "$(basename "$f")" = "_template.md" ] && continue
[ "$(basename "$f")" = "example.md" ] && continue
name=$(basename "$f" .md)
desc=$(head -5 "$f" | grep '^> ' | sed 's/^> //')
lines=$(wc -l < "$f")
printf " %-18s (%3d lines) %s\n" "$name" "$lines" "$desc"
done
fi
Present the output as a clean formatted list. Skip empty sections.
/ctx catalog
List only shipped community bundles. Show name, description, and section outline.
BUNDLE_DIR=""
for d in ./.claude/skills/ctx/bundles "$HOME/.claude/skills/ctx/bundles" ./skills/ctx/bundles; do
[ -d "$d" ] && BUNDLE_DIR="$d" && break
done
for f in "$BUNDLE_DIR"/*.md; do
[ ! -f "$f" ] && continue
[ "$(basename "$f")" = "_template.md" ] && continue
[ "$(basename "$f")" = "example.md" ] && continue
name=$(basename "$f" .md)
desc=$(head -5 "$f" | grep '^> ' | sed 's/^> //')
lines=$(wc -l < "$f")
sections=$(grep '^## ' "$f" | sed 's/^## //' | paste -sd ', ' -)
printf " %-18s (%3d lines) %s\n" "$name" "$lines" "$desc"
printf " Sections: %s\n\n" "$sections"
done
/ctx show <name>
Preview a bundle without loading it. Search user bundles first, then community bundles.
name=$1
if [ -f ~/.claude/contexts/${name}.md ]; then
f=~/.claude/contexts/${name}.md
else
BUNDLE_DIR=""
for d in ./.claude/skills/ctx/bundles "$HOME/.claude/skills/ctx/bundles" ./skills/ctx/bundles; do
[ -d "$d" ] && BUNDLE_DIR="$d" && break
done
f="$BUNDLE_DIR/${name}.md"
fi
head -5 "$f"
echo ""
grep '^## ' "$f"
Then:
- If the bundle contains
Current StateorRecent Changes, show those sections. - Otherwise show the most relevant operational sections that exist, preferring
Common Operations,Gotchas, and one stack-specific section.
/ctx <name> or /ctx <name1> <name2> ...
Load one or more bundles into the conversation.
- For each requested bundle:
- Check
~/.claude/contexts/<name>.mdfirst - If not found, check the community bundle directory above
- If neither exists, list available bundles and suggest the closest match
- Check
- Read the full bundle file
- Confirm:
Loaded **<name>** context. Key focus: <description line>. - If multiple bundles loaded, note integration points between them
- If 4+ bundles requested, warn about context cost
/ctx install <name>
Copy a community bundle to ~/.claude/contexts/ for project customization.
- Find
<name>.mdin the community bundle directory. - Create
~/.claude/contexts/if missing. - Copy to
~/.claude/contexts/<name>.md. - If the copied file lacks
## Current State, append it. - If the copied file lacks
## Recent Changes, append it. - Do not overwrite an existing local bundle unless the user explicitly asks.
- Confirm that the local bundle is now project-specific and ready for
/ctx update.
Use this exact append block when the sections are missing:
## Current State
- Customize this section for your project: deployment status, active work, known issues.
## Recent Changes
- YYYY-MM-DD -- Installed from community bundle; replace with project-specific updates.
/ctx update <name>
Update an existing user bundle after a work session.
- Read
~/.claude/contexts/<name>.md. - Refuse to update a community bundle in place; require a local installed copy.
- Based on work done in this session, update only the sections that changed.
- Append a dated entry to
Recent Changes. - Keep the bundle focused and under ~3000 words; summarize older entries when needed.
/ctx new <name> [<path>]
Create a new user bundle from scratch.
- If no path is provided, ask for the project directory.
- Explore the project: README, entry points, config, git activity, and directory structure.
- Use the bundled template from the community bundle directory:
_template.md. - Write the result to
~/.claude/contexts/<name>.md. - Present the draft for user review.
Important rules
- Bundles complement CLAUDE.md and MEMORY.md -- never duplicate their content.
- Cross-reference secrets or credentials rather than copying them into bundles.
- When working across domains, load all relevant bundles.
- Suggest
/ctx update <name>after significant work on a local project bundle. - Community bundles are static stack briefings. User bundles are project-state documents.
- User bundles always take priority over community bundles of the same name.