A space in Glyph is a directory-based workspace that contains your notes and any related files you want to keep together. Glyph treats the folder you open as the root of that workspace and keeps its own support data inside .glyph/.
What is a Space?
A space is simply a folder on your computer that Glyph uses to store and organize your notes. When you create or open a space, Glyph sets up a special .glyph/ directory inside it for app-managed data like the search index, caches, and AI history.
Directory Structure
When you create or open a space, Glyph ensures a structure like this exists:
your-space/
├── .glyph/
│ ├── glyph.sqlite # Search index database
│ ├── cache/
│ │ ├── ai/ # AI audit logs
│ │ └── link-previews/ # Cached link preview data
│ └── Glyph/
│ ├── ai_history/ # AI conversation history JSON
│ └── ai_secrets.json
├── assets/ # Attachments (created on demand)
├── notes/ # Optional conventional notes folder
└── (your files and folders)Note
The .glyph/ folder is automatically managed by Glyph. Your own markdown files do not need to live in a hardcoded folder structure to be part of the space.
Creating a Space
You can create a new space in two ways:
- From the Welcome Screen: Click “Create Space” and choose a directory
- From the Menu: Navigate to File → Create Space (or use
Cmd+Shift+Non macOS)
When you create a space, Glyph:
- Creates the
.glyph/directory structure - Opens the search database when needed
- Sets up the file watcher for real-time updates across the space
- Cleans up any temporary files from previous sessions
// From src-tauri/src/space/helpers.rs
pub fn create_or_open_impl(root: &Path) -> Result<SpaceInfo, String> {
ensure_glyph_dirs(root)?;
let _ = cleanup_tmp_files(root);
Ok(SpaceInfo {
root: root.to_string_lossy().to_string(),
schema_version: VAULT_SCHEMA_VERSION,
})
}Opening a Space
To open an existing space:
- Use
Cmd+O - Select the folder containing your notes
- Glyph will detect if it’s an existing space or create a new one
What happens when you open a space?
When you open a space, Glyph performs these operations:
- Validates the directory - Ensures it’s a valid folder path
- Initializes metadata - Creates
.glyph/structure if needed - Starts file watcher - Monitors changes to your files in real-time
- Loads the index - Opens
.glyph/glyph.sqlitefor search - Cleans temporary files - Removes
.tmpfiles from crashes
The file watcher (implemented in src-tauri/src/space/watcher.rs) monitors all changes and updates the search index automatically with a 100ms debounce.
File Watching
Glyph monitors your space directory for changes using a recursive file watcher. This means:
- Real-time updates: Changes from external editors appear immediately
- Smart indexing: Only modified files are re-indexed
- Change debouncing: Multiple rapid changes are batched (100ms window)
- Hidden file filtering: Ignores files/folders starting with
.
How It Works
// From src-tauri/src/space/watcher.rs
const DEBOUNCE_MS: u64 = 100;
// The watcher monitors three types of events:
// - Create: New files or folders
// - Modify: Content changes
// - Remove: Deleted files or foldersWhen changes are detected:
- External changes trigger a
space:fs_changedevent to the frontend - Markdown files are automatically re-indexed for search
- The file tree UI updates to reflect changes
- Recent local changes (within 2 seconds) are tracked to avoid duplicate processing
Note
Glyph ignores its own writes for 2 seconds to prevent re-indexing files you just saved.
Closing a Space
To close the current space:
- Use File → Close Space from the menu
- The file watcher stops
- The search index connection closes
- Recent spaces list is updated
Your files remain untouched - closing a space just disconnects Glyph from monitoring it.
Recent Spaces
Glyph remembers recently opened spaces for quick access. You can:
- View recent spaces in Settings → Space
- Clear the recent list with the “Clear” button
- Reopen a recent space from the welcome screen
Space Operations Reference
| Operation | Command | Description |
|---|---|---|
| Create Space | space_create | Creates directory structure and initializes a new space |
| Open Space | space_open | Opens existing space or creates if needed |
| Close Space | space_close | Stops watcher and closes index connection |
| Get Current | space_get_current | Returns the path of currently open space |
Best Practices
- Keep spaces focused: Create separate spaces for different projects or areas
- Use cloud sync carefully: If syncing with Dropbox/iCloud, be mindful that
.glyph/is app-managed support data - Don’t nest spaces: Avoid creating one space inside another
- Backup regularly: The
.glyph/folder can be recreated, but back up your notes
Can I use Git with spaces?
Yes. You can version control your space with Git. A reasonable starting point is:
.glyph/cache/
.glyph/Glyph/ai_history/
.glyph/Glyph/ai_secrets.json
.glyph/*.tmpThe search database (.glyph/glyph.sqlite) can be committed or ignored depending on your workflow. Glyph will rebuild it if missing.
Troubleshooting
Space won’t open
- Ensure the folder exists and you have read/write permissions
- Check that the path doesn’t contain special characters
- Try creating a new space instead
Search not working
- Go to Settings → Space and click “Rebuild Index”
- This re-indexes all markdown files in your space
Changes not appearing
- The file watcher may have stopped - try closing and reopening the space
- Check that changed files aren’t in hidden folders (starting with
.)