# Ctx

> Load deep context bundles for specific work domains. Use when user says /ctx, "load context for", or needs domain-specific operational knowledge before working on a project.

- Skill: `puretensor/ctx` (Agent Skill, multi-file: 17 files)
- Install (CLI): `npx skillmds@latest add puretensor/ctx`
- Raw SKILL.md: https://api.skillmd.com/api/skills/puretensor/ctx/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: puretensor (https://skillmd.com/u/puretensor)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/puretensor/ctx

---


## 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:

```bash
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.

```bash
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.

```bash
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.

```bash
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 State` or `Recent 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.

1. For each requested bundle:
   - Check `~/.claude/contexts/<name>.md` first
   - If not found, check the community bundle directory above
   - If neither exists, list available bundles and suggest the closest match
2. Read the full bundle file
3. Confirm: `Loaded **<name>** context. Key focus: <description line>.`
4. If multiple bundles loaded, note integration points between them
5. If 4+ bundles requested, warn about context cost

#### `/ctx install <name>`

Copy a community bundle to `~/.claude/contexts/` for project customization.

1. Find `<name>.md` in the community bundle directory.
2. Create `~/.claude/contexts/` if missing.
3. Copy to `~/.claude/contexts/<name>.md`.
4. If the copied file lacks `## Current State`, append it.
5. If the copied file lacks `## Recent Changes`, append it.
6. Do not overwrite an existing local bundle unless the user explicitly asks.
7. Confirm that the local bundle is now project-specific and ready for `/ctx update`.

Use this exact append block when the sections are missing:

```markdown
## 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.

1. Read `~/.claude/contexts/<name>.md`.
2. Refuse to update a community bundle in place; require a local installed copy.
3. Based on work done in this session, update only the sections that changed.
4. Append a dated entry to `Recent Changes`.
5. Keep the bundle focused and under ~3000 words; summarize older entries when needed.

#### `/ctx new <name> [<path>]`

Create a new user bundle from scratch.

1. If no path is provided, ask for the project directory.
2. Explore the project: README, entry points, config, git activity, and directory structure.
3. Use the bundled template from the community bundle directory: `_template.md`.
4. Write the result to `~/.claude/contexts/<name>.md`.
5. 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.

