{"slug": "show-hn-agenttm-a-time-travel-debugger-for-ai-coding-agents-built-in-go", "title": "Show HN: AgentTM – A time-travel debugger for AI coding agents built in Go", "summary": "A developer released AgentTM 0.1.0, a local Go CLI that records noninteractive Codex runs in SQLite with baseline and final workspace checkpoints and historical file inspection, implementing Milestones 0–5 of the project's MVP specification. The tool ships an embedded React/TypeScript UI at http://127.0.0.1:7331 that shows stored sessions, timelines, parent diffs and isolated worktree forks under .agenttm/worktrees/, leaving the original working tree, index and HEAD unchanged. The author reports real Windows end-to-end coding, tests, intermediate capture, CLI/UI restoration, failure and Ctrl+C cancellation passed, automated tests and five browser tests pass, and all six OS/architecture release targets build, while remote CI and native Linux/macOS execution are configured but not claimed as observed; recording requires Git 2.42+ and an authenticated Codex CLI.", "body_md": "A local Go CLI that records **real, AgentTM-managed noninteractive Codex runs**\nin SQLite, with baseline/final workspace checkpoints and historical file inspection.\nThe embedded React/TypeScript UI displays real stored sessions, timelines,\nhistorical files, parent diffs and isolated worktree forks. This implements Milestones 0–5 in\n[the MVP specification](https://github.com/Jyotishmoy12/AgentTM/blob/main/AGENT_TIME_MACHINE_MVP.md).\n\n**Validation status:** real Windows end-to-end coding, tests, intermediate capture,\nCLI/UI restoration, failure and Ctrl+C cancellation passed. Automated tests,\nselected race checks and five browser tests pass. All six OS/architecture release\ntargets build; Windows installation was tested. Remote CI and native Linux/macOS\nexecution are configured but not claimed as observed here. See [release evidence](https://github.com/Jyotishmoy12/AgentTM/blob/main/docs/release-checklist.md),\n[Codex compatibility](https://github.com/Jyotishmoy12/AgentTM/blob/main/docs/codex-compatibility.md), [snapshots](https://github.com/Jyotishmoy12/AgentTM/blob/main/docs/snapshots.md),\n[UI/API](https://github.com/Jyotishmoy12/AgentTM/blob/main/docs/ui.md), and [fork safety/recovery](https://github.com/Jyotishmoy12/AgentTM/blob/main/docs/fork-and-recovery.md).\n\nLocal archives are generated under `dist/0.1.0/`. Select the archive for your OS\nand architecture, verify it against the matching `SHA256SUMS`, and extract the\nsingle executable. Git 2.42+ and an authenticated Codex CLI are required for\nrecording. Go and Node are not needed to run the release executable.\n\nThe local installers verify archive checksums before installing; they do not download anything. Windows example:\n\n```\n.\\scripts\\install.ps1 -Archive .\\dist\\0.1.0\\agenttm_0.1.0_windows_amd64.zip -AddToPath\n```\n\nPATH changes require `-AddToPath`; upgrades require `-Force`. If script execution\nis disabled, extract the ZIP and invoke `agenttm.exe` directly. On Unix use\n`sh scripts/install.sh archive.tar.gz [install-directory]`.\n\nFrom your initialized Git repository:\n\n``` php\n$agenttm = 'C:\\dev\\AgentTM\\bin\\agenttm.exe'\n& $agenttm ui\n```\n\nAgentTM opens `http://127.0.0.1:7331` in your browser. Keep the terminal running;\nCtrl+C stops the server. If the port is occupied, use `& $agenttm ui --port 7332`.\nUse `--no-browser` to print the URL without opening it. No Node installation is\nneeded to run the prebuilt executable; all production assets are embedded.\n\nSelect a session, then a timeline event or checkpoint. **Files** shows the\nhistorical tree and read-only Monaco viewer. **Compare with parent** shows changed\npaths and unified patches. Activity shows sanitized event input/output and the\nobserved checkpoint. An event without a checkpoint displays the last known\nworkspace with an explicit label; events preceding the baseline show no state.\n**Fork checkpoint** shows the exact destination, branch and partial-snapshot\nwarnings before confirmation. Restored files live under `.agenttm/worktrees/`;\nthe original working tree, index and HEAD stay unchanged. No restored code runs.\n\nRequires Go 1.25+, Git and an installed/authenticated Codex CLI. SQLite is bundled through a pure Go driver; no SQLite install or C compiler is required.\n\n```\ncd C:\\dev\\AgentTM\ngo test ./...\ngo vet ./...\ngo build -o .\\bin\\agenttm.exe .\\cmd\\agenttm\n.\\bin\\agenttm.exe version\n.\\bin\\agenttm.exe codex doctor\n```\n\nOn macOS/Linux: `go build -o bin/agenttm ./cmd/agenttm`.\n\nThe checked-in assets under `internal/server/ui` allow Go-only builds. After\nchanging frontend source, rebuild the embedded assets first (Node 24+):\n\n```\nSet-Location C:\\dev\\AgentTM\\web\nnpm.cmd ci\nnpm.cmd test\nnpm.cmd run build\nSet-Location ..\ngo build -o .\\bin\\agenttm.exe .\\cmd\\agenttm\n```\n\nThe source folder need not be a Git repository to build the executable.\nThe repository you record **must** be a Git working tree. No commit is required.\n\n``` php\n$agenttm = 'C:\\dev\\AgentTM\\bin\\agenttm.exe'\n$demo = Join-Path $env:TEMP ('agenttm-demo-' + [guid]::NewGuid())\nNew-Item -ItemType Directory $demo | Out-Null\nSet-Location $demo\ngit init\n& $agenttm init\n& $agenttm doctor\nSet-Content -LiteralPath snapshot-demo.txt -Value 'Original content'\n& $agenttm run codex --model gpt-6.1-sol -- \"Reply with a short greeting. Do not change files.\"\n& $agenttm sessions\n# Copy the session UUID shown above:\n& $agenttm events '<session-id>'\n& $agenttm events '<session-id>' --after 10 --limit 50\n& $agenttm checkpoints '<session-id>'\n# Copy the baseline checkpoint UUID shown above:\n& $agenttm cat '<baseline-id>' snapshot-demo.txt\n\n# Explicitly observe a manual change, without another model request:\nSet-Content -LiteralPath snapshot-demo.txt -Value 'Changed content'\n& $agenttm checkpoint '<session-id>'\n# Copy the new checkpoint UUID:\n& $agenttm diff '<new-checkpoint-id>'\n& $agenttm cat '<baseline-id>' snapshot-demo.txt   # still Original content\n& $agenttm cat '<new-checkpoint-id>' snapshot-demo.txt\n& $agenttm show '<new-checkpoint-id>'\n& $agenttm fork '<new-checkpoint-id>' --name alternative\n& $agenttm forks\n```\n\nIf your configured model is unavailable, explicitly choose one available to your Codex account (this does not change global settings):\n\n```\n& $agenttm run codex --model '<available-model>' -- \"Reply with a short greeting.\"\n```\n\nThen try a real coding task in that disposable repo. Codex's existing permissions, sandbox, rules, hooks and authentication apply. AgentTM does not grant write access or bypass approval policy. Tasks may fail or be refused under those policies. Ctrl+C cancels the child process tree and attempts to persist cancellation status. The default honors Codex's existing sandbox/approval configuration. To explicitly allow a coding task to write inside a disposable repository:\n\n```\n& $agenttm run codex --model gpt-6.1-sol --sandbox workspace-write --snapshot-after-tool=true -- \"Implement a small function and test it.\"\n```\n\n`read-only` is the other supported explicit sandbox override. No unsafe bypass\nflags are passed. New configs enable best-effort scans near supported completed\ncommand/file-change items; older config values are preserved. Use the flag above\nor `capture.snapshot_after_tool` to enable them. They do not pause Codex or prove\nper-tool causality.\nThe final workspace scan uses a separate two-minute cleanup context, including\nafter cancellation or Codex failure. No change means the existing checkpoint is\nreused; the final observation event still links to it. Older Phase 1 sessions\nhave no historical files. `checkpoint` observes the workspace **now**, even when\nlinked to an older session; it does not reconstruct its past.\n\nUse `& $agenttm` in PowerShell; assigning a path to a variable does not install a\nbare `agenttm` command. `codex --version` must also work in that terminal. If\nCodex is only bundled with VS Code, add its executable directory to that terminal's\n`$env:PATH`, or install the standalone CLI.\n\n| Command | Behavior | \n|---|---|\n| `init` | Idempotent config, directories, SQLite migrations and local Git exclusion | \n| `version` | Version and build commit | \n| `codex doctor` | Version, JSON capability and observable login readiness | \n| `doctor` | Repository/config/database checks and Codex readiness | \n| `run codex [--model MODEL] -- \"task\"` | Supervise real Codex and persist sanitized JSONL observations | \n| `sessions` | List sessions, UTC timestamps, status and exit code | \n| `events <id> [--after N] [--limit N]` | JSONL events ordered by per-session sequence; default 100, maximum 1000 | \n| `checkpoints <session-id>` | Checkpoint IDs, kind, time, files and partial flags | \n| `checkpoint <session-id>` | Manually observe the current workspace; reuse unchanged state | \n| `show <checkpoint-id>` | Versioned manifest, file tree, hashes, modes and omissions as JSON | \n| `cat <checkpoint-id> <path>` | Verified historical UTF-8 text, maximum 1 MiB output | \n| `diff <checkpoint-id>` | JSON changes and bounded unified patches against parent (empty tree for baseline) | \n| `fork <checkpoint-id> --name NAME [--allow-partial]` | Restore and verify a new isolated worktree | \n| `forks` | List ready, restoring or failed fork records | \n| `purge --session ID [--yes]` | Confirm logical deletion of an ended, unforked session; retain shared blobs | \n| `ui [--port N] [--no-browser]` | Serve embedded read-only history on loopback and open your browser | \n\nUnknown commands return exit code 2; operational failures return 1. Normal child failure codes are forwarded; cancellation returns 130. Recording/protocol failure returns nonzero even if the child exits zero. JSONL goes to stdout, recording status to stderr. No executable or fixture simulates Codex during ordinary CLI usage.\n\n`init` resolves the canonical Git root even from nested directories. It creates\n`.agenttm/config.json`, `data/events.db`, `objects/`, and `logs/`. The SQLite store\nuses transactions, foreign keys, WAL and a busy timeout. Snapshots use SHA-256\nobjects and versioned JSON manifests under `.agenttm/manifests/`; SQLite indexes\nthe manifest checksum and checkpoint/event links. Logs contain only a session\noutcome summary. Schema 1 databases migrate automatically without losing events.\n\nOnly `.git/info/exclude` is updated, with `/.agenttm/`. Tracked `.gitignore`, the\nindex and HEAD are untouched. Existing local storage symlinks are rejected.\nRestrictive modes are requested on POSIX; Windows ACLs are inherited. Other users\nwith filesystem access can read the local recording data.\n\nPrompt capture defaults to `metadata_only`. The complete task text is removed if\nechoed in event strings; fragments/paraphrases may still appear in outputs. To opt\ninto sanitized prompt storage set `capture.prompt_mode` to `sanitized` in config.\nPrompts use stdin rather than OS process arguments. Raw events are not persisted.\nKnown credential patterns are redacted before storage; this is best-effort and\ncannot identify every secret. Review recordings before sharing them.\nFile objects preserve exact bytes and are **not content-redacted**. Snapshot\nprivacy depends on filename/directory exclusions; credentials embedded in source\ncode can still be captured. Inspect `show` for exclusions and partial flags.\n\nEvent storage uses an allowlist of observable fields. Reasoning item text and\nunknown event bodies are omitted. Payloads are bounded by\n`capture.max_event_payload_bytes` (default 64 KiB), with explicit truncation flags.\nMalformed/oversized JSONL lines produce omission records; parsing resumes at the\nnext line. Raw stderr is drained to a discard sink for privacy, so startup failures\nthat appear only on stderr require a direct Codex diagnostic run. No AgentTM\ntelemetry or uploads are implemented; Codex itself uses its configured service.\n\n- Only runs launched through `agenttm run codex` are captured. Existing interactive\nsessions are not observed.\n- Baseline/final/manual scans and optional completed-tool observations capture scan-time state; continuous or deterministic per-tool history is not claimed. Failed restore directories are retained for diagnosis.\n- Events are observations, not a complete tool trace or proof of file authorship. Separate receipts get separate UUIDs/sequences; no payload-hash deduplication.\n- Graceful Ctrl+C is handled. Forced AgentTM termination or machine failure can\nleave a session `active` ;`doctor` reports active sessions without assuming that\na separate recorder has died. No crash-recovery rewrite is attempted.\n- `doctor` checks SQLite, manifests, object hashes and observation links. Interrupted\nwrites can leave unreferenced files or a stale snapshot lock; these are reported\nwithout automatic deletion. See the snapshot recovery guide.\n- Automated tests use synthetic subprocesses explicitly labeled as test fixtures. Actual Codex schema/failure evidence and remaining acceptance checks are in the compatibility document. CI is configured for Windows, Linux and macOS; remote CI execution has not been observed here.\n\n```\ngo run ./cmd/release --version 0.1.0 --out dist/0.1.0\n```\n\nRebuild the frontend first after UI source edits. The packager creates Windows,\nLinux and macOS archives for amd64/arm64 plus `SHA256SUMS`, notices and restore\nguidance. Existing outputs are refused; use a new output directory for a new build.\nCI runs native tests across all three OSes and browser tests on Linux. Version\ntags/manual release workflows produce downloadable artifacts; they do not publish\na public GitHub release automatically.\n\nDeferred beyond v0.1: interactive Codex capture, additional agents, automatic continuation, cloud sync, encrypted backup, and blob garbage collection.", "url": "https://wpnews.pro/news/show-hn-agenttm-a-time-travel-debugger-for-ai-coding-agents-built-in-go", "canonical_source": "https://github.com/Jyotishmoy12/AgentTM", "published_at": "2026-11-02 08:54:58+00:00", "updated_at": "2026-11-02 09:22:28.350592+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["AgentTM", "Codex", "Go", "SQLite", "React", "TypeScript", "Monaco", "Git"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/show-hn-agenttm-a-time-travel-debugger-for-ai-coding-agents-built-in-go", "markdown": "https://wpnews.pro/news/show-hn-agenttm-a-time-travel-debugger-for-ai-coding-agents-built-in-go.md", "text": "https://wpnews.pro/news/show-hn-agenttm-a-time-travel-debugger-for-ai-coding-agents-built-in-go.txt", "jsonld": "https://wpnews.pro/news/show-hn-agenttm-a-time-travel-debugger-for-ai-coding-agents-built-in-go.jsonld"}}