A dramatic "Jack Bauer 24" styled live counter displaying combined Weekly Active Users (WAU) for VS Code + Code Reviews during the focus week (Jan 26 - Feb 1, 2026).
- Dramatic 24-Style Design: Pure black background with glowing gold counter
- Real-Time Updates: Auto-refreshes every 60 seconds
- Large Display: 180px digital clock-style font optimized for office TVs
- Full-Screen Mode: Removes all UI chrome for maximum impact
- Error Handling: Graceful error display with retry logic
- Responsive: Works on desktop, tablet, and mobile devices
The counter displays the combined count of unique users who have:
- Used VS Code with LLM completions (from PostHog events)
- Created code reviews (from backend database)
During the focus week starting January 26, 2026.
βββββββββββββββββββββββββββββββββββββββββββ
β Streamlit App (in Snowflake) β
β ββ app.py (main application) β
β ββ Jack Bauer 24 styling β
β ββ Auto-refresh logic β
βββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββ
β Snowflake Data Warehouse β
β ββ staging_posthog.events β
β ββ backend_prod.public tables β
β ββ dbt_prod.int_user_id mapping β
βββββββββββββββββββββββββββββββββββββββββββ
-
Snowflake Account with access to:
KILO_DWdatabasestaging_posthog,backend_prod, anddbt_prodschemas- Required tables (see Permissions section)
-
Snowflake Role with:
CREATE STREAMLITprivilegeUSAGEon database and schemasSELECTon required tables
- Log into Snowflake web interface
- Navigate to Streamlit section in the left sidebar
- Click + Streamlit App
- Configure the app:
- Name:
focus_week_counter - Warehouse: Select your warehouse (e.g.,
COMPUTE_WH) - App location: Choose database and schema
- Name:
- Click Create
CREATE STREAMLIT focus_week_counter
ROOT_LOCATION = '@<your_stage>'
MAIN_FILE = 'app.py'
QUERY_WAREHOUSE = '<your_warehouse>';-
In the Streamlit app editor, upload these files:
app.py(main application)requirements.txt(dependencies)environment.yml(Python environment)
-
Or use Snowflake stage:
-- Create stage if needed
CREATE STAGE IF NOT EXISTS streamlit_stage;
-- Upload files
PUT file://app.py @streamlit_stage AUTO_COMPRESS=FALSE OVERWRITE=TRUE;
PUT file://requirements.txt @streamlit_stage AUTO_COMPRESS=FALSE OVERWRITE=TRUE;
PUT file://environment.yml @streamlit_stage AUTO_COMPRESS=FALSE OVERWRITE=TRUE;Ensure your Snowflake role has access to required tables:
-- Grant database and schema usage
GRANT USAGE ON DATABASE KILO_DW TO ROLE <your_role>;
GRANT USAGE ON SCHEMA staging_posthog TO ROLE <your_role>;
GRANT USAGE ON SCHEMA backend_prod TO ROLE <your_role>;
GRANT USAGE ON SCHEMA dbt_prod TO ROLE <your_role>;
-- Grant table access
GRANT SELECT ON TABLE staging_posthog.events TO ROLE <your_role>;
GRANT SELECT ON TABLE backend_prod.public.kilocode_users TO ROLE <your_role>;
GRANT SELECT ON TABLE backend_prod.public.cloud_agent_code_reviews TO ROLE <your_role>;
GRANT SELECT ON TABLE KILO_DW.dbt_prod.int_user_id__to_distinct_id TO ROLE <your_role>;
-- Grant warehouse usage
GRANT USAGE ON WAREHOUSE <your_warehouse> TO ROLE <your_role>;- Click Run in the Streamlit editor
- The app will start and display the counter
- Share the URL with your team
- Open the Streamlit app URL in a browser
- Press F11 for full-screen mode
- The app will auto-refresh every 60 seconds
- All Streamlit UI chrome is hidden for clean display
focus_week_live_counter/
βββ app.py # Main Streamlit application
βββ requirements.txt # Python dependencies
βββ environment.yml # Snowflake environment config
βββ README.md # This file
βββ kilocounter.md # Original specification
βββ plans/ # Planning documents
βββ implementation-plan.md
βββ architecture.md
βββ visual-design.md
- Background:
#000000(Pure Black) - Counter:
#FFD700(Gold) with glowing effect - Text:
#FFFFFF(White) - Borders:
#FFD700(Gold) with outer glow
- Counter: 180px Courier New (monospace)
- Title: 48px Arial Black (bold, uppercase)
- Subtitle: 24px Arial
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β VS CODE + CODE REVIEWS WEEKLY ACTIVE USERS β
β β
β βββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β β
β β 1,234 β β
β β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β FOCUS WEEK: JAN 26 - FEB 1, 2026 β
β LAST UPDATED: 10:35:42 UTC β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The app executes a Snowflake query that:
-
Identifies VS Code users from PostHog events:
- Filters for 'LLM Completion' events
- Excludes bot traffic (Singapore IPs)
- Maps PostHog distinct_id to user_id
- Filters for dates >= 2026-01-26
-
Identifies Code Reviews users from backend:
- Gets PR authors from code reviews table
- Excludes internal users (@kilocode.ai)
- Filters for dates >= 2026-01-26
-
Combines both sets using UNION
-
Counts distinct users across both features
# Check elapsed time since last refresh
elapsed = time.time() - st.session_state.last_refresh
# Refresh every 60 seconds
if elapsed >= 60:
st.session_state.last_refresh = time.time()
st.rerun()- Catches Snowflake connection errors
- Displays user-friendly error messages
- Shows error in red box with same dramatic styling
- Continues auto-refresh to retry
For local testing with Snowflake credentials:
- Install dependencies:
pip install streamlit snowflake-connector-python- Create
.envfile with credentials:
SNOWFLAKE_ACCOUNT=your_account
SNOWFLAKE_USER=your_user
SNOWFLAKE_PASSWORD=your_password
SNOWFLAKE_ROLE=your_role
SNOWFLAKE_WAREHOUSE=your_warehouse-
Modify
app.pyto usesnowflake.connectorinstead ofget_active_session() -
Run locally:
streamlit run app.pyNote: For production deployment in Snowflake, use the native get_active_session() method (already implemented).
- Expected execution time: 5-15 seconds
- Data volume: Processes millions of PostHog events
- Optimization: Uses CTEs and proper filtering
- Caching: Snowflake query result caching applies
- Authentication: Handled by Snowflake (no credentials in code)
- Authorization: Uses Snowflake role-based access control
- Data Access: Read-only queries
- Network: Runs within Snowflake's secure environment
- Check Snowflake warehouse is running
- Verify role has SELECT permissions on all tables
- Check query execution in Snowflake worksheet
- Verify tables exist and have data
- Check date filter (>= 2026-01-26)
- Ensure joins are working correctly
- Query returned NULL or no results
- Check data exists for the focus week period
- Check browser console for errors
- Verify Streamlit session state is working
- Try manual refresh (F5)
Edit app.py:
# Change from 60 to desired seconds
if elapsed >= 60: # Change this valueEdit the CSS in app.py:
# Change gold (#FFD700) to your preferred color
color: #FFD700; # Counter color
border: 3px solid #FFD700; # Border colorEdit the CSS in app.py:
font-size: 180px; # Change this valuePotential additions (not in current scope):
- Historical trend chart
- Breakdown by VS Code vs Code Reviews
- Goal line or target indicator
- Slack notifications for milestones
- Multiple focus week support
- Export data functionality
This is an internal tool for the focus week. For changes:
- Update the planning documents in
/plans - Test changes locally if possible
- Deploy to Snowflake Streamlit
- Verify on office displays
Internal use only - Kilocode.ai
- Inspired by the "24" TV series countdown aesthetic
- Built with Streamlit and Snowflake
- Data from PostHog and internal backend
Focus Week: January 26 - February 1, 2026
Goal: Track and celebrate our combined VS Code + Code Reviews adoption! π