This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
VRC OSC Manager is a Rust desktop application for managing multiple VRChat OSC plugins. It runs as a system tray application on Linux and Windows, with a Slint-based GUI for configuration.
# Build (requires system libs on Linux: libdbus-1-dev)
cargo build
# Run
cargo run
# Check without building
cargo check
# Lint
cargo clippy -- -D warnings
# Format check
cargo fmt --all -- --check
# Format fix
cargo fmt --all
# Cross-compile for Windows from Linux (requires gcc-mingw-w64-x86-64)
rustup target add x86_64-pc-windows-gnu
cargo build --target x86_64-pc-windows-gnu --releaseThere are no tests in this project.
The application has two main threads:
- UI thread — runs the Slint event loop (
src/ui.rs,src/main.rs) - Tokio runtime — runs all background tasks (
src/background.rs)
Communication between UI and background uses tokio::sync::mpsc channels (UiEvent for UI→background, AppEvent for background→UI).
Background tasks are managed via tokio-graceful-shutdown subsystems, all started in src/background.rs:
- OrchestrateTask — central coordinator handling app/UI events and routing commands
- VrchatMonitorTask — detects VRChat process start/stop via
sysinfo - PluginManagerTask — starts/stops plugins based on VRChat activity and user config
- OscReceiverTask / OscSenderTask — UDP OSC message I/O
- OscQueryTask — HTTP server for VRChat's OSCQuery protocol
- TrayTask — system tray icon management
- ConfigWriterTask — debounced config file persistence
Plugins implement the Plugin trait (src/plugins/mod.rs). The define_plugins! macro registers all plugins. Each plugin:
- Has its own config managed via
ConfigManager::with_plugin_id() - Receives/sends OSC messages through
ChannelManager(broadcast receiver + mpsc sender) - Registers OSCQuery endpoints
- Can optionally provide a settings UI panel
Current plugins: media_control, watch, pishock.
- UI is defined in Slint (
.slintfiles inui/) build.rscompiles Slint files and converts tray icons (RGBA pixel reorder for Linux,.rcembedding for Windows)slint::include_modules!()inmain.rsgenerates Rust bindings from Slint
src/utils/config.rs provides ConfigManager and ConfigHandle<T>. Configs are TOML files stored in the OS config directory under vrc-osc-manager/. ConfigHandle wraps Arc<RwLock<T>> and triggers async writes through the ConfigWriterTask.
src/platform/ contains linux.rs and windows.rs behind cfg gates, implementing the Platform trait for auto-start and folder-open functionality.
The app broadcasts OSCQuery and OSC services via mDNS (searchlight crate) so VRChat can discover it automatically.