Repository navigation
feat(cli): add cc pr to link pull requests to a session via the daemon - #318
Conversation
`shelltime cc pr --session-id <id> <url>...` hands pull request URLs to the daemon on a new fire-and-forget socket message, `session_pull_requests`. The daemon POSTs them to /api/v1/cc/session-pull-requests. The ShellTime Claude Code mod runs the command after `gh pr create` prints a PR URL. If no daemon answers on the socket, the CLI sends the URLs itself, so the link isn't lost. Without a token the command does nothing. URLs are trimmed and deduplicated before sending. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DVr1QVVUbfrjJSrsj9Nxc1
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
⏱️
|
| Scenario | base | head | Δ | p | |
|---|---|---|---|---|---|
Startup/floor |
337 µs ±3% | 334 µs ±4% | ~ | 0.579 | A/A |
Startup/version |
2.42 ms ±5% | 2.40 ms ±3% | ~ | 0.481 | ✅ |
Track/daemon/pre |
2.67 ms ±6% | 2.68 ms ±18% | ~ | 0.739 | ✅ |
Track/daemon/post |
2.69 ms ±7% | 2.66 ms ±4% | ~ | 0.631 | ✅ |
Track/direct/pre |
2.59 ms ±4% | 2.59 ms ±3% | ~ | 0.796 | ✅ |
Track/direct/post |
4.72 ms ±8% | 4.80 ms ±5% | ~ | 0.739 | ✅ |
Track/direct/post-sync |
6.00 ms ±14% | 5.84 ms ±6% | ~ | 0.247 | ✅ |
Binary size: 19.1 MiB → 19.1 MiB (+0.1%).
CPU, tail latency and memory
Per exec, base → head (Δ when significant).
| Scenario | p95 wall | user CPU | sys CPU | peak RSS |
|---|---|---|---|---|
Startup/floor |
385 µs → 384 µs | 234 µs → 226 µs | 76 µs → 83 µs | 12.3 MiB → 12.3 MiB |
Startup/version |
2.59 ms → 2.56 ms | 1.06 ms → 1.01 ms | 1.66 ms → 1.66 ms | 18.4 MiB → 18.0 MiB (-2.28%) |
Track/daemon/pre |
2.95 ms → 2.88 ms | 1.18 ms → 1.23 ms | 1.72 ms → 1.78 ms | 19.0 MiB → 18.9 MiB (-0.85%) |
Track/daemon/post |
2.90 ms → 2.87 ms | 1.17 ms → 1.09 ms | 1.76 ms → 1.83 ms | 19.0 MiB → 18.6 MiB (-1.80%) |
Track/direct/pre |
2.78 ms → 2.79 ms | 1.13 ms → 1.13 ms | 1.72 ms → 1.68 ms | 19.1 MiB → 18.7 MiB (-2.33%) |
Track/direct/post |
5.08 ms → 5.15 ms | 3.08 ms → 3.06 ms | 2.31 ms → 2.34 ms | 21.2 MiB → 21.1 MiB (-0.33%) |
Track/direct/post-sync |
6.52 ms → 6.35 ms | 4.27 ms → 4.14 ms | 3.15 ms → 3.13 ms | 23.5 MiB → 23.5 MiB |
benchstat
goos: linux
goarch: amd64
pkg: github.com/malamtime/cli/perf
cpu: AMD EPYC 9V45 96-Core Processor
│ base │ head │
│ sec/op │ sec/op vs base │
Startup/floor-4 336.9µ ± 3% 334.4µ ± 4% ~ (p=0.579 n=10)
Startup/version-4 2.424m ± 5% 2.399m ± 3% ~ (p=0.481 n=10)
Track/daemon/pre-4 2.674m ± 6% 2.684m ± 18% ~ (p=0.739 n=10)
Track/daemon/post-4 2.685m ± 7% 2.655m ± 4% ~ (p=0.631 n=10)
Track/direct/pre-4 2.588m ± 4% 2.593m ± 3% ~ (p=0.796 n=10)
Track/direct/post-4 4.725m ± 8% 4.804m ± 5% ~ (p=0.739 n=10)
Track/direct/post-sync-4 6.000m ± 14% 5.840m ± 6% ~ (p=0.247 n=10)
geomean 2.378m 2.367m -0.49%
│ base │ head │
│ p50-sec/op │ p50-sec/op vs base │
Startup/floor-4 328.5µ ± 3% 326.3µ ± 4% ~ (p=0.796 n=10)
Startup/version-4 2.417m ± 4% 2.382m ± 3% ~ (p=0.280 n=10)
Track/daemon/pre-4 2.653m ± 4% 2.638m ± 3% ~ (p=0.796 n=10)
Track/daemon/post-4 2.620m ± 5% 2.628m ± 2% ~ (p=0.853 n=10)
Track/direct/pre-4 2.563m ± 2% 2.569m ± 3% ~ (p=0.796 n=10)
Track/direct/post-4 4.702m ± 7% 4.692m ± 8% ~ (p=0.739 n=10)
Track/direct/post-sync-4 5.988m ± 5% 5.819m ± 4% ~ (p=0.105 n=10)
geomean 2.352m 2.335m -0.75%
│ base │ head │
│ p95-sec/op │ p95-sec/op vs base │
Startup/floor-4 385.1µ ± 5% 384.4µ ± 5% ~ (p=0.971 n=10)
Startup/version-4 2.586m ± 8% 2.561m ± 6% ~ (p=0.393 n=10)
Track/daemon/pre-4 2.953m ± 7% 2.879m ± 155% ~ (p=1.000 n=10)
Track/daemon/post-4 2.902m ± 8% 2.865m ± 6% ~ (p=0.481 n=10)
Track/direct/pre-4 2.785m ± 7% 2.793m ± 3% ~ (p=1.000 n=10)
Track/direct/post-4 5.084m ± 9% 5.145m ± 9% ~ (p=0.796 n=10)
Track/direct/post-sync-4 6.518m ± 17% 6.347m ± 7% ~ (p=0.579 n=10)
geomean 2.593m 2.570m -0.87%
│ base │ head │
│ peak-rss-B │ peak-rss-B vs base │
Startup/floor-4 12.34Mi ± 1% 12.32Mi ± 1% ~ (p=0.912 n=10)
Startup/version-4 18.38Mi ± 0% 17.97Mi ± 1% -2.28% (p=0.000 n=10)
Track/daemon/pre-4 19.01Mi ± 1% 18.85Mi ± 1% -0.85% (p=0.009 n=10)
Track/daemon/post-4 18.95Mi ± 1% 18.61Mi ± 1% -1.80% (p=0.000 n=10)
Track/direct/pre-4 19.14Mi ± 1% 18.69Mi ± 1% -2.33% (p=0.000 n=10)
Track/direct/post-4 21.17Mi ± 0% 21.11Mi ± 1% -0.33% (p=0.043 n=10)
Track/direct/post-sync-4 23.46Mi ± 0% 23.55Mi ± 1% ~ (p=0.063 n=10)
geomean 18.63Mi 18.43Mi -1.06%
│ base │ head │
│ sys-sec/op │ sys-sec/op vs base │
Startup/floor-4 76.41µ ± 21% 82.62µ ± 9% ~ (p=0.247 n=10)
Startup/version-4 1.661m ± 10% 1.656m ± 8% ~ (p=0.739 n=10)
Track/daemon/pre-4 1.718m ± 10% 1.782m ± 27% ~ (p=0.796 n=10)
Track/daemon/post-4 1.757m ± 9% 1.831m ± 9% ~ (p=0.481 n=10)
Track/direct/pre-4 1.721m ± 8% 1.677m ± 11% ~ (p=0.579 n=10)
Track/direct/post-4 2.308m ± 7% 2.342m ± 10% ~ (p=0.393 n=10)
Track/direct/post-sync-4 3.155m ± 13% 3.130m ± 13% ~ (p=0.739 n=10)
geomean 1.251m 1.275m +1.93%
│ base │ head │
│ user-sec/op │ user-sec/op vs base │
Startup/floor-4 233.6µ ± 3% 226.1µ ± 5% ~ (p=0.218 n=10)
Startup/version-4 1.061m ± 11% 1.007m ± 10% ~ (p=0.529 n=10)
Track/daemon/pre-4 1.184m ± 7% 1.226m ± 6% ~ (p=0.353 n=10)
Track/daemon/post-4 1.169m ± 7% 1.087m ± 14% ~ (p=0.165 n=10)
Track/direct/pre-4 1.125m ± 6% 1.130m ± 12% ~ (p=0.393 n=10)
Track/direct/post-4 3.084m ± 9% 3.058m ± 6% ~ (p=0.853 n=10)
Track/direct/post-sync-4 4.268m ± 8% 4.139m ± 7% ~ (p=0.353 n=10)
geomean 1.261m 1.233m -2.24%
Δ compares medians; ~ means no significant difference (Mann-Whitney U, p ≥ 0.05). A scenario is flagged when it is more than 10% and more than 250µs slower with p < 0.05. Startup/floor runs true, not shelltime: it is an A/A check of runner noise. Runner: linux/amd64, AMD EPYC 9V45 96-Core Processor . go1.27.1, 10 rounds × 100 execs per scenario and binary.
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Summary
shelltime cc pr --session-id <id> <url>...links pull request URLs to a Claude Code session. The ShellTime Claude Code mod runs it from aPostToolUsehook aftergh pr createprints a PR URL.commands/cc_pr.go:session_pull_requestswith payload{sessionId, urls}. It is fire-and-forget likesession_project; the daemon POSTs in a goroutine and logs failures.daemon.SendSessionPullRequestsreturns the dial or encode error so the CLI can fall back.model.SendSessionPullRequestsposts to/api/v1/cc/session-pull-requestswith a 5s timeout.Depends on https://github.com/shelltime/server/pull/514 (the endpoint). The mod side is in shelltime/claude-code-mods.
Test plan
daemon/socket_extra_test.go: the handler POSTs path, auth and body to anhttptestserver, and ignores an empty session id or URL list.daemon/client_socket_cov_test.go: the client delivers the message, and returns an error when the dial fails.daemon/socket_test.go: constant value.model/api_senders_test.go: path,CLI <token>, body, and the server error message.commands/cc_pr_test.go:go vetand the fullgo test -timeout 5m ./...pass (with mockery v3.7.4 mocks generated).🤖 Generated with Claude Code
https://claude.ai/code/session_01DVr1QVVUbfrjJSrsj9Nxc1
Generated by Claude Code