{"id":50717053,"url":"https://github.com/manzil-infinity180/aflock-replay","last_synced_at":"2026-06-09T19:30:21.065Z","repository":{"id":349196702,"uuid":"1201431120","full_name":"manzil-infinity180/aflock-replay","owner":"manzil-infinity180","description":"Browser-based tool to replay Claude Code sessions against aflock policy","archived":false,"fork":false,"pushed_at":"2026-04-04T19:53:04.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T20:11:20.423Z","etag":null,"topics":["aflock","agent","claude","claude-code"],"latest_commit_sha":null,"homepage":"https://manzil-infinity180.github.io/aflock-replay/","language":"HTML","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/manzil-infinity180.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-04T17:07:38.000Z","updated_at":"2026-04-04T18:41:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/manzil-infinity180/aflock-replay","commit_stats":null,"previous_names":["manzil-infinity180/aflock-replay"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/manzil-infinity180/aflock-replay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzil-infinity180%2Faflock-replay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzil-infinity180%2Faflock-replay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzil-infinity180%2Faflock-replay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzil-infinity180%2Faflock-replay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manzil-infinity180","download_url":"https://codeload.github.com/manzil-infinity180/aflock-replay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manzil-infinity180%2Faflock-replay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34123169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["aflock","agent","claude","claude-code"],"created_at":"2026-06-09T19:30:19.092Z","updated_at":"2026-06-09T19:30:21.054Z","avatar_url":"https://github.com/manzil-infinity180.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aflock replay\n\n\u003e **[Live Demo](https://manzil-infinity180.github.io/aflock-replay/)** — try it in your browser, no install needed\n\nBrowser-based tool to replay Claude Code sessions against [aflock](https://github.com/aflock-ai/aflock) policies. See what would be allowed or denied — action by action.\n\nUses the **real aflock policy evaluator** compiled to WebAssembly. Same Go code that runs in the CLI runs in your browser. 100% client-side — no data leaves your browser.\n\n![aflock replay UI](https://img.shields.io/badge/evaluator-WebAssembly-39d2c0?style=flat-square) ![client-side](https://img.shields.io/badge/privacy-100%25_client--side-3fb950?style=flat-square)\n\n\n\nhttps://github.com/user-attachments/assets/406d5ac5-3099-4529-87ea-85437fb6c187\n\n\n\n## How It Works\n\n1. Drop a Claude Code session (`.jsonl`) and an aflock policy (`.aflock`)\n2. Click **Play** or **Step** to advance through actions\n3. Each tool call is evaluated against the policy\n4. See **ALLOW** / **DENY** / **ASK** decisions with matched rules highlighted\n5. Final report shows verdict, stats, and violations\n\nThe WASM binary contains aflock's actual `internal/policy` and `internal/replay` packages — not a reimplementation. When aflock's evaluator changes, rebuild the WASM and the UI picks it up.\n\n## Quick Start\n\n### Prerequisites\n\n- **Go 1.23+** (to build the WASM module)\n- **Python 3** (to serve static files, or use any HTTP server)\n- **aflock repo** with the `wasm-implementation` branch\n\n### Step 1: Clone both repos\n\n```bash\n# This repo\ngit clone https://github.com/manzil-infinity180/aflock-replay.git\n\n# aflock with WASM support (wasm-implementation branch)\ngit clone -b wasm-implementation https://github.com/aflock-ai/aflock.git\n```\n\n### Step 2: Build the WASM module\n\n```bash\ncd aflock-replay\nAFLOCK_REPO=../aflock make wasm\n```\n\nThis compiles `aflock/cmd/wasm/main.go` to `web/static/replay.wasm` (~34 MB). The WASM binary is gitignored — you build it locally.\n\n### Step 3: Run\n\n```bash\nmake dev\n# → http://localhost:8080\n```\n\nThat's it. Open the browser, drop in files, replay.\n\n### One-command version\n\n```bash\nmake run    # builds WASM + starts server\n```\n\n## Standalone Mode (No WASM, No Build)\n\nIf you don't want to build the WASM, there's a standalone JS version with a client-side policy evaluator (approximate, not the real Go code):\n\n```bash\nmake standalone\n# → http://localhost:8080\n\n# Or just open the file directly:\nopen standalone/index.html\n```\n\n## Project Structure\n\n```\naflock-replay/\n├── web/                           # WASM version (primary)\n│   ├── index.html                 # Landing page + replay UI\n│   ├── docs/                      # Documentation\n│   │   └── index.html\n│   └── static/\n│       ├── app.js                 # Frontend JavaScript\n│       ├── replay.wasm            # Built from aflock (gitignored)\n│       └── wasm_exec.js           # Go WASM runtime\n├── standalone/                    # JS-only fallback\n│   └── index.html                 # Self-contained, no WASM needed\n├── cmd/server/main.go             # Optional Go HTTP server\n├── Makefile\n├── go.mod\n└── README.md\n```\n\n## How the WASM Works\n\nThe WASM binary is built from [`aflock/cmd/wasm/main.go`](https://github.com/aflock-ai/aflock/blob/wasm-implementation/cmd/wasm/main.go) which lives inside the aflock module. This is the only way to access Go's `internal/` packages.\n\nIt registers these JavaScript globals:\n\n| Function | Purpose |\n|----------|---------|\n| `aflockReplay(sessionJSONL, policyJSON)` | Full replay — returns JSON report |\n| `aflockParseSession(sessionJSONL)` | Parse session metadata |\n| `aflockEvaluateAction(tool, input, policy, root)` | Evaluate single action |\n| `aflockVersion()` | Module version |\n\nThe browser loads `wasm_exec.js` (Go's WASM runtime), instantiates `replay.wasm`, and calls these functions. All evaluation happens client-side.\n\n```\nBrowser → wasm_exec.js → replay.wasm → internal/replay.Run() → JSON report\n```\n\n## Rebuilding WASM\n\nWhen aflock's evaluator changes:\n\n```bash\ncd aflock \u0026\u0026 git pull\ncd ../aflock-replay \u0026\u0026 make wasm\n```\n\nThe `.wasm` file is ~34 MB (Go runtime included). With gzip (nginx/Cloudflare), ~8 MB over the wire.\n\n## Evaluation Modes\n\n| Mode | Command | Evaluator | Privacy | Accuracy |\n|------|---------|-----------|---------|----------|\n| **WASM** | `make dev` | Real Go code in browser | 100% client-side | Exact |\n| **Standalone JS** | `make standalone` | JS port | 100% client-side | Approximate |\n| **Go Server** | `make go-server` | Calls `aflock replay` CLI | Server-side | Exact |\n\n## Finding Session Files\n\nClaude Code sessions live at:\n\n```bash\n~/.claude/projects/\u003cproject-slug\u003e/\u003csession-uuid\u003e.jsonl\n\n# List recent sessions:\nls -lt ~/.claude/projects/*/*.jsonl | head -5\n```\n\n## Configuration\n\n```bash\nAFLOCK_REPO=../aflock make wasm     # Custom aflock repo path\nPORT=3000 make dev                  # Custom port\n```\n\n## Demo\n\n[![aflock replay UI demo](https://img.youtube.com/vi/Og6NHoKF3DU/maxresdefault.jpg)](https://www.youtube.com/watch?v=Og6NHoKF3DU)\n\n[Watch the demo on YouTube](https://www.youtube.com/watch?v=Og6NHoKF3DU)\n\n## Inspiration\n\n- [claude-replay](https://es617.dev/claude-replay/) — Interactive HTML replays for Claude Code sessions. The step-by-step playback UI, block-level animation, and keyboard-driven navigation in aflock-replay are inspired by this project. We adapted the concept to overlay policy enforcement decisions on each action.\n\n## Related\n\n- [aflock](https://github.com/aflock-ai/aflock) — Cryptographically signed policies for constrained AI agent execution\n- [aflock-tui](https://github.com/aflock-ai/aflock-tui) — Terminal UI for browsing sessions, attestations, and JWTs\n- [claude-replay](https://es617.dev/claude-replay/) — Interactive HTML replays for Claude Code sessions (inspiration for the turn-based conversation UI)\n- [awesome-agent-runtime-security](https://github.com/bureado/awesome-agent-runtime-security) — aflock is listed here\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanzil-infinity180%2Faflock-replay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanzil-infinity180%2Faflock-replay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanzil-infinity180%2Faflock-replay/lists"}