watcher

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package watcher watches ~/.claude/projects/ for JSONL changes via fsnotify and emits reload signals.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Watcher

type Watcher struct {
	// contains filtered or unexported fields
}

Watcher watches ~/.claude/projects/ for JSONL changes and emits batches of changed file paths through C(). It uses fsnotify as the primary mechanism with an idle-triggered stat poll: if no fsnotify event arrives within 5s of startup or the last valid event, a full directory scan is performed. Events are rate-limited to at most one emission per second.

func New

func New(baseDir string) (*Watcher, error)

New creates and starts a Watcher for baseDir (typically ~/.claude/projects). If fsnotify is unavailable the watcher falls back to polling only.

func (*Watcher) C

func (w *Watcher) C() <-chan []string

C returns the channel on which batches of changed JSONL paths are sent.

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop shuts down all background goroutines.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL