Sashmark / Blog

Markdown viewer auto reload not working? Fix it

Bobby Huang ·

This page is a fix list for when markdown viewer auto reload seems to fail: your agent saved the file and the old text is still on screen. The body walks through four checks in order, each in its own section: a manual refresh, the viewer's reload setting, the path the agent saved to, and an unsaved copy in an editor. The path check section includes terminal commands and how to read their output. A last section points to help for losing your place after a reload.

Key takeaways

  • The fixes on this page run in a set order, from the quickest check to the slowest.
  • The first section explains what a manual refresh tells you and where to go next.
  • The section on reload settings lists the words to search for in a viewer's settings.
  • The path check shows ls and cat commands with real output and what that output means.
  • The last fix covers an unsaved editor copy and how to compare it with the file on disk.

Your agent reports that it updated the plan. You glance at the Markdown viewer you have open, and the old text is still on the page. The plan's status line still says Status: drafting. Nothing crashed, yet the page on screen may be a version that no longer exists on disk.

This page is a fix list for that moment. Work through it in order, since each step takes less time than the one after it. If your trouble is the opposite, a reload that jumps back to line one, start with keeping your spot while an agent rewrites.

What auto reload should do

A viewer with auto reload notices the saved file changed and redraws the page from the new text. You don't reopen anything.

Viewers differ a lot on this. Some watch the file the whole time, while others may only check when you switch back to them. A few ask before they redraw, and some never reload at all. So "not working" can mean the feature is off, the viewer lacks it, or the agent wrote somewhere other than the file on your screen.

Fix 1: Refresh by hand

Start with the simplest test. Close the file and open it again from the same place, or use the viewer's reload command if it has one.

  • The new text appears. The file on disk was fine. The viewer likely didn't pick up the change by itself. Go to fix 2.
  • The old text is still there. The viewer is probably not the cause. The text you expect may not be in that file. Go to fix 3.

If you read the file in a terminal with less, press R. The less manual describes it as a repaint that reloads the current file, and calls it useful when a file changes while you view it. For a log the agent keeps adding to, F scrolls forward and keeps reading as the file grows. Stop the wait with the interrupt key, usually Ctrl-C, and press q to leave less.

Fix 2: Find the viewer's reload setting

If a manual refresh works but the automatic one doesn't, open the viewer's settings or preferences. The names vary from app to app. Search for words like reload, refresh, watch, external change or "changed on disk".

What to look for:

  1. Reload switched off. In some viewers it may be an option you have to turn on.
  2. A prompt you missed. Some viewers ask before they reload. A prompt you dismissed, or one sitting behind another panel, can leave the old text up.
  3. Checks only on focus. Some viewers may not notice a change until you click back into them.
  4. A synced or network folder. Change alerts from those folders may arrive late, or not at all, in some viewers.

If you find no such setting, your viewer may not offer one. A manual refresh, or less with R, is the fallback.

Fix 3: Check the agent wrote the path you have open

This one is easy to miss. An agent may save into a different folder, under a slightly different name, or relative to a working folder you didn't expect. The viewer then reloads nothing, because your file never changed.

  1. Find the full path of the open file. Many viewers show it in a file info panel or when you point at the name.
  2. Get the path the agent used. Check the agent's output, or ask it for the exact path.
  3. Compare the two with ls -l. For recent files, the long format shows the month, day, hour and minute each one last changed. A file last changed more than six months ago shows the year in place of the time.
ls -l plan.md docs/plan.md
-rw-r--r--@ 1 jdoe  wheel  21 Oct 20 08:18 docs/plan.md
-rw-r--r--@ 1 jdoe  wheel  25 Oct 20 08:17 plan.md

The agent saved docs/plan.md a minute after the copy on screen was last touched. You were reading the wrong file.

  1. Sort a folder newest first. ls -lt puts the most recently modified entries at the top. It lists only that folder's own entries, so in the test above ls -lt showed the docs folder but not the file inside it. Run ls -lt docs to see the new plan.md.
  2. Print the saved text. cat docs/plan.md writes the file to the terminal, with no viewer in between:
# Plan

Status: done

When the agent wrote somewhere else, open that path instead. Then put the full path in your prompt so the next save lands where you read.

When the agent replaces the file

Sometimes the path is right but the file behind it is new. Some programs save by writing a new file under a temporary name and moving it over the old one. The path stays the same, but on disk it's a different file. ls -li prints the file serial number, also called the inode number, before the permissions on each line:

ls -li plan.md
2724185121 -rw-r--r--@ 1 jdoe  wheel  25 Oct 20 08:17 plan.md

Run it again after the agent saves. In a local test where a new file was moved over the old one, the number changed to 2724190915. In the same test, writing new text into the existing file kept the number the same. So a changed number points to a replaced file, not one edited in place. A viewer that follows the original file may miss a replaced one, so a manual refresh is the safer move here.

Fix 4: Look for an unsaved copy in an editor

If the same file is also open in an editor, many editors hold their own copy in memory. When that copy has unsaved edits, many editors keep showing it, and some ask before they load the outside change. Save at that moment and you may write your old copy over the agent's work.

  1. Look for an unsaved marker. Many editors show a dot or an asterisk next to the file name.
  2. Don't save over the file yet. Use save-as to keep your copy under a new name, such as plan-mine.md.
  3. Run a diff. diff -u prints a unified diff with three lines of context:
diff -u plan.md plan-mine.md
--- plan.md	2026-10-20 08:18:07
+++ plan-mine.md	2026-10-20 08:18:07
@@ -1,3 +1,4 @@
 # Plan
 
 Status: done
+My note.

The line marked + exists only in your copy. Carry it into the agent's version by hand, save that file, and delete the extra copy.

What happens when you and the agent both write is covered in sharing one file with an agent.

When a reload loses your place

Once auto reload works, a new snag can appear. Some viewers may redraw from the top after each reload, and the paragraph you were reading scrolls out of sight. Others may hold the scroll position, but the text under it shifts when new lines land above it.

Two habits help. Note the heading you're under before you look away, then search for it after the reload. And keep the version you last read so you can check it against the new one, as covered in comparing two versions of a file. The reviewing series puts these steps in a wider routine.

Where Sashmark fits

The plan for Sashmark calls for a desktop app that lets you read and edit Markdown while an agent keeps changing it under you. It is in development and has not been released. The app itself has no AI features. On the v1 list: Live Reload after an External Change, keeping Reading Position, and a Keep mine / Load theirs option for edits you haven't saved when the file changes on disk. For scope, read planned features; for behavior, the help pages; for status, the roadmap.

Read more at sashmark.com.

Questions

My agent saved the file. Why is the old text still up?
The four fixes in the body go through the likely causes in order, starting with a manual refresh.
How can I tell which file the agent actually saved?
The section on checking the path shows the ls and cat commands to run and how to read their output.
Will an automatic reload lose my place in the file?
The section on losing your place takes up this question and links to a fuller routine.

What Sashmark plans for v1: Features · Roadmap

View as Markdown