You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-5Lines changed: 22 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,9 +10,12 @@ Mobile-first session manager for [Claude Code](https://claude.com/claude-code) r
10
10
-**Crash-safe state.** Atomic writes, flock-based locking, corruption recovery on `sessions.json`.
11
11
-**Resume with fallback.**`claude --resume UUID || claude --session-id UUID` — recovers from missing session data.
12
12
-**Claude overlay.** Drop a `claude-overlay.json` to apply ctm-only settings (statusline, theme, etc.) without touching your global `~/.claude/settings.json`.
13
+
-**ctm-only shell env.**`~/.config/ctm/env.sh` is sourced before claude spawns — set env vars like `CLAUDE_CODE_NO_FLICKER=1` that claude reads during startup (too early for settings.json's `env` key).
14
+
-**Tool-use logging.** Built-in PostToolUse hook (pure Go, no jq/bash deps) writes one JSONL entry per tool call to `~/.config/ctm/logs/<session>.jsonl`. View with `ctm logs`.
13
15
-**YOLO mode.** Auto-commits a git checkpoint before bypassing permissions, so you can always roll back.
14
16
-**Preflight health checks.** Env vars, PATH, workdir, tmux session, claude process — cached for 60s to keep mobile reconnects snappy.
15
17
-**OSC52 clipboard sync.** Copy in tmux, paste anywhere.
18
+
-**Zero non-tmux runtime dependencies.** Pure Go throughout — native UUID, `/proc` walk, `filepath.WalkDir`. No `jq`, `pgrep`, `grep`, or `uuidgen` required.
16
19
17
20
## Installation
18
21
@@ -88,12 +91,23 @@ This generates `~/.config/ctm/config.json` and `~/.config/ctm/tmux.conf` and set
88
91
89
92
| Command | Description |
90
93
|---|---|
91
-
|`ctm overlay`| Show overlay status (active / missing). |
|`ctm overlay edit`| Open the overlay in `$EDITOR` (creates sidecars if missing). |
94
97
|`ctm overlay path`| Print the overlay file path. |
95
98
96
-
When the overlay file exists, ctm-spawned claude invocations get `--settings <path>` automatically. Direct `claude` invocations outside ctm are untouched.
99
+
When the overlay file exists, ctm-spawned claude invocations get `--settings <path>` automatically, and `env.sh` is sourced by the shell before claude starts. Direct `claude` invocations outside ctm are untouched.
100
+
101
+
### Logs
102
+
103
+
| Command | Description |
104
+
|---|---|
105
+
|`ctm logs`| List sessions with tool-use logs, sorted by most recent. |
106
+
|`ctm logs <session-id>`| Dump a session's formatted tool-use log. |
107
+
|`ctm logs <session-id> -f`| Tail the log in real time. Handles rotation and truncation. |
108
+
|`ctm logs <session-id> --raw`| Print raw JSONL lines (pipe to `jq` for scripting). |
109
+
110
+
Logs are populated by a PostToolUse hook registered in the overlay. Each entry contains the full Claude Code hook payload plus a UTC timestamp. File perms 0600, session-id sanitized to prevent path traversal, concurrent writes coordinated via advisory flock.
97
111
98
112
## Keybindings
99
113
@@ -125,7 +139,10 @@ Claude Code's TUI uses alt-screen and has no built-in scroll history. The app-in
125
139
-`~/.config/ctm/config.json` — main config (scrollback lines, required env vars, default mode, health check timeout, yolo checkpoint toggle)
126
140
-`~/.config/ctm/sessions.json` — session state (atomically written, flock-locked)
0 commit comments