hoangsonww / hoangsonww/Claude-Code-Agent-Monitor

[Feature]: Session → Git Commit Correlation (using `git log`)

Open
#291 0 comments 0 reactions 1 assignee Claimed by @hoangsonww View on GitHub
bug documentation enhancement good first issue help wanted question
Dominant language
TypeScript
Stars
1k
Forks
234
Avg merge
2d 9h
Merged PRs (30d)
18

Description

## Problem
The dashboard tracks everything an agent *did* (tool calls, tokens, cost) but has no link to what the agent actually *produced*. To see the resulting code, users have to leave the dashboard and manually check `git log` in the session's `cwd` around the session's time window — there's no way to answer "what code came out of this session" from inside CCAM.

## Proposal
Add a **Commits** panel to Session Detail that correlates a session with the git commits made in its `cwd` during the session's lifetime.

## Scope
- On session load, resolve the session's `cwd` to a local git repo (if any) and list commits with `author-date` falling within `[session.started_at, session.ended_at ?? now]`
- Per-commit: hash, message, author, changed-file count, +/- stat line; link out to the commit if a recognized remote (GitHub/GitLab) is configured
- Optional diff preview (collapsed by default) via `git show --stat` / `git show ` for a selected commit
- Badge on the Sessions table / Kanban card showing commit count for sessions with correlated commits
- Gracefully no-op (hide the panel) when `cwd` isn't a git repo, git isn't installed, or the repo has no commits in range

## Technical Notes
- Server-side only: shell out to `git log`/`git show` scoped to the session's `cwd`, no new persisted commit data (always computed fresh, so it can't drift from the real repo state)
- Cache per-session results briefly (e.g. in-memory TTL) since `git log` on large repos isn't free
- Time-window correlation is best-effort by author-date; note this explicitly in the UI so users don't over-trust attribution when a human also committed during the session

## Acceptance Criteria
- [ ] Session Detail shows commits authored in the session's `cwd` during its active window
- [ ] Commit list works for sessions on any machine where the dashboard has read access to the repo
- [ ] Feature degrades silently (no panel, no error) when there's no git repo or no matching commits
- [ ] No new required dependency beyond a local `git` binary already on PATH
- [ ] Documented in `docs/` with the correlation heuristic spelled out

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.