Patterns¶
Quick timestamped note logging for tracking patterns in health, mood, habits, and daily observations. Stores entries in JSONL format for easy analysis.
Quick Start¶
patterns 'had coffee around 3pm'
patterns 'feeling slight heartburn'
patterns 'slept well, 8 hours'
patterns list # View all entries
patterns search coffee # Search for entries
patterns delete # Delete entries interactively
Each entry is timestamped and appended to ~/.local/share/patterns/entries.jsonl.
Commands¶
Log Entry¶
Log a timestamped observation. Quotes are required to distinguish messages from commands.
List Entries¶
View all entries in log format with syntax highlighting (via bat):
2025-12-11T15:30:45-0500 | had coffee around 3pm
2025-12-11T18:22:10-0500 | feeling slight heartburn
2025-12-11T22:15:00-0500 | slept well, 8 hours
Search Entries¶
Search entries for matching text (case-insensitive). Results displayed with syntax highlighting.
Delete Entries¶
Interactively delete entries using fzf multi-select:
- TAB - Select/deselect entries
- Ctrl+A - Select all
- Ctrl+D - Deselect all
- ENTER - Confirm selection
- ESC - Cancel
Shows confirmation prompt before deleting. Displays count of entries to be deleted.
Help¶
Show usage information and examples.
Data Format¶
Entries are stored as JSON Lines (JSONL) in ~/.local/share/patterns/entries.jsonl:
{"timestamp": "2025-12-11T15:30:45-0500", "message": "had coffee around 3pm"}
{"timestamp": "2025-12-11T18:22:10-0500", "message": "feeling slight heartburn"}
Each line is a complete JSON object with:
timestamp- ISO 8601 format with local timezone offsetmessage- Your note text
Advanced Analysis¶
The JSONL format works seamlessly with command-line tools:
Using jq¶
View all entries as JSON:
Extract just messages:
Filter by date:
Format for reading:
Group by date:
Using grep¶
Quick text search without JSON parsing:
grep -i coffee ~/.local/share/patterns/entries.jsonl
grep "2025-12-11" ~/.local/share/patterns/entries.jsonl
Python Analysis¶
Import and analyze with Python:
import json
from datetime import datetime
from collections import defaultdict
# Load all entries
entries = []
with open('~/.local/share/patterns/entries.jsonl') as f:
for line in f:
entries.append(json.loads(line))
# Find all entries with 'coffee'
coffee_entries = [e for e in entries if 'coffee' in e['message'].lower()]
print(f"Coffee mentioned {len(coffee_entries)} times")
# Group by date
by_date = defaultdict(list)
for entry in entries:
date = entry['timestamp'][:10]
by_date[date].append(entry['message'])
# Find correlations
for date, messages in by_date.items():
if any('coffee' in m.lower() for m in messages) and \
any('heartburn' in m.lower() for m in messages):
print(f"{date}: Coffee AND heartburn")
Use Cases¶
Track patterns over time by logging brief observations:
- Health tracking - Food intake, symptoms, energy levels, sleep quality
- Mood monitoring - Emotional states, triggers, stress levels
- Habit formation - Activities, exercise, meditation, reading
- Work patterns - Productivity, focus times, distractions
- Symptom correlation - Find connections between activities and outcomes (e.g., coffee → heartburn)
The goal is to capture many small data points throughout the day for later pattern analysis.
Example Workflow¶
Morning:
Afternoon:
Evening:
Later analysis:
Data Location¶
- Data file:
~/.local/share/patterns/entries.jsonl - Format: JSON Lines (one JSON object per line)
- Backup: Not tracked in dotfiles (personal data)
Consider backing up this file periodically if you accumulate valuable data.
Dependencies¶
- jq - Required for logging and all commands
- bat - Optional, used for syntax highlighting in list/search (falls back to plain text)
- fzf - Required for delete command (interactive selection)
Tips¶
- Be consistent - Log regularly throughout the day for better pattern detection
- Be brief - Short observations are easier to analyze than long entries
- Be specific - Include times and quantities when relevant
- Review regularly - Use
patterns searchto look for correlations - Backup data - Your patterns are personal data worth preserving