ACE - B36TS

Compact, sortable Base36 timestamp IDs for scripts, logs, and path-friendly artifacts. ACE Logo

Gem Version Ruby License: MIT

Works with: Claude Code, Codex CLI, OpenCode, Gemini CLI, pi-agent, and more.

Getting Started | Usage Guide | Handbook - Skills, Agents, Templates

ace-b36ts demo

ace-b36ts encodes UTC timestamps into short Base36 IDs that preserve chronological order in plain string sorting, and decodes them back when you need readable time output. Seven encode formats range from month granularity down to ms, with a configurable year_zero epoch baseline.

How It Works

  1. Encode a timestamp (or now) into a compact Base36 ID -- from 2 characters at month granularity up to 8 at millisecond precision.
  2. Use the ID directly in file names, directory paths (with --split), log entries, or automation artifacts.
  3. Decode the ID back into a human-readable UTC timestamp for debugging, audits, or incident review.

All examples below encode 2026-03-23 12:00:00 UTC:

Format Chars Precision Example
month 2 month 8q
week 3 ISO week 8qy
day 3 day 8qm
40min 4 40 min 8qmi
2sec 6 ~1.85 s 8qmi00
50ms 7 ~50 ms 8qmi000
ms 8 ~1.4 ms 8qmi0000

day and week both produce 3-character IDs. The 3rd character distinguishes them: values 0--30 in base36 encode days 1--31, while values 31--35 encode ISO weeks (Thursday determines which week a date belongs to).

Use Cases

Create sortable IDs for automation output - generate compact IDs for build artifacts, log entries, and task files without long timestamp strings. Use ace-b36ts encode now for quick generation or /as-b36ts in agent workflows.

Map IDs to directory paths - use split output (--split) to create hierarchical paths for storage and archival workflows across ace-assign and ace-task pipelines.

Round-trip between compact IDs and timestamps - decode IDs during debugging, audits, and incident review flows with ace-b36ts decode.

Embed in shell and CI pipelines - use deterministic, timestamp-derived IDs in scripts and Ruby automation through the Ace::B36ts API for encode/decode helpers.


Getting Started | Usage Guide | Handbook - Skills, Agents, Templates | Part of ACE