Ad-Hoc Context Assembly
Build context on the fly without creating profile files. Perfect for one-off tasks, experimentation, and quick context changes.
The Basics
Instead of creating a profile YAML file, use command-line flags to assemble context dynamically:
# Using bundlesctxloom run -f go-development -f testing-patterns "help me write tests"
# Using tagsctxloom run -t golang -t testing "help me write tests"
# Combining bothctxloom run -f security -t best-practices "review this code"Building Faux Profiles
Scenario: Quick Go Development Session
Instead of creating profiles/go-dev.yaml:
# Ad-hoc "profile" with multiple bundlesctxloom run \ -f go-development \ -f testing-patterns \ -f error-handling \ "implement the user service"Scenario: Security Review
Instead of creating profiles/security-review.yaml:
# Ad-hoc security contextctxloom run \ -f security#fragments/owasp-top-10 \ -f security#fragments/auth-patterns \ -f security#fragments/input-validation \ -t security \ "review this authentication code"Scenario: Multi-Language Project
# Frontend workctxloom run -f typescript -f react -f css-patterns "build the dashboard component"
# Backend workctxloom run -f go-development -f postgres -f api-design "implement the API endpoint"
# Full-stack contextctxloom run \ -f typescript \ -f go-development \ -f api-design \ "design the data flow between frontend and backend"Fragment Reference Syntax
By Name (searches all bundles)
ctxloom run -f error-handling "help with errors"Fully Qualified
ctxloom run -f go-development#fragments/error-handling "help with errors"Multiple Fragments from Same Bundle
ctxloom run \ -f go-development#fragments/testing \ -f go-development#fragments/error-handling \ -f go-development#fragments/concurrency \ "review this code"Remote Fragments (without pulling)
ctxloom run \ -f ctxloom-default/security#fragments/owasp \ -f ctxloom-default/testing#fragments/tdd \ "help me write secure tests"Tag-Based Assembly
Tags let you pull in all fragments with matching tags:
# All fragments tagged "security"ctxloom run -t security "review for vulnerabilities"
# Multiple tags (OR logic - matches any)ctxloom run -t security -t authentication "review auth code"
# Combine with specific fragmentsctxloom run -t testing -f go-development#fragments/mocking "write unit tests"Combining with Profiles
Start with a profile, add more context:
# Base profile + extra fragments for this taskctxloom run -p developer -f security -f performance "optimize this endpoint"
# Profile + tagsctxloom run -p go-dev -t database -t caching "implement data layer"Preview Before Running
Always preview complex ad-hoc assemblies:
# See what would be assembledctxloom run \ -f go-development \ -f testing-patterns \ -f security \ --dry-run
# See the actual contentctxloom run \ -f go-development \ -f testing-patterns \ --dry-run --printReal-World Examples
Code Review with Specific Focus
# Performance-focused reviewctxloom run \ -f performance#fragments/profiling \ -f performance#fragments/optimization \ -f go-development#fragments/concurrency \ "review this code for performance issues"
# Security-focused reviewctxloom run \ -f security#fragments/owasp-top-10 \ -f security#fragments/injection \ -f security#fragments/auth \ "security review this authentication handler"Learning a New Topic
# Pull in comprehensive learning contextctxloom run \ -t kubernetes \ -t containers \ -f devops#fragments/k8s-patterns \ "explain how to set up a deployment"Debugging Session
# Context for debuggingctxloom run \ -f go-development#fragments/debugging \ -f go-development#fragments/profiling \ -f logging-patterns \ "help me debug this memory leak"Writing Documentation
# Documentation-focused contextctxloom run \ -f documentation#fragments/api-docs \ -f documentation#fragments/readme-patterns \ -t documentation \ "write API documentation for this service"Database Work
# Database contextctxloom run \ -f postgres#fragments/queries \ -f postgres#fragments/optimization \ -f postgres#fragments/migrations \ "optimize this slow query"Tips for Ad-Hoc Assembly
1. List Available Fragments First
# See what's availablectxloom fragment list
# Filter by bundlectxloom fragment list --bundle go-development
# Search by namectxloom fragment list | grep security2. Check Fragment Content
# Preview a fragment before usingctxloom fragment show go-development#fragments/testing3. Use Shell Aliases for Common Combinations
# In your .bashrc/.zshrcalias ctxloom-go='ctxloom run -f go-development -f testing-patterns'alias ctxloom-security='ctxloom run -f security -t security'alias ctxloom-review='ctxloom run -f code-review -f best-practices'
# Then use:ctxloom-go "implement the handler"ctxloom-security "review this code"4. Create Shell Functions for Complex Assemblies
# In your .bashrc/.zshrcctxloom-fullstack() { ctxloom run \ -f typescript \ -f react \ -f go-development \ -f postgres \ -f api-design \ "$@"}
# Use:ctxloom-fullstack "design the user registration flow"5. Save Successful Combinations as Profiles
If you find yourself using the same ad-hoc combination repeatedly:
# This works well - save it!ctxloom run -f go-development -f testing -f security "..."
# Create a profile for future usectxloom profile create go-secure \ -b go-development \ -b testing \ -b security \ -d "Go development with security focus"When to Use Ad-Hoc vs Profiles
Use Ad-Hoc When:
- One-off tasks
- Experimenting with different context combinations
- Quick additions to your base profile
- Task requires unusual fragment combination
Use Profiles When:
- Same combination used repeatedly
- Team needs consistent context
- Complex inheritance chains
- Want to version control the configuration
MCP Tool Equivalent
The same ad-hoc assembly works via MCP:
{ "tool": "assemble_context", "arguments": { "bundles": ["go-development", "testing-patterns", "security"], "tags": ["best-practices"] }}This lets AI assistants dynamically assemble context based on the current task.