Universal Time Synchronization System for Team Brain AI Agents
TimeSync provides accurate, synchronized time across ALL AI agents and sessions, solving WSL time drift issues and reducing token overhead from repeated time checks.
When AI agents work across different platforms and sessions, time becomes inconsistent:
- WSL Time Drift: Linux in WSL can drift from Windows system time
- Token Waste: Every "what time is it?" check costs tokens
- Inconsistent Logs: Agents report different times for the same event
- Session Confusion: Without accurate time, debugging is guesswork
Real Impact:
- Agents waste 2-5% of tokens on time checks
- Session logs have conflicting timestamps
- "It worked yesterday" debugging becomes impossible
- Cross-platform coordination fails
TimeSync creates ONE universal timer that ALL agents share:
from timesync import get_current_time
# Always accurate, always consistent, always free
now = get_current_time()No more:
- Multiple time sources
- WSL drift issues
- Token-wasting time checks
- Inconsistent timestamps
Just accurate time, everywhere, instantly.
- Self-Healing Timer - Auto-detects stale timers (>24hrs) and re-syncs automatically
- Zero Dependencies - Pure Python stdlib, works everywhere
- Token Efficient - One sync per session instead of per-message checks (saves 2-5% tokens)
- Universal Sync - ONE timer, ALL AIs synchronized
- Fail Gracefully - Handles corrupted timers, missing files, future timestamps
- Cross-Platform - Works on Windows, Linux (including WSL), macOS
- JSON Output - Machine-parseable output for automation
- Comprehensive Tests - 34 tests covering all functionality
Option 1: Direct Usage (Recommended)
# Clone or download this repo
cd C:\Users\logan\OneDrive\Documents\AutoProjects\TimeSync
# No installation needed! Just use it:
python timesync.py getOption 2: Install Globally
# Install via pip (editable mode)
pip install -e .
# Now use from anywhere:
timesync get# Get current time
python timesync.py get
# Output: 2026-01-22T14:30:00.123456
# Sync timer with your agent name
python timesync.py sync --triggered-by ATLAS
# Output:
# [OK] Timer synced at 2026-01-22T14:30:05
# Triggered by: ATLAS
# Timezone: Pacific Standard Time
# Method: SystemTime
# Check timer status
python timesync.py info
# Output:
# Universal Timer Status:
# Session Start: 2026-01-22T08:00:00
# Last Verified: 2026-01-22T14:30:05
# Verified By: ATLAS
# Age: 0s (0.0 hours)
# Status: FRESHpython timesync.py get
# Output: 2026-01-22T14:30:00.123456
# With JSON output
python timesync.py get --json
# Output: {"time": "2026-01-22T14:30:00.123456"}python timesync.py sync
# Syncs timer, attributes to "CLI"
python timesync.py sync --triggered-by FORGE
# Syncs timer, attributes to FORGE
# With JSON output
python timesync.py sync --json
# Output: {"session_start": "...", "last_verified": "...", ...}python timesync.py info
# Shows full timer status
python timesync.py check
# Exit code 0 if fresh, 1 if stalepython timesync.py path
# Shows timer file path and existence
python timesync.py reset
# Deletes timer (forces fresh sync next use)import sys
sys.path.append("C:/Users/logan/OneDrive/Documents/AutoProjects/TimeSync")
from timesync import (
get_current_time, # Returns datetime
get_current_time_iso, # Returns ISO string
is_timer_stale, # Returns bool
sync_timer, # Syncs and returns dict
get_timer_info, # Returns dict or None
get_timer_path, # Returns Path
reset_timer, # Deletes timer
initialize_session_timer # For session starts
)
# Simple usage
now = get_current_time()
timestamp = get_current_time_iso()
# At session start
if is_timer_stale():
sync_timer(triggered_by="ATLAS")
# Get status
info = get_timer_info()
if info:
print(f"Status: {info['status']}")
print(f"Age: {info['age_display']}")TimeSync auto-detects the correct path for your platform:
| Platform | Timer Path |
|---|---|
| Windows | D:\BEACON_HQ\MEMORY_CORE_V2\UNIVERSAL_TIMER.json |
| WSL | /mnt/d/BEACON_HQ/MEMORY_CORE_V2/UNIVERSAL_TIMER.json |
| Linux/macOS | ~/BEACON_HQ/MEMORY_CORE_V2/UNIVERSAL_TIMER.json |
{
"session_start": "2026-01-22T08:00:00",
"last_verified": "2026-01-22T14:30:00",
"verified_by": "BCH_GM_BUTTON",
"timezone": "Pacific Standard Time",
"sync_method": "SystemTime",
"version": "1.1.0"
}- Default: 24 hours
- After 24 hours, timer auto-syncs on next access
- Configurable in code:
STALE_THRESHOLD_HOURS
When Logan presses GM in BCH:
from timesync import initialize_session_timer
from synapselink import quick_send
def handle_gm_button():
# Sync universal timer
timer_data = initialize_session_timer("BCH_GM_BUTTON")
# Broadcast to all agents
quick_send(
"ALL",
"Good Morning - Timer Synced",
f"Universal timer initialized at {timer_data['last_verified']}",
priority="NORMAL"
)All agents import identically:
import sys
sys.path.append("C:/Users/logan/OneDrive/Documents/AutoProjects/TimeSync")
from timesync import get_current_time, sync_timer, is_timer_stale
# At session start
if is_timer_stale():
sync_timer(triggered_by="AGENT_NAME")
# Throughout session
now = get_current_time()
print(f"[{now.isoformat()}] Task starting...")With SynapseLink:
from timesync import get_current_time_iso
from synapselink import quick_send
timestamp = get_current_time_iso()
quick_send("TEAM", f"[{timestamp}] Status Update", body)With TokenTracker:
from timesync import get_current_time_iso
from tokentracker import TokenTracker
tracker = TokenTracker()
timestamp = get_current_time_iso()
tracker.log_usage("ATLAS", "claude", 1000, 500, f"[{timestamp}] Task")See: INTEGRATION_EXAMPLES.md for 10 complete integration patterns
| Before TimeSync | After TimeSync | Savings |
|---|---|---|
| Time check per message | One sync per session | 2-5% tokens |
| Multiple time sources | ONE universal timer | Consistency |
| WSL drift issues | Auto-syncing timer | Accuracy |
- β Forge (Orchestrator) - Session coordination
- β Atlas (Builder) - Build logging
- β Clio (Linux) - WSL time drift fix
- β Nexus (Multi-platform) - Cross-platform time
- β Bolt (Free executor) - Zero-cost timing
Cause: Timer hasn't been synced in 24+ hours
Fix:
python timesync.py sync --triggered-by MANUAL_FIXCause: Timer from future (system clock changed)
Fix: Automatically detected and treated as stale
Cause: JSON parsing error
Fix: Timer auto-syncs on next access (self-healing)
Cause: Platform detection failed
Fix:
from timesync import get_timer_path
print(f"Detected path: {get_timer_path()}")
# Verify it matches your platformCause: Path not in sys.path
Fix:
import sys
sys.path.append("C:/Users/logan/OneDrive/Documents/AutoProjects/TimeSync")
from timesync import get_current_time| Document | Purpose | Lines |
|---|---|---|
| README.md | Primary documentation | 400+ |
| EXAMPLES.md | 12 working examples | 400+ |
| CHEAT_SHEET.txt | Quick reference | 150+ |
| INTEGRATION_PLAN.md | Team Brain integration | 400+ |
| QUICK_START_GUIDES.md | Agent-specific guides | 300+ |
| INTEGRATION_EXAMPLES.md | Tool integration patterns | 400+ |
Run the comprehensive test suite:
cd C:\Users\logan\OneDrive\Documents\AutoProjects\TimeSync
python test_timesync.pyTest Coverage:
- Core functionality (get time, sync, check stale)
- Timer operations (load, save, delete)
- Stale detection (fresh, stale, future timestamps)
- Edge cases (corrupted files, missing fields)
- Cross-platform paths
- CLI interface
- Error handling
Results: 34/34 tests passing (100%)
DALL-E prompts for visual assets are in branding/BRANDING_PROMPTS.md.
Brand Colors:
- Primary: Deep Navy (#0a0e27)
- Accent: Bright Cyan (#00d4ff)
- Supporting: Teal (#00fff5)
Visual Metaphors:
- Clock/timer icon
- Sync/refresh symbol
- Universal/global indicator
This tool is part of the Team Brain ecosystem. Contributions welcome!
- Fork the repo
- Create a feature branch
- Make your changes
- Run tests:
python test_timesync.py - Ensure 100% pass rate
- Submit a pull request
Code Standards:
- Type hints required
- Docstrings for all public functions
- No Unicode emojis in Python code ([OK], [X], [!] instead)
- Cross-platform compatible
MIT License - see LICENSE for details
Copyright (c) 2026 Logan Smith / Metaphy LLC
Originally Built by: Porter (Claude Code CLI)
Enhanced by: Atlas (Team Brain)
Requested by: Team Brain coordination needs
For: Logan Smith / Metaphy LLC
Part of: Beacon HQ / Team Brain Ecosystem
Original Date: January 18, 2026
Enhancement Date: January 22, 2026
Methodology: Test-Break-Optimize (34/34 tests passing)
Built with precision as part of the Team Brain ecosystem - where AI agents collaborate to solve real problems.
- GitHub: https://github.com/DonkRonk17/TimeSync
- Team Brain: Beacon HQ
- Metaphy LLC: Maximum Benefit of Life π
- Issues: https://github.com/DonkRonk17/TimeSync/issues
# Get time
python timesync.py get
# Sync timer
python timesync.py sync --triggered-by AGENT
# Check status
python timesync.py info
# Check if stale (exit codes)
python timesync.py check
# Show timer path
python timesync.py path
# Reset timer
python timesync.py reset
# JSON output (any command)
python timesync.py get --json# Python API
from timesync import (
get_current_time, # -> datetime
get_current_time_iso, # -> str
is_timer_stale, # -> bool
sync_timer, # -> dict
get_timer_info, # -> dict | None
get_timer_path, # -> Path
reset_timer, # -> bool
initialize_session_timer # -> dict
)Questions? Feedback? Issues?
Open an issue on GitHub or message via Team Brain Synapse!
TimeSync: Universal time for universal AI agents β°