Home
cd ../playbooks
Data & ReportingAdvanced

Data Context Extractor

Extract company-specific data knowledge and generate tailored analysis templates

10 minutes
By AnthropicSource
#data-context#templates#company-data#metadata

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.

Or install from your terminal:
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.

README.md

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"

$Related Playbooks

Data & Reporting

Data Question Analyzer

Answer data questions ranging from quick lookups to formal analytical reports

10 minutes
Intermediate
Data & Reporting

Spreadsheet Data Analyst

Analyze spreadsheet data, generate insights, create visualizations, and build reports from Excel/CSV data.

10 minutes
Intermediate
Data & Reporting

Data Extraction Assistant

Extract structured data from PDFs, Word docs, emails, and HTML using the unstructured library.

10 minutes
Advanced
Data & Reporting

Data Pipeline Builder

Data pipeline and ETL automation - extract, transform, load workflows for data integration and analytics

10 minutes
Advanced
Data & Reporting

Engagement Pattern Analyzer

Analyze which posts get saved vs liked vs replied to, find the patterns, and separate what your audience actually values from vanity engagement.

10 minutes
Intermediate
Data & Reporting

Executive Dashboard

Design executive marketing dashboards.

15 minutes
Intermediate
Data & Reporting

Excel Automation Workflows

Automate Excel workflows including real-time control, VBA execution, and dashboard updates using xlwings.

10 minutes
Advanced
Data & Reporting

GEO Monthly Delta Report

Compare two GEO audits of the same site and generate a client progress report showing exactly what moved, by how much, and what is next

10 minutes
Intermediate
Data & Reporting

GEO Report PDF Renderer

Render a GEO audit markdown file into a styled client-ready PDF with a cover page, color-coded score tables, and severity callouts

10 minutes
Intermediate
Data & Reporting

GEO Client Report Generator

Turn AI-search audit findings into a client-ready GEO report with a weighted 0-100 readiness score and a three-tier action plan

10 minutes
Intermediate
Data & Reporting

Intelligence Report

Generate marketing intelligence briefings.

15 minutes
Intermediate
Data & Reporting

Interactive Dashboard Builder

Build self-contained HTML dashboards with Chart.js for data visualization

10 minutes
Intermediate

Browse all Data & Reporting playbooks →