# How project.md Persists Session Memory Across Video Editing Sessions

> Discover how project.md persists session memory for video editing in browser-use/video-use. Learn to restore context and save decisions with this markdown log.

- Repository: [Browser Use/video-use](https://github.com/browser-use/video-use)
- Tags: internals
- Published: 2026-07-05

---

**The [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md) file in `browser-use/video-use` functions as an append-only markdown log stored in the user's local edit directory, enabling the skill to restore previous editing context on startup and record new decisions at the end of each session.**

The `browser-use/video-use` repository relies on [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md) to maintain durable session memory across disjoint video-editing runs. Unlike complex database backends, this lightweight file lives outside the repository source tree and stores a human-readable history of strategies, decisions, and outstanding tasks. Understanding how [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md) persists session memory across video editing sessions is essential for anyone customizing or debugging the skill's continuity behavior.

## Where project.md Lives in the File System

Every editing session operates inside an *edit directory* located in the user's `<videos_dir>` path, typically `~/videos/edit/`. Inside this directory, the skill creates or reuses a file at:

`<videos_dir>/edit/project.md`

According to the `browser-use/video-use` source code, this location is explicitly chosen to keep session data on the user's local filesystem rather than inside the repository itself. Because the path sits outside the source tree, the file survives between runs without requiring external services.

## The Append-Only Session Log Format

At the end of each session, the skill appends a fixed markdown section to [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md). The file is **only ever appended**; nothing is overwritten. This guarantees that the full history of edits remains on disk.

The block follows a strict template defined in [`SKILL.md`](https://github.com/browser-use/video-use/blob/main/SKILL.md) under the *Memory* section:

```markdown

## Session N — YYYY-MM-DD

**Strategy:** …
**Decisions:** …
**Reasoning log:** …
**Outstanding:** …

```

In `browser-use/video-use`, the `persist_session` function handles this write operation. It counts existing `## Session` headings to determine the next session number, then opens the file in append mode:

```python
import os
from datetime import date

def persist_session(edit_dir: str, strategy: str, decisions: str,
                    reasoning: str, outstanding: str) -> None:
    """Append a new markdown block to <edit>/project.md."""
    project_path = os.path.join(edit_dir, "project.md")
    session_num = 1
    # Count existing sections to get the next session number

    if os.path.exists(project_path):
        with open(project_path, "r") as f:
            for line in f:
                if line.startswith("## Session"):

                    session_num += 1
    block = f"""## Session {session_num} — {date.today().isoformat()}

**Strategy:** {strategy}
**Decisions:** {decisions}
**Reasoning log:** {reasoning}
**Outstanding:** {outstanding}
"""

    with open(project_path, "a") as f:
        f.write("\n" + block)

```

## Reading Session Memory at Startup

When a new session begins, the skill checks for the existence of [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md). If the file is present, the assistant reads the entire log, isolates the **last** session block, and presents a one-sentence summary to the user before asking whether to continue.

This startup read gives the LLM immediate context about prior edits, letting the assistant resume work exactly where it left off. The `last_session_summary` function implements this logic by scanning for the final `## Session` heading and extracting the `**Strategy:**` line:

```python
def last_session_summary(edit_dir: str) -> str:
    """Return a one-sentence summary of the latest session."""
    project_path = os.path.join(edit_dir, "project.md")
    if not os.path.exists(project_path):
        return ""
    with open(project_path, "r") as f:
        lines = f.readlines()

    # Find the last "## Session …" heading and capture the following lines

    last_heading = max(i for i, l in enumerate(lines) if l.startswith("## Session"))

    # Grab the next non-empty line after the heading (the Strategy line)

    for line in lines[last_heading + 1:]:
        if line.strip().startswith("**Strategy:**"):
            return line.strip().split(": ", 1)[1]
    return ""

```

## Persistence, Privacy, and Version Control

Because [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md) lives inside the user's *edit* folder on the local filesystem, it is automatically persisted between runs without relying on databases or cloud storage. The file itself is the persistent store.

To protect session-specific data from accidental sharing, `.gitignore` explicitly ignores [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md). The repository's [`README.md`](https://github.com/browser-use/video-use/blob/main/README.md) notes this mechanism, while helpers such as [`render.py`](https://github.com/browser-use/video-use/blob/main/render.py) and [`transcribe.py`](https://github.com/browser-use/video-use/blob/main/transcribe.py) inside the `helpers/` directory operate on the `<edit>` folder and depend on the log's presence for continuity.

## Summary

- [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md) is stored at `<videos_dir>/edit/project.md` on the user's local filesystem.
- The log uses an **append-only** markdown format with numbered sessions dated `YYYY-MM-DD`.
- The `persist_session` function writes new blocks without overwriting history.
- The `last_session_summary` function reads the most recent `**Strategy:**` line at startup to restore context.
- The file is excluded from Git by `.gitignore` to keep session data private and local.

## Frequently Asked Questions

### What is the exact file path for project.md?

The skill creates or reuses `<videos_dir>/edit/project.md` inside the user's video directory, for example `~/videos/edit/project.md`. This path is hard-coded relative to the edit folder so that the log persists outside the repository source tree.

### Does project.md overwrite previous sessions?

No, the file is strictly **append-only**. Each new session is written as an additional markdown block, so the full editing history remains intact on disk indefinitely.

### Is project.md committed to Git?

No. The `browser-use/video-use` repository lists [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md) in `.gitignore`, which prevents the file from being committed. This design keeps session-specific reasoning and decisions local to the user's machine.

### Which source files define how project.md is used?

[`SKILL.md`](https://github.com/browser-use/video-use/blob/main/SKILL.md) specifies the overall architecture and the *Memory* section that governs [`project.md`](https://github.com/browser-use/video-use/blob/main/project.md). Helper modules under `helpers/` such as [`render.py`](https://github.com/browser-use/video-use/blob/main/render.py) and [`transcribe.py`](https://github.com/browser-use/video-use/blob/main/transcribe.py) interact with the edit directory and depend on the log's presence for continuity.