How I Connected My Journal to Claude for Automated Insights
I journal almost every day. Quick notes on my phone - what happened, how I felt, what’s bothering me. The problem is I never go back and read any of it. Weeks of entries just sitting there, patterns I’m probably missing.
So I built a system that reads my journal automatically, sends it to Claude for reflection, and emails me the insights every week. I shipped it in one night after a 7-hour drive home. Here’s how it works.
What It Does
Weekly: Every Sunday morning, a script fetches my last 7 days of journal entries, sends them to Claude with a custom prompt, and I get an email with a reflection. The markdown file also saves to my Obsidian vault.
Monthly: On the 1st of each month, another script reads all the weekly reflections and consolidates them into themes. Same flow - email + vault.
Sync: An hourly cron job keeps my local vault and phone in sync via NextCloud.
The goal isn’t motivation or feel-good summaries. The prompt is designed to find blindspots, call out patterns, and ask uncomfortable questions. AI as a coach, not a cheerleader.
The Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ DailyTxT │ │ Python │ │ Claude │
│ (phone) │ ──► │ script │ ──► │ Code CLI │
│ │ API │ (cron) │ │ │
└─────────────┘ └─────────────┘ └──────┬──────┘
│
┌──────────────────────────┘
│
▼
┌───────────────┐
│ .md file │
│ saved to │
│ vault/ │
└───────┬───────┘
│
┌──────────┼──────────┐
│ │ │
▼ ▼ ▼
┌───────┐ ┌───────┐ ┌───────────┐
│ Email │ │ Local │ │ NextCloud │
│ │ │ vault │ │ ↕ │
└───────┘ └───────┘ │ Obsidian │
│ (phone) │
└───────────┘
Four main pieces:
- DailyTxT - My journal app. Self-hosted, recently added an API.
- Python scripts - Fetch entries, build prompts, call Claude, save/email results
- Claude Code CLI - Generates the reflections (no extra API costs since I already have the subscription)
- NextCloud + rclone - Bidirectional sync so I can read everything in Obsidian on my phone
Why These Tools
DailyTxT was already my journal app before this project. When they released an API, this whole idea became possible.
Claude Code CLI instead of the Anthropic API because I already pay for the subscription. Running claude --print "prompt" from a script works well and costs nothing extra.
Cron instead of a Python scheduler because I didn’t want to run and maintain a daemon. Cron is already there, it’s lightweight, and if the machine reboots the jobs just resume. Simple.
NextCloud because I already use it for file sync. Not the cleanest solution (more on that later), but it works.
How It Works
The weekly script is straightforward:
def main():
# Fetch last 7 days from DailyTxT API
entries = fetch_entries(days=7)
# Build prompt from template + entries
prompt = build_prompt(entries)
# Generate reflection using Claude Code CLI
insight = generate(prompt)
# Save to vault/insights/weekly/2026-W03.md
save_insight(insight, week)
# Email it to myself
send_insight(
subject=f"Weekly Reflection: {week_range}",
content=insight
)
# Sync vault to NextCloud
sync_to_nextcloud()
The Claude integration is just a subprocess call:
def generate(prompt: str) -> str:
result = subprocess.run(
["claude", "--print", prompt],
capture_output=True,
text=True,
cwd=PROJECT_DIR, # For CLAUDE.md context
timeout=180
)
return result.stdout.strip()
Running it from the project directory means Claude Code picks up my CLAUDE.md file, which has all the context about who I am and what I’m working through. The AI knows my patterns, my blindspots, my values. That context makes the reflections actually useful.
The sync script is just rclone:
# Pull from NextCloud (phone → local)
rclone copy nextcloud:vault "$VAULT_DIR"
# Push to NextCloud (local → phone)
rclone sync "$VAULT_DIR" nextcloud:vault
Three cron entries tie it all together: weekly on Sunday 9 AM, monthly on the 1st at 10 AM, sync every hour.
What I’d Improve
This was a one-night build. It works, but there are rough edges:
NextCloud is overhead. It’s an extra service, an extra failure point. Obsidian has plugins that sync directly to various backends - I could probably eliminate the NextCloud middleman with something like Obsidian Git or a direct S3 sync. I went with NextCloud because I already had it running.
No centralized error handling. If the DailyTxT API is down, or Claude times out, or rclone fails, I might not notice for a while. A proper setup would have health checks, alerts, maybe a simple dashboard. Right now I’d only find out something broke when I stop getting emails.
Could use MCP. Claude Code supports Model Context Protocol servers that could connect DailyTxT, email, and file operations more elegantly. Instead of subprocess calls and shell scripts, everything could be tools the AI orchestrates directly. That’s a bigger refactor, but it would be cleaner.
It’s built for me. No config files, no CLI args for different users, hardcoded paths. That’s fine for a personal tool, but it means this isn’t something I can just share as-is.
Why This Matters
Two things I keep coming back to:
AI lets you ship ideas fast. I had this concept floating around for weeks. With Claude helping me figure out how to connect the pieces - the API structure, the prompt engineering, the sync strategy - I went from idea to running system in a few hours. You can test ideas before you’re sure they’ll work.
Start scrappy, improve later. It’s running. I’m getting weekly emails with insights I wouldn’t have written myself. That’s the important part. The architecture isn’t perfect, but perfect would have taken weeks and might never have shipped.
The reflections themselves have been worth it. Patterns I didn’t notice, questions I was avoiding, blindspots I kept repeating. Having an outside perspective - even an AI one - that knows your context and isn’t trying to make you feel good is surprisingly useful.
The best self-reflection is the one that actually happens.