Let AI explore past chats and branches with Wesh sysfs
Earlier chats, alternate branches, and other Chat Groups can hold decisions relevant to your current question. Wesh, Naidan’s browser shell, makes permitted chat history available as files at /sys/fs/naidan.
Open Naidan and choose the chat where you want the model to use earlier context.
Use decisions beyond the current chat
A decision made in an older conversation or on another branch may be missing from the current path. With access to that history, the model can find the earlier wording and use it when answering a new question.
Why make chat history a filesystem?
Wesh exposes the permitted chats as read-only message and branch files. Instead of receiving a whole history from a separate lookup tool, the model can combine familiar Shell commands: grep finds matching files, sed narrows the paths to Markdown, and head limits the candidate list. Intermediate text stays in the Shell pipeline, so only the filtered output returns to the model. With a server model, that output is sent to its configured endpoint.
Example: search across Chat Groups and branches
Ask: “Look through past chats, including other Chat Groups and branches, for where we discussed file storage, then use the relevant passage in your answer.”
With All chats allowed, a model that uses Shell can list candidate Markdown files from visible chats with a pipeline like this. Adjust the search word to match your conversations.
grep -r -l 'storage' /sys/fs/naidan/chats | sed -n '/\.md$/p' | head -n 10The output lists at most ten candidate Markdown paths, not every relevant passage or a verified decision. The model can read a selected file, check that chat’s metadata, and inspect branches/leaves-md/ for other conversation paths. current-chat/content-md/ contains only the currently selected branch.
Choose which conversations the model can read
These choices apply to the model’s next Shell use and to a new Wesh Terminal session. Turning off Mount removes this virtual filesystem. Visibility limits chat history, but every mounted choice also exposes all saved binary objects.
| Mount and visibility | Chat data | Saved binary objects |
|---|---|---|
| Mount off | No Naidan sysfs mount. | No Naidan sysfs mount. |
| Current chat | The current chat’s metadata and messages. If it belongs to a Chat Group, that group’s metadata is also readable. The conversation text in other chats in the group remains unavailable. | All saved binary objects can be listed and read. |
| Current chat + chat group | The current chat and the other chats in its Chat Group, when it has one. | All saved binary objects can be listed and read. |
| All chats | Chats and Chat Groups saved in the Naidan space you are using. | All saved binary objects can be listed and read. |
A Chat Group’s metadata can include its name, system prompt, model settings, mounts, and member chat IDs even under Current chat. Saved files include objects from other chats, such as image attachments. Choose the mount with that full scope in mind.
Enable access and check what is visible
In the chat input, open Tools and turn on Shell. In the Shell settings section that appears, turn on Mount /sys/fs/naidan. Visibility starts at Current chat when you first turn on the mount; choose the scope from the table above before letting the model use Shell. In an untouched default setup, both switches are off. Inherited or previously saved tool settings can differ, so use the switches you see in this chat.
To check the scope yourself, open the chat header’s More Actions menu and select Wesh Terminal. It creates a session if none exists. If earlier session tabs are present, select + New before entering the commands below. A new session takes this chat’s mount scope.
A terminal session keeps the mounts it had when it was created. After changing Mount or Visibility, or switching to another chat, use + New to open a session for the current chat and scope. To stop an older session using its previous scope, close its tab with × and confirm Close Session. Closing only the terminal window leaves its sessions available when reopened.
Find messages and branches by path
This is a read-only virtual mount inside Wesh, not your computer’s Linux /sys. These are the useful entry points; names containing an ID depend on your data.
current-chat- Link to this chat. Its metadata.md and metadata.json contain chat settings; content-md/ and content-json/ contain one file per message on the current branch. branches/leaves-md/ contains full paths for alternate branch leaves.
chats/- Chat directories allowed by the selected visibility. Each chat uses the same metadata, content, and branches layout.
current-chat-group- Link to the current Chat Group when the chat belongs to one. Its metadata is readable even with Current chat visibility.
chat-groups/- Visible Chat Group directories. With Current chat visibility, the current group’s chats/ list denies access.
hierarchy/- Links arranged like the visible chat sidebar hierarchy.
binary-objects/by-id/- One directory per saved binary object ID. Each has metadata.md, metadata.json, and the actual bytes in data.
version- Naidan version text for this virtual mount.
Verify the readable files in Wesh Terminal
Start with the mount and current chat. The message filenames include a sequence number, role, and message ID, so list content-md/ first and then read the filename you actually see. content-json/ contains JSON versions; branches/leaves-md/ exposes alternate conversation paths.
ls /sys/fs/naidan
cat /sys/fs/naidan/current-chat/metadata.md
ls /sys/fs/naidan/current-chat/content-mdList saved object IDs, then use an actual ID from that list in the path shown below. metadata.md or metadata.json gives its name, MIME type, size, and creation time. data contains the real bytes. For an image or other binary file, use wc -c to count bytes or xxd -l 32 to inspect the first bytes instead of printing the whole file with cat.
ls /sys/fs/naidan/binary-objects/by-idReplace {id} with a name from the ID list. These are path patterns, not commands to paste:
/sys/fs/naidan/binary-objects/by-id/{id}/metadata.md/sys/fs/naidan/binary-objects/by-id/{id}/data
How this differs from other mounts
Turning on Shell alone in the normal chat tool settings leaves this mount off when its scope was none. The Shell tool can still work with separately mounted folders. When an AI model uses that tool, its commands see the same configured sysfs scope.
Turning on Wikipedia also enables Shell and this mount. If the mount was off, it uses Current chat; an already enabled visibility choice stays in place. When a page extract exceeds 80 lines, Naidan saves it as a binary object and gives the model its file path under this mount so Shell can read a relevant portion. Other saved binary objects become readable as part of the same mount.
Copied and linked device folders are separate volume mounts with their own paths and write permissions. This sysfs mount does not add access to folders you did not select on your device.
For browsing without commands, the chat header’s File Explorer shows the same mounted paths. This chat view is separate from the saved-file list in Settings Files.