Data Context Extractor
Extract company-specific data knowledge and generate tailored analysis templates
Every new analyst on your team makes the same mistakes — they don't know that 'revenue' means ARR not MRR, that the users table has a known duplicate issue, or that filtering by region requires a specific join. This tribal knowledge is never documented.
Who it's for: data teams onboarding new analysts, BI managers documenting institutional knowledge, analytics leaders standardizing query practices, data engineers maintaining data dictionaries, companies where SQL tribal knowledge lives in Slack threads
Example
"Document our data warehouse knowledge" → Guided interview extracting entity definitions, metric calculations, common gotchas, and standard filters — then generates reference docs and query templates any analyst can use from day one
CLAUDE.md Template
New here? 3-minute setup guide → | Already set up? Copy the template below.
npx ccplaybooks add data-context-extractor# Data Context Extractor
## Your Role
You are a meta-workflow assistant that extracts company-specific data knowledge from analysts and generates tailored data analysis templates. You have two modes: Bootstrap (create from scratch) and Iteration (improve existing context).
## How It Works
### Bootstrap Mode
Use when creating a new data context from scratch for your warehouse.
### Iteration Mode
Use when improving an existing context by adding domain-specific knowledge.Get new playbooks like this one
One email a week with new Claude Code workflows. Free, like everything here.
No spam. Unsubscribe anytime.
What This Does
Extracts company-specific data knowledge from analysts and generates tailored analysis templates. The assistant interviews you about your data warehouse -- entity definitions, metric calculations, common filters, and gotchas -- then produces structured reference documentation that helps any analyst write correct queries faster. Works in two modes: Bootstrap (create from scratch) and Iteration (add to existing context).
Quick Start
Step 1: Download the Template
Click Download above to get the CLAUDE.md file.
Step 2: Set Up Your Project
Create a project folder and place the template inside:
mkdir -p ~/Projects/data-context
mv ~/Downloads/CLAUDE.md ~/Projects/data-context/
Optionally add any existing schema documentation, data dictionaries, or query examples.
Step 3: Start Working
cd ~/Projects/data-context
claude
Say: "Help me create a data context for our Snowflake warehouse"
Two Modes of Operation
Bootstrap Mode
Creates a new data context from scratch. The assistant discovers your schemas, asks key questions about entities, metrics, and gotchas, then generates structured reference files covering table documentation, metric definitions, and entity relationships.
Iteration Mode
Improves an existing context by adding new domain-specific knowledge. Load your existing documentation, identify the gap (new domain, missing metrics, undocumented relationships), and the assistant generates targeted updates.
Core Questions Asked
The assistant interviews you conversationally about:
- Entity Disambiguation -- "When people say 'user' or 'customer', what exactly do they mean?" (Multiple entity types, relationships, linking IDs)
- Primary Identifiers -- "What's the main identifier? Are there multiple IDs for the same entity?"
- Key Metrics -- "What are the 2-3 metrics people ask about most? How is each calculated?" (Exact formulas, source tables, time period conventions)
- Data Hygiene -- "What should ALWAYS be filtered out?" (Test data, fraud, internal users)
- Common Gotchas -- "What mistakes do new analysts typically make with this data?"
What Gets Generated
The output includes structured reference documentation:
- Entity definitions with relationships and ID mappings
- Metric calculations with exact formulas, source tables, and caveats
- Table documentation with column details, update frequency, and sample queries
- Standard filters and exclusions to include in every query
- Domain-specific reference files organized by business area
Tips
- Start with Bootstrap mode to create the initial context, then use Iteration mode to refine over time.
- Focus on the 3-5 most-queried tables first -- you can always expand coverage later.
- Document gotchas early -- these save analysts the most time and prevent the most common errors.
- Keep metric definitions precise -- include the exact formula with column references, not just a description.
Example Prompts
"Help me create a data context for our Snowflake warehouse"
"Set up data analysis templates for our BigQuery environment"
"Add context about our marketing data domain to the existing reference"
"Update the context with our new revenue metric definitions"
"Document the gotchas and common mistakes for our events table"