Every PR, priced: AI session costs on your pull requests
The ShellTime GitHub App comments on pull requests your Claude Code or Codex sessions open: their cost, tokens, time, models and an AI summary.
Coding agents open a lot of pull requests now. The diff shows what changed, but not what it took to get there: how long the agent ran, which models it used, and what the session would have cost.
ShellTime now puts that right next to the code. When a Claude Code or Codex session on your machine opens a pull request, the ShellTime GitHub App comments on it with the session's cost, tokens, time and models, plus an AI summary of what happened, and keeps the numbers up to date. It's free, and once the app is installed there's nothing to do per pull request.
What you'll see on the pull request
A couple of minutes after your agent opens the pull request, shelltime[bot] comments on it. This is the real comment from one of our own pull requests:
feat(mcp): add ai_query_history tool for shelltime q history #527
main from feat/mcp-ai-query-historyπ€ Claude Code Β· Add Recent AI Query History to User Settings
Updated the MCP server and web settings experience to expose recent AI query history at /users/[name]/settings/ai-query-history.
| π° Cost | π’ Tokens | β±οΈ Duration | π§ Models | π¬ Prompts | βοΈ Lines |
|---|---|---|---|---|---|
| $4.05 | 6.8M | 31m (6m active) | claude-opus-5-5, claude-haiku-5-5 | 4 | +357 / β0 |
6.8M tokens: 16.8K input Β· 51.1K output Β· 6.4M cache read Β· 269.7K cache write
π AI summary
Explored both the @mcpserver/ package and the existing web settings-page conventions using parallel agents, then implemented support for users to view their recent AI query history from the route /users/[name]/settings/ai-query-history. The work aligned the new functionality with the projectβs existing user settings structure and MCP server patterns.
The session involved extensive repository inspection and code changes through Read, Edit, Write, Bash, and Agent tools. A final /branch command was also issued to manage or inspect the working branch for the completed changes.
View this session on ShellTime β
Updated 2026-10-09 14:25 UTC by ShellTime Β· totals for the whole session so far Β· the session page is visible to its owner
From top to bottom:
- The title names the agent and what the session did, written by AI once the session ends. Until then it reads "Claude Code session" or "Codex session".
- π° Cost is what the session's tokens cost at API prices, so you can compare sessions even when you're on a subscription.
- π’ Tokens counts input, output, cache reads and cache writes. The small line under the table breaks the total down.
- β±οΈ Duration is the wall-clock time, with the time the agent was actually working in brackets. This session ran for 31 minutes and was active for 6.
- π§ Models, π¬ Prompts and βοΈ Lines list every model the session used, how many prompts you sent, and the lines it added and removed.
- π AI summary is collapsed, so the comment stays short in the pull request's timeline.
- View this session on ShellTime β opens the whole session: every prompt, tool call and token. Only you can see that page.
Columns with nothing to show are left out, so a short session may only have cost and tokens.
When it updates
Each session gets one comment, and ShellTime edits it in place instead of posting again:
| When | What changes |
|---|---|
| About 2 minutes after the PR opens | The comment appears with the session's numbers so far |
| 30 minutes later | The numbers are refreshed |
| 24 hours later | A last refresh, for sessions that kept working after opening the PR |
| As soon as the session ends | The AI title, description and summary are filled in |
The numbers always cover the whole session, not just the work before the pull request. If you delete the comment, ShellTime won't post it on that pull request again.
Turn it on
You need three things: the GitHub App on your account, the ShellTime daemon on your machine, and your agent reporting its sessions to it.
- Install the ShellTime GitHub App
In ShellTime, open the menu under your avatar and choose GitHub App. It's also in Settings, under Integrations. Click Install app, pick your personal account or an organization, and choose the repositories the app can see. GitHub sends you back to ShellTime, and the account appears under Connected accounts.
shelltime.xyz/users/you/settings/github-app
GitHub App
Comment each AI coding session's cost on the pull requests it opened
Pull requests
Cost commentsOnConnected accounts
RefreshInstall app
shelltimeOrganizationAll repositories
Coding sessions
- Pull requests
- 11 session
- Tokens
- 6.8M
- Cost
- $4.05
- Lines changed
- +357 β0
shelltime/server1 PR6.8M tokens$4.05+357 β0Show repositoriesSettings β GitHub App with the app installed on an organization. Cost comments is on from the start, so there's nothing to switch on. ShellTime only comments on pull requests opened by the GitHub account linked to your profile. If you haven't linked it yet, the page asks you to do that under Linked Accounts first.
- Make sure the daemon is running
The ShellTime daemon collects your agent's sessions in the background. Check it with:
bash shelltime daemon statusThe last line should read
Status: Running, and the version under "Daemon Info" should be 0.1.93 or later. On an older version, upgrade with:bash shelltime updateNew to ShellTime? Install the CLI first:
Install ShellTimeGet the CLI and its daemon running in a few steps. - Report your agent's sessions
Point your coding agent at the daemon, once per machine:
bash # Claude Code shelltime cc install # Codex shelltime codex installRestart your Claude Code or Codex sessions afterwards so they pick up the new settings.
That's all. The next time your agent opens a pull request, whether with gh pr create, GitHub's MCP server, or any other way that ends with the pull request's link in its reply, the comment follows a couple of minutes later.
See it add up
Back on the GitHub App page, every connected account shows what your coding sessions have spent on its pull requests: how many pull requests and sessions, tokens, cost and lines changed, with a breakdown by repository. It's the quickest way to see what a repository's agent-made pull requests have cost so far.
On your phone, the View this session on ShellTime link opens the session straight in the ShellTime iOS app if you have it installed.
Questions or ideas? Email us at [email protected].
- #github
- #pull-requests
- #claude-code
- #codex
Start tracking in a minute
Install the ShellTime CLI to see your shell commands, AI coding sessions and editor time in one place.
Install ShellTime