Skip to main content

timecapsule

A git-like filesystem that automatically creates narrative commits.

Quick Start · How It Works · Browsing · LLM Narrator
Python 3.10+ MIT License Version 0.1.0


Every file has a story. timecapsule is a background daemon that watches your project folders and creates narrative commit messages from your changes — automatically.

After 2 minutes of inactivity on a file, it snapshots the changes to a local Git repository. The commit message is generated by a small local LLM that summarizes why you made the changes, not just what changed.

"Renamed parse() to tokenize() after the linter complained about naming — also dropped the unused xml import."

Over time, you get a searchable, browsable timeline of your work. Each file's history becomes a diary.

Quick Start

pip install capsule-narrative
timecapsule

This watches the current directory tree. After 2 minutes of inactivity on a file, it snapshots the changes.

timecapsule /path/to/project          # Watch a specific directory
timecapsule --idle 60                 # Faster snapshots (60s idle)
timecapsule --once                    # One-time snapshot of all files
timecapsule --browse                  # Open the timeline browser TUI
timecapsule --status                  # Show capsule stats

How It Works

File watcher. A background daemon monitors file changes using watchdog. When a file hasn't been modified for 2 minutes (configurable), it triggers a snapshot — you've finished a thought.

Git backend. Each file gets its own orphan branch in a dedicated bare repository at ~/.capsule/timecapsule. The user's real Git repos are never touched. Branches are named by canonical path, so renaming or moving a file can continue its history.

Narrative commit messages. The daemon diffs the current file against its last snapshot and generates a commit message that reads like a diary entry.

Browsing

timecapsule --browse

Opens a Textual TUI that shows:

  • Tracked files — all files with snapshots, sorted by most recent
  • Timeline — commit history for the selected file with narrative messages
  • Diff preview — file content at any selected snapshot

You can scroll through history, search messages, and see exactly what your file looked like at any point.

Ollama

timecapsule works without Ollama — it generates structural commit messages by default ("Added 3 lines to main.py (Python)"). But with Ollama installed, the messages transform into genuine narrative.

ollama pull qwen2.5-coder:1.5b

This ~1GB model runs on any modern laptop and generates commit messages in ~2 seconds. Smaller models like llama3.2:1b also work.

The prompt context includes the file diff, the file path, and the previous commit message for continuity. The LLM explains why the changes were made, not just what changed.

Architecture

~/.capsule/
├── timecapsule/          # Bare git repository
│   └── refs/heads/       # One orphan branch per file
│       ├── home-user-project-main-py
│       ├── home-user-project-readme-md
│       └── ...
└── timeline.db           # SQLite index for fast queries

Each snapshot:

  1. Hashes the file content into a git blob
  2. Creates a tree object referencing the blob
  3. Commits the tree to the file's orphan branch (with parent if one exists)
  4. Records metadata in SQLite for fast timeline queries

The SQLite store makes timecapsule --browse instant — no git log parsing needed.

FAQ

Q: Does it affect my existing Git repos? A: No. timecapsule uses a dedicated bare repository at ~/.capsule/timecapsule. Your .git directories are untouched.

Q: What file types are watched? A: Common source files: .py, .js, .ts, .rs, .go, .java, .md, .json, .yaml, .css, .html, .jsx, .tsx, .c, .cpp, .h, .sh, .rb, .sql, and more.

Q: Can I delete the capsule database? A: Yes — remove ~/.capsule/ to wipe everything. Snapshots are disposable by design.

Q: Does it work on Windows/Mac/Linux? A: Yes. The watcher uses watchdog which works on all three platforms. The git operations are cross-platform.

License

MIT


Every file has a story.

Metadata

Release files for capsule-narrative 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for capsule-narrative 0.1.0
File Size Uploaded Provenance
capsule_narrative-0.1.0.tar.gz 14.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for capsule-narrative 0.1.0
File Interpreter ABI Platform
capsule_narrative-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.7 kB

Release files / capsule_narrative-0.1.0.tar.gz

Download URL capsule_narrative-0.1.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0e9b02467a76ba157f71b484c3c78df6bc57043eccf18a693ac8efb4d8446d47
BLAKE2b-256 checksum
How to use checksums
587c91a7ce56a39e63278b6f113dbbf94bd7ca22f70f7b0b8755c387b4927998
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Release files / capsule_narrative-0.1.0-py3-none-any.whl

Download URL capsule_narrative-0.1.0-py3-none-any.whl
Size 15.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0020e15c950cf02650564ea211bed7600fd74b36feea849a8daf9fecddde5fef
BLAKE2b-256 checksum
How to use checksums
6d38ad4ac58aaf7d10297b92dec76cbde9d58d9be18e8de4633b909b04e4ce70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.4

Security for capsule-narrative 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page