Skip to content

andreyvit/lifebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LifeBase

LifeBase is a git repo that doubles as a personal knowledge base, diary, daily log, therapy notebook, and AI context layer.

The basic idea is simple: keep the important parts of your life in one place, in plain files, with enough structure that an AI assistant can pick up where it left off instead of making you re-explain yourself every day.

In practice, a LifeBase usually grows into:

  • evergreen files about who you are, what matters to you, what you are trying to build, and how you want to live
  • daily and diary writing
  • specialized logs for repetitive low-drama data like meals, symptoms, sex, or health snapshots
  • prompt files that turn your repo into a persistent coaching / accountability / reflection system
  • a continuity layer for Claude Code, so the AI can read your life context, not just your latest message

If you already keep notes, planning docs, therapy notes, journals, or life admin in scattered places, LifeBase is a way to make them coherent and operational.

Why This Exists

Most AI tools are stateless by default. They are good in the moment, then forget the shape of your life.

LifeBase is for people who want more than one-off chat:

  • an AI that can remember your long-running goals, habits, fears, and projects
  • a place where reflective writing and mundane life tracking can coexist without collapsing into mush
  • a repo you can version, back up, search, refactor, and selectively share
  • a system that supports gentle life steering: check-ins, therapy continuity, planning, and long-horizon self-observation

It is especially useful if you want AI to help with:

  • personal reflection
  • accountability
  • therapy-adjacent note keeping
  • daily planning and review
  • keeping continuity across months instead of across one chat session

Install the Toolchain

LifeBase itself is a single Go binary, but it depends on a few other tools:

  • Go 1.24.5 or newer, to install lifebase
  • Claude Code, because LifeBase uses the local claude CLI for all reasoning
  • ffmpeg and ffprobe, because audio ingestion and format conversion depend on them
  • an OpenAI API key, because audio transcription uses OpenAI's speech-to-text API

Install LifeBase

go install github.com/andreyvit/lifebase@latest

If lifebase is not on your PATH, make sure your Go bin directory is:

export PATH="$(go env GOPATH)/bin:$PATH"

Install Claude Code

Follow Anthropic's official quickstart:

The simplest macOS / Linux install is:

curl -fsSL https://claude.ai/install.sh | bash

Then start Claude Code once and log in:

claude

Anthropic currently supports logging in with a Claude subscription account such as Pro / Max / Teams / Enterprise, or with a Claude Console account. For LifeBase, a normal Claude subscription is the easiest path.

Install ffmpeg

On macOS:

brew install ffmpeg

That gives you both ffmpeg and ffprobe, which LifeBase needs.

Bootstrap a New LifeBase

The easiest starting point is a fresh Git repo.

lifebase -init will create missing files and merge the required ignore rules into your existing .gitignore.

git clone git@github.com:you/your-lifebase.git
cd your-lifebase
lifebase -init

You can also start in an empty directory:

mkdir my-lifebase
cd my-lifebase
git init
lifebase -init

After -init, do these first:

  1. Rewrite AGENTS.md so it describes your life, not the fictional starter person.
  2. Replace the example content under Core/, Diary/, Daily/, Logs/, and Therapy/.
  3. Fill in lifebase-secrets.yaml.
  4. Commit the initial repo and make sure it has a working upstream remote, because LifeBase auto-pushes.

Secrets and Credentials

LifeBase reads secrets from lifebase-secrets.yaml.

Generated by -init:

OPENAI_API_KEY: ""
TELEGRAM_BOT_TOKEN: ""
TELEGRAM_CHAT_ID: ""

OpenAI API key

Create a secret API key here:

That key is only for transcription. Claude reasoning does not use OpenAI.

Claude authentication

Claude auth is handled by the claude CLI itself, not by lifebase-secrets.yaml.

Feed Notes Into LifeBase

There are three main intake paths:

  • one-off ingestion from the terminal
  • Telegram messages and voice notes
  • an automatically watched audio recorder folder

One-off ingestion from the terminal

You can ingest an audio file directly:

lifebase -add /path/to/note.m4a

Or ingest a plain text / markdown note:

lifebase -add /path/to/note.md
lifebase -add /path/to/note.txt

What happens:

  1. Audio is transcribed with OpenAI gpt-4o-transcribe.
  2. If the format is unsupported, LifeBase converts it with ffmpeg.
  3. Long audio is chunked automatically before upload.
  4. The resulting text is sent to Claude Code with Prompts/system-ingest.md.
  5. Claude updates your repo according to AGENTS.md.
  6. The final reply is sent to Telegram.

Important: -add still expects Telegram to be configured, because replies are delivered there rather than printed to stdout.

Audio transcriptions are saved under Raw/ by default.

Telegram bot setup

Telegram is the main interactive channel for LifeBase.

  1. Create a bot via @BotFather.
  2. Copy the bot token into TELEGRAM_BOT_TOKEN.
  3. Send at least one message to your bot from the account you want to use.
  4. Get your numeric chat ID.
  5. Put that numeric ID into TELEGRAM_CHAT_ID.

The easiest way to get your personal numeric chat ID is usually @userinfobot.

Example:

TELEGRAM_BOT_TOKEN: "123456:ABCDEF..."
TELEGRAM_CHAT_ID: "123456789"

Inbound Telegram intake is intentionally locked to that numeric chat ID. If you set a non-numeric value, outbound messages may work, but inbound intake is disabled for safety.

Once Telegram is configured and the daemon is running, you can:

  • send text messages
  • send voice notes
  • use slash commands like /morning
  • use built-ins like /pause, /resume, /new, /commit, and /health

Watched audio recorder folder

If you set audio_recorder_dir, running plain lifebase starts a daemon that polls that folder every 5 seconds and ingests new .m4a files.

Example:

audio_recorder_dir: "/absolute/path/to/your/recorder/folder"

Behavior:

  • only .m4a files are watched
  • files already present on initial startup are marked as seen and not backfilled
  • new files are identified by basename
  • successful ingestion does not delete the source file
  • replies still go to Telegram

This is meant for iPhone / Mac audio recorder workflows where recordings land in a synced folder and LifeBase picks them up automatically.

What Happens Under the Hood

LifeBase is intentionally simple, but there are a few important moving parts.

A persistent Claude Code session

LifeBase keeps a persistent Claude Code session in state_file and reuses it across messages.

That session is rotated daily:

  • the boundary is controlled by day_boundary_hour (default: 5)
  • if you interacted recently, the session can survive past the boundary by agent_session_extend_if_interacted_within (default: 1h)
  • you can force a reset from Telegram with /new

Startup prompt

Whenever a new Claude session starts, LifeBase runs Prompts/init.md first.

That prompt is where you define what Claude should load at session start: usually your core files, recent Diary and Daily notes, therapy notes, AI notes, and optionally generated health context.

Ingestion prompt and AGENTS instructions

Every incoming note goes through:

  • Prompts/system-ingest.md
  • AGENTS.md

system-ingest.md is the short operational prompt for message handling.

AGENTS.md is the long-form instruction file describing:

  • how your repo is organized
  • where different kinds of notes should go
  • how much editing to do
  • what voice and role the AI should take with you

In practice, AGENTS.md is the heart of personalization.

Auto-commit and auto-push

Before and after every Claude model run, LifeBase stages all changes, commits them, and runs git push.

That means:

  • your repo should already be a Git repo
  • your current branch should have a working upstream
  • you should be comfortable with automatic commits

There is also a manual:

lifebase -commit

If Git is not configured correctly, ingestion can still edit files, but the commit / push step will fail.

Prompt Commands and Scheduled Check-Ins

LifeBase treats prompt files as named commands.

Rule:

  • any markdown file under Prompts/ whose basename does not start with system becomes a prompt

In practice that means files like system-ingest.md are reserved system prompts, while everything else becomes a custom command.

Examples:

  • Prompts/morning.md -> lifebase -proactive morning and Telegram /morning
  • Prompts/checkin.md -> lifebase -proactive checkin and Telegram /checkin

Prompt names are normalized by lowercasing and removing spaces, dashes, and underscores.

init.md is special:

  • it is also used as the session bootstrap prompt
  • but it still follows the same prompt-file conventions

Scheduled prompts

Prompt files can include YAML-style frontmatter:

---
schedule: ["08:00", "21:30"]
---

When the daemon is running, LifeBase checks prompt schedules every minute and triggers due prompts automatically.

Proactive history

The output of proactive prompts is appended to proactive_history_file, which defaults to:

Generated/proactive-history.md

This file exists so your prompts can read recent proactive messages and avoid repeating themselves.

Apple Health Export

LifeBase can ingest daily Apple Health exports from the Health Auto Export app.

Relevant docs:

The App Store listing currently shows paid Basic and Premium tiers. If you want to rely on automated exports, verify the current plan requirements in the app before you set this up.

Recommended setup

In Health Auto Export:

  1. Grant the app access to the Apple Health data you care about.
  2. Open Automated Exports.
  3. Create a new iCloud Drive automation.
  4. Choose Health Metrics.
  5. Choose JSON.
  6. Choose Day as the date range.
  7. Pick an automation name, for example LifeBaseExport.
  8. Let it run once manually so the folder is created.

LifeBase expects a directory containing daily files named like:

HealthAutoExport-2026-03-25.json

So apple_health_export_dir should point at the local folder that contains those files.

On macOS, this is often the local iCloud mirror of the app's folder, for example something like:

~/Library/Mobile Documents/iCloud~com~ifunography~HealthExport/Documents/LifeBaseExport/

If that exact path differs on your machine, just find the directory that actually contains the HealthAutoExport-YYYY-MM-DD.json files and use that.

What LifeBase does with it

If apple_health_export_dir is configured:

  • before a new Claude session starts, LifeBase writes current health context to health_file
  • health_file defaults to Generated/health.md
  • lifebase -health48 prints a recent 48-hour summary for debugging

If you also keep a HealthLog log file, LifeBase can append a daily end-of-day summary there when the day rolls over.

Note: the Health Auto Export docs explicitly call out iOS limitations around background execution and locked devices. If the exports seem stale, check Background App Refresh, iCloud Drive sync, and whether the app had a chance to run while the phone was unlocked.

Configuration Reference

All paths are resolved relative to the directory containing lifebase.yaml, unless you use an absolute path.

Key Default Meaning
raw_inputs_dir Raw Where raw transcriptions and reused input notes live.
prompts_dir Prompts Directory containing prompt files.
state_file lifebase-state.json Persistent daemon state: seen files, prompt runs, Claude session, pending log input, etc.
secrets_file lifebase-secrets.yaml YAML file containing the OpenAI and Telegram secrets.
audio_recorder_dir empty Optional watched folder for .m4a recordings.
apple_health_export_dir empty Optional folder containing HealthAutoExport-YYYY-MM-DD.json files.
health_file Generated/health.md Auto-written health context file used on new Claude sessions.
proactive_history_file Generated/proactive-history.md Rolling log of proactive outputs so prompts can avoid repetition.
write_history false If true, write raw prompt / assistant transcripts into .history/ for debugging.
day_boundary_hour 5 Local hour treated as the LifeBase day boundary.
agent_session_extend_if_interacted_within 1h Keep the Claude session alive across the day boundary if there was recent interaction.

write_history

When enabled, LifeBase writes prompt / reply transcripts into .history/.

This is mainly for debugging prompt behavior, not normal daily use.

Common Commands

lifebase -init
lifebase -add /path/to/file.m4a
lifebase -add /path/to/file.md
lifebase -proactive morning
lifebase -commit
lifebase -health48
lifebase

Running plain lifebase starts the daemon:

  • audio folder watch, if configured
  • Telegram polling, if configured
  • proactive scheduled prompts

A Reasonable First Run

Once you have:

  • run lifebase -init
  • rewritten AGENTS.md
  • replaced the fictional starter content
  • filled in lifebase-secrets.yaml
  • installed Claude Code
  • logged in with claude
  • installed ffmpeg
  • configured Git remote / upstream

you can start the daemon:

lifebase

Then send your bot a text or voice note, or drop a new .m4a into your watched recorder folder.

About

Command-line tool and daemon for your LifeBase, a comprehensive database about yourself.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages