[FEATURE]: Print some info when exiting: title, command to resume, usage stats #3145

Open
opened 2026-02-16 17:38:51 -05:00 by yindo · 6 comments
Owner

Originally created by @abourget on GitHub (Nov 26, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Upon leaving, codex outputs something like:

Token usage: total=3,728 input=3,713 output=15
To continue this session, run codex resume 019ac229-77e1-7d22-bc19-c63042eefdb7

This is neat, and allows to jump back into the session very quickly.
I'd add the Title of the session, so I can get back to a Terminal tab, and know what that session was about, and jump back at it if need be.

Originally created by @abourget on GitHub (Nov 26, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request Upon leaving, `codex` outputs something like: ``` Token usage: total=3,728 input=3,713 output=15 To continue this session, run codex resume 019ac229-77e1-7d22-bc19-c63042eefdb7 ``` This is neat, and allows to jump back into the session very quickly. I'd add the Title of the session, so I can get back to a Terminal tab, and know what that session was about, and jump back at it if need be.
yindo added the discussion label 2026-02-16 17:38:51 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

That's actually an interesting idea i kinda like this

@rekram1-node commented on GitHub (Nov 26, 2025): That's actually an interesting idea i kinda like this
Author
Owner

@ara303 commented on GitHub (Nov 26, 2025):

"Me too"ing on this. Being able to resume a session would be really good.

@ara303 commented on GitHub (Nov 26, 2025): "Me too"ing on this. Being able to resume a session would be really good.
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

@ara303 you can already do that in multiple ways:

opencode -c // continue last session
opencode --session <id> // continue specified session
opencode -> /sessions -> select session

@rekram1-node commented on GitHub (Nov 26, 2025): @ara303 you can already do that in multiple ways: opencode -c // continue last session opencode --session \<id\> // continue specified session opencode -> /sessions -> select session
Author
Owner

@rruusu commented on GitHub (Jan 15, 2026):

Token usage: total=3,728 input=3,713 output=15
To continue this session, run codex resume 019ac229-77e1-7d22-bc19-c63042eefdb7

This should include the "COST & TOKENS" and "TOOL USAGE" sections shown by /stats, without the per session statistics, which should also be available by a session specific /stats command.

It could also include starting and ending times of the session and a single sentence description of the session.

It would be nice to also get both the total cost broken down by token type, which could be also added to the /stats output.

Example:

┌────────────────────────────────────────────────────────┐
│                       OVERVIEW                         │
├────────────────────────────────────────────────────────┤
│ Messages                                           571 │
│ Days                                                 2 │
└────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────┐
│                    COST & TOKENS                       │
├────────────────────────────────────────────────────────┤
│ Total Cost                                      $19.88 │
│ Avg Cost/Day                                     $9.94 │
│ Input                                   88.4K ( $0.27) │
│ Output                                 231.8K ( $3.48) │
│ Cache Read                              33.8M ( $3.38) │
│ Cache Write                              3.4M ($12.75) │
└────────────────────────────────────────────────────────┘

┌────────────────────────────────────────────────────────┐
│                      TOOL USAGE                        │
├────────────────────────────────────────────────────────┤
│ read               ████████████████████ 216 (33.7%)    │
│ bash               ████████████         135 (21.1%)    │
│ edit               █████████            105 (16.4%)    │
│ todowrite          ██████                65 (10.1%)    │
│ glob               ████                  53 ( 8.3%)    │
│ grep               ████                  47 ( 7.3%)    │
│ write              █                     15 ( 2.3%)    │
│ task               █                      4 ( 0.6%)    │
│ list               █                      1 ( 0.2%)    │
└─���──────────────────────────────────────────────────────┘
@rruusu commented on GitHub (Jan 15, 2026): > ``` > Token usage: total=3,728 input=3,713 output=15 > To continue this session, run codex resume 019ac229-77e1-7d22-bc19-c63042eefdb7 > ``` This should include the "COST & TOKENS" and "TOOL USAGE" sections shown by `/stats`, without the per session statistics, which should also be available by a **session specific `/stats` command.** It could also include starting and ending times of the session and a single sentence description of the session. It would be nice to also get both the total cost broken down by token type, which could be also added to the `/stats` output. Example: ``` ┌────────────────────────────────────────────────────────┐ │ OVERVIEW │ ├────────────────────────────────────────────────────────┤ │ Messages 571 │ │ Days 2 │ └────────────────────────────────────────────────────────┘ ┌────────────────────────────────────────────────────────┐ │ COST & TOKENS │ ├────────────────────────────────────────────────────────┤ │ Total Cost $19.88 │ │ Avg Cost/Day $9.94 │ │ Input 88.4K ( $0.27) │ │ Output 231.8K ( $3.48) │ │ Cache Read 33.8M ( $3.38) │ │ Cache Write 3.4M ($12.75) │ └────────────────────────────────────────────────────────┘ ┌────────────────────────────────────────────────────────┐ │ TOOL USAGE │ ├────────────────────────────────────────────────────────┤ │ read ████████████████████ 216 (33.7%) │ │ bash ████████████ 135 (21.1%) │ │ edit █████████ 105 (16.4%) │ │ todowrite ██████ 65 (10.1%) │ │ glob ████ 53 ( 8.3%) │ │ grep ████ 47 ( 7.3%) │ │ write █ 15 ( 2.3%) │ │ task █ 4 ( 0.6%) │ │ list █ 1 ( 0.2%) │ └─���──────────────────────────────────────────────────────┘ ```
Author
Owner

@rruusu commented on GitHub (Jan 15, 2026):

In addition to a session-specific stats command, there should be a project-specific stats command. Currently the stats command outputs statistics across all projects, which is not very helpful for use in cost accounting.

This should probably be a separate issue, if not already created.

Is there any existing way to get the cost or token counts for a single project?

@rruusu commented on GitHub (Jan 15, 2026): In addition to a session-specific `stats` command, there should be a **project-specific `stats` command**. Currently the `stats` command outputs statistics across all projects, which is not very helpful for use in cost accounting. This should probably be a separate issue, if not already created. Is there any existing way to get the cost or token counts for a single project?
Author
Owner

@ara303 commented on GitHub (Jan 16, 2026):

I don't think all of the above two comments is necessary.

A brief summary of token use and a way to easily continue the session is adequate, I feel. For my take, that's something I did really like from Codex which I then realised I missed when switching back to OC.

@ara303 commented on GitHub (Jan 16, 2026): I don't think all of the above two comments is necessary. A brief summary of token use and a way to easily continue the session is adequate, I feel. For my take, that's something I did really like from Codex which I then realised I missed when switching back to OC.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3145