--skip-tool-outputflag -- show tool calls and their arguments ([TOOL]) but suppress tool result output ([RESULT]). Works across all render paths: view, view full, watch, and--lastmode. Useful for reading agent decision flow without the noise of large tool outputs.- Modular source layout -- decomposed the monolithic script into 12 source modules in
cli/, assembled bybuild.shintobin/agent-watch. No behavioral changes; same functionality, now easier to navigate and maintain. - 8 new tests -- unit, integration, and e2e coverage for
--skip-tool-outputacross view, view full, and last-message modes.
- Enqueue initiator extraction -- queue-operation enqueue entries now show a concise initiator instead of raw XML content. Task notifications display the summary (e.g.
Agent "Code review" completed), teammate messages show the sender and summary (e.g.bootstrap: build finished), FileChanged hooks display asFileChanged, and plain-text queued input shows the first 80 characters.
- FileChanged hook visibility --
queue-operationenqueue entries (used by Claude Code for FileChanged hooks) now render as[HOOK] enqueue: ...showing the injected content. Dequeue entries are skipped to reduce noise.
- Data-driven rendering -- system and progress entries are rendered based on their data fields, not hardcoded subtypes. Any system entry with
hookInfosshows each hook command and duration as[HOOK]. Other system entries render as[SYSTEM]with subtype and content. All progress entries render as[HOOK]with available metadata. Future Claude Code entry types will render automatically.
- Compaction support -- sessions that hit context limits now render correctly past compaction boundaries.
[COMPACT]markers show when compaction occurred (auto/manual) and how many tokens were involved. Compaction summaries display as[SUMMARY]instead of[USER]so they're visually distinct from real user messages. Both full compaction (compact_boundary) and in-place microcompaction (microcompact_boundary) are supported. - Hook visibility -- hook executions are now rendered as
[HOOK]entries showing the hook event, name, and script (e.g.SessionStart:startup → session-start.sh). Stop hook summaries show how many hooks ran and whether any errored. Syntheticcallbackentries are filtered out to reduce noise. - New color tags --
[COMPACT](bold cyan),[HOOK](dim yellow),[SUMMARY](dim cyan) across all render paths: view, view full, watch, and fzf previews. - 28 new tests -- unit, integration, and e2e coverage for compaction boundaries, microcompaction, hook progress, stop hook summaries, callback filtering, and error flags.
- Remove all content truncation -- tool inputs, tool results, assistant text, and user text are no longer truncated in any render path (view, fzf preview). Previously tool inputs were cut at 200 chars, results at 100, and text at 300, which caused downstream consumers to miss Edit/Write content.
- Bash 4+ auto-detection -- on macOS where
/bin/bashis 3.2, agent-watch now detects the outdated version at startup and re-execs itself under Homebrew bash (/opt/homebrew/bin/bashor/usr/local/bin/bash). If no suitable bash is found, it exits with a clear error and install instructions.
NO_COLORsupport -- respects the NO_COLOR environment variable and adds a--no-colorflag to disable ANSI color output. When calling agent-watch from agents, this avoids wasting tokens on escape codes. Colors are stripped from all output: metadata headers, role markers ([USER],[ASST],[TOOL],[RESULT]), list/session views, and helper messages.- Docker test environment -- added
Dockerfileandmake docker-test/make docker-coveragetargets for running the full test suite and coverage analysis in Docker without installing dependencies locally. - Refactored color pipeline -- deduplicated three copy-pasted sed pipelines into shared
_color_sed/_color_sed_uhelpers, reducing code and ensuring consistent behavior acrossview,view full, andwatchmodes.
- Fix
--last Nreversing multi-line content -- the--last Ntoken-budget mode reversed all lines within messages because it used_tacon the rendered output. Multi-line assistant responses (tables, formatted text) appeared with lines in reverse order. Fixed by reading the file forward and using awk to collect message blocks, dropping oldest blocks until within the token budget.
- Fix
--lastreturning empty output --viewandview fullboth called an undefined__tacfunction in the--lastsingle-message branch, silently producing no output. Fixed to use the correct_tachelper. - Test coverage expansion -- 110 tests (up from 79), adding coverage for
agent_pid_alive,view_agent_full, interactive fzf modes (via mock fzf), tool rendering, active markers, and additional CLI flags. New test files:test_agent_pid_alive,test_view_full,test_interactive. - Coverage tool accuracy --
coverage.shnow uses a state machine to exclude heredoc bodies, jq/awk program strings, and preview scripts from the executable-line count. Reported coverage reflects actual bash code (72%, up from 42% with inflated denominator). - Coverage badge --
coverage.shgenerates a shields.io-style SVG badge (coverage-badge.svg) with percentage and short SHA, displayed in the README.
--last Ntoken budget ----lastnow accepts an optional token count (e.g.--last 5000) to show the last N tokens of a conversation. Messages are selected from the end and displayed in chronological order.--lastwithout a number still shows the single last message.- Fix project name display -- project names with dashes (e.g.
ai-voice) were incorrectly split intoai/voice. Project names now display as raw directory names with the home prefix stripped, matching Claude CLI conventions. - Test suite -- 79 tests across lint, unit, integration, and e2e suites using bats-core. CI runs on both Ubuntu and macOS to cover GNU/BSD differences.
--lastflag -- show only the last message from a session or agent log, with no header or pager. Works withview,session, and auto-detect ID commands.- Stop truncating project names -- project names were hard-truncated to 30-40 chars in
list-sessions,sessions, and agent fzf views, making long project paths unsearchable and indistinguishable. Removed all truncation so full project names display and match correctly.
- Fix project filter on long paths --
list-sessions -pfiltered against the 30-char display-truncated project name, so long project paths were unsearchable. Filter now runs before truncation.
- Fix interactive modes crashing --
sessionsand interactive agent selection (agent-watchwith no args) silently exited when any session/agent file had incomplete JSON (e.g. active sessions). Replaced upfront preview generation with lazy on-demand previews via fzf--preview, fixing both the crash and making fzf appear instantly regardless of file count. viewandwatchnow work with sessions -- previously only resolved sub-agent IDs. Now auto-detects agent or session ID, and no-arg defaults fall back to most recent session if no agents exist.list -pproject filter --listcommand now supports-p/--projectfor filtering agents by project name, matchinglist-sessions.
- Fix self-update crash --
updatecommand was overwriting the running script mid-execution, causing bash to read corrupted content and error out. Now downloads to a temp file and atomically replaces viamv.
- Configurable stale timeout --
AGENT_WATCH_STALE_TIMEOUTenv var to configure the JSONL staleness threshold forwaitfallback (default: 300s) - Architecture diagram -- excalidraw flowchart in README replacing mermaid
- Core Features section -- README restructured with dedicated feature descriptions
- Wiki -- Token Log & PID Tracking setup guide documenting hooks, settings.json config, and agent PIDs
- Documentation -- clarified PID hook is required for robust
waitbehavior; split examples into interactive/non-interactive
- Rich metadata in fzf previews -- interactive session and agent selection now shows full metadata header (model, version, tokens, timestamps) in the preview panel
- Self-update --
agent-watch updatedownloads the latest release in place - Version check --
agent-watch version/-v/--versionshows current version and checks for updates - CLAUDE.md -- copy-paste reference to teach your Claude Code agents how to use agent-watch
- README improvements -- curl-based install from GitHub releases, detailed
waitcommand documentation, contributing guide - Wiki -- Token Log & PID Tracking setup guide for faster
waitdetection via Claude Code hooks
Initial release.
- Session and agent browsing -- view, search, and paginate through Claude Code session history and sub-agent transcripts
- Rich metadata headers -- all views display model, version, branch, project, timestamps, message count, and token usage breakdown (input/output/cache)
- Interactive mode -- fzf-based selection with preview panels showing metadata and first exchanges for both sessions and agents
- Non-interactive commands --
list,list-sessions,view,session,wait, and auto-detect by ID -- safe for use by Claude Code agents - Live tailing --
watchcommand streams agent output in real-time with colorized role markers - Pagination --
--limit(token budget) and--offsetfor navigating large sessions without loading everything into memory - Session filtering --
list-sessions -p <name>filters by project name (case-insensitive partial match) - Wait for agents --
waitcommand blocks until one or more sub-agents complete, using PID files and JSONL staleness as completion signals - Cross-platform support -- BSD/GNU stat and date detection, portable shebang, dynamic home directory path handling
- Dependency checking -- startup check for jq, interactive-mode check for fzf