# Build shared context with your team Source: https://www.hotdata.dev/use-cases/shared-context Site index: https://www.hotdata.dev/llms.txt Useful context usually splits between Git and hallway conversations. Publish structured docs to an instant database (relationships, ownership, naming) and update them as the team's picture of the data sharpens. ## How it works ### Step 1: Publish the shared map **Claude** ``` Generate the shared data model file, then publish it so the whole team shares one map of tables and joins. ``` **CLI** ```bash hotdata databases context push DATAMODEL ``` **Python SDK** ```python import hotdata ctx = hotdata.DatabaseContextApi(api_client) body = open("DATAMODEL.md", encoding="utf-8").read() ctx.upsert_database_context( "", hotdata.UpsertDatabaseContextRequest(name="DATAMODEL", content=body), ) ``` ### Step 2: Add workspace-specific context for the team **Claude** ``` We keep internal notes on who owns metrics and naming rules. Publish those next to the shared data model so teammates see both. ``` **CLI** ```bash hotdata databases context push TEAM_CONTEXT ``` **Python SDK** ```python import hotdata ctx = hotdata.DatabaseContextApi(api_client) body = open("TEAM_CONTEXT.md", encoding="utf-8").read() ctx.upsert_database_context( "", hotdata.UpsertDatabaseContextRequest(name="TEAM_CONTEXT", content=body), ) ``` ### Step 3: Confirm both documents are live **Claude** ``` List what’s published, then show the data model and the team notes so I can confirm both are there. ``` **CLI** ```bash hotdata databases context list hotdata databases context show DATAMODEL hotdata databases context show TEAM_CONTEXT ``` **Python SDK** ```python import hotdata ctx = hotdata.DatabaseContextApi(api_client) ctx.list_database_contexts("") ctx.get_database_context("", "DATAMODEL") ctx.get_database_context("", "TEAM_CONTEXT") ``` ### Step 4: Create, update, or remove a shared document **Push** creates or overwrites a stem from `./.md`. **Pull → edit → push** updates in place. **Delete** drops that stem from the database when a doc is retired (use the Python client or `DELETE /v1/databases/{database_id}/context/{name}`; there isn’t a `context delete` subcommand in the CLI yet). **Claude** ``` Publish a RUNBOOK context for the team, revise it after our naming workshop, then delete RUNBOOK when we fold it into DATAMODEL. ``` **CLI** ```bash # Create: write ./RUNBOOK.md then push (creates or replaces that stem) printf '%s\n' '# Runbook' '- Revenue metrics owned by Finance Analytics.' > RUNBOOK.md hotdata databases context push RUNBOOK # Update: pull, edit on disk, push again hotdata databases context pull RUNBOOK # … edit ./RUNBOOK.md … hotdata databases context push RUNBOOK # Delete: no context delete subcommand yet; call the API (same auth as the CLI) curl -sS -X DELETE "\${HOTDATA_API_URL}/v1/databases/\${DATABASE_ID}/context/RUNBOOK" \ -H "Authorization: Bearer \${HOTDATA_API_KEY}" \ -H "X-Workspace-Id: \${HOTDATA_WORKSPACE}" ``` **Python SDK** ```python import hotdata ctx = hotdata.DatabaseContextApi(api_client) ctx.upsert_database_context( "", hotdata.UpsertDatabaseContextRequest( name="RUNBOOK", content="""# Runbook - Revenue metrics owned by Finance Analytics. """, ), ) body = open("RUNBOOK.md", encoding="utf-8").read() ctx.upsert_database_context( "", hotdata.UpsertDatabaseContextRequest(name="RUNBOOK", content=body), ) ctx.delete_database_context("", "RUNBOOK") ``` ## Who uses this - Platform leads owning a central model while individual workspaces layer local rules. - Product analytics documenting metric ownership at workspace scope. - Teams piping both schema detail and policy context into agents or codegen.