{"id":49810891,"url":"https://github.com/burnshall-ui/ocwatch","last_synced_at":"2026-05-13T01:06:10.318Z","repository":{"id":354294393,"uuid":"1212986874","full_name":"burnshall-ui/ocwatch","owner":"burnshall-ui","description":"Inotify-based write monitor for OpenClaw agents. Build on Arm64 architecture and linux.","archived":false,"fork":false,"pushed_at":"2026-04-28T00:52:39.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-28T01:23:42.313Z","etag":null,"topics":["agent","agentic-ai","agents","openclaw","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/burnshall-ui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-16T23:49:45.000Z","updated_at":"2026-04-28T00:52:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/burnshall-ui/ocwatch","commit_stats":null,"previous_names":["burnshall-ui/ocwatch"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/burnshall-ui/ocwatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burnshall-ui%2Focwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burnshall-ui%2Focwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burnshall-ui%2Focwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burnshall-ui%2Focwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/burnshall-ui","download_url":"https://codeload.github.com/burnshall-ui/ocwatch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/burnshall-ui%2Focwatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32963180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agentic-ai","agents","openclaw","zig"],"created_at":"2026-05-13T01:06:09.616Z","updated_at":"2026-05-13T01:06:10.306Z","avatar_url":"https://github.com/burnshall-ui.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ocwatch\n\nFilesystem write monitor for [OpenClaw](https://openclaw.dev) agents. Uses Linux `inotify` to watch `~/.openclaw/` recursively and logs every write, atomic rename, and delete with millisecond timestamps.\n\n```\n2026-04-17T01:42:22.263  START         watching /root/.openclaw (62 dirs) → ocwatch.log\n2026-04-17T01:48:03.891  RENAME-TO     /root/.openclaw/openclaw.json  [7027B]\n2026-04-17T01:48:03.892  RENAME-FROM   /root/.openclaw/openclaw.json.tmp\n2026-04-17T01:51:17.440  WRITE         /root/.openclaw/workspace/memory/2026-04-17.md  [1842B]\n2026-04-17T01:55:00.012  DELETE        /root/.openclaw/workspace/.tmp_session_abc123\n```\n\n## Why\n\nOpenClaw agents perform config writes as atomic renames (temp → final). Catch exactly that — plus session files, memory writes, and dream cycles — without polling.\n\n## Requirements\n\n- Linux (uses `inotify`, `getdents64`, `statx`)\n- [Zig](https://ziglang.org) 0.16+ to build\n- No libc dependency\n\n## Build\n\n```sh\nzig build -Doptimize=ReleaseFast\n```\n\nBinary lands at `zig-out/bin/ocwatch`.\n\n## Install\n\n```sh\ncp zig-out/bin/ocwatch ~/.local/bin/\n```\n\n## Usage\n\n```\nocwatch [watch-dir] [log-file]\n```\n\n| Argument    | Default                              |\n|-------------|--------------------------------------|\n| `watch-dir` | `/root/.openclaw`                    |\n| `log-file`  | `/root/.openclaw/logs/ocwatch.log`   |\n\nOutput goes to **both stdout and the log file** simultaneously.\n\n## Run as a service\n\n```sh\n# ~/.config/systemd/user/ocwatch.service\n[Unit]\nDescription=OpenClaw Agent Write Monitor\nAfter=openclaw-gateway.service\n\n[Service]\nExecStart=/root/.local/bin/ocwatch /root/.openclaw /root/.openclaw/logs/ocwatch.log\nRestart=on-failure\nRestartSec=5\n\n[Install]\nWantedBy=default.target\n```\n\n```sh\nsystemctl --user enable --now ocwatch\n```\n\n## Event types\n\n| Event         | Meaning                                           |\n|---------------|---------------------------------------------------|\n| `WRITE`       | File closed after write (`IN_CLOSE_WRITE`)        |\n| `RENAME-TO`   | File renamed here — openclaw's atomic write pattern |\n| `RENAME-FROM` | Source side of a rename                           |\n| `DELETE`      | File removed                                      |\n| `DELETE-SELF` | Watched directory removed                         |\n\nNew subdirectories are picked up automatically at runtime — no restart needed.\n\n## Log format\n\n```\n\u003cISO8601-ms\u003e  \u003cEVENT\u003e       \u003cfull-path\u003e  [\u003csize\u003eB]\n```\n\nSize is shown for `WRITE` and `RENAME-TO` events via `statx(2)`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburnshall-ui%2Focwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fburnshall-ui%2Focwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fburnshall-ui%2Focwatch/lists"}