René's URL Explorer Experiment


Title: feat: add /tokens /context /cost commands to show token usage and context size · Issue #224 · lessweb/deepcode-cli · GitHub

Open Graph Title: feat: add /tokens /context /cost commands to show token usage and context size · Issue #224 · lessweb/deepcode-cli

X Title: feat: add /tokens /context /cost commands to show token usage and context size · Issue #224 · lessweb/deepcode-cli

Description: Feature Request: Token Usage & Context Visibility It would be very useful to have visibility into token consumption and context size directly from the CLI, similar to Claude Code's /context and /cost commands. Motivation Currently, Deep ...

Open Graph Description: Feature Request: Token Usage & Context Visibility It would be very useful to have visibility into token consumption and context size directly from the CLI, similar to Claude Code's /context and /co...

X Description: Feature Request: Token Usage & Context Visibility It would be very useful to have visibility into token consumption and context size directly from the CLI, similar to Claude Code's /context...

Opengraph URL: https://github.com/lessweb/deepcode-cli/issues/224

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"feat: add /tokens /context /cost commands to show token usage and context size","articleBody":"### Feature Request: Token Usage \u0026 Context Visibility\n\nIt would be very useful to have visibility into token consumption and context size directly from the CLI, similar to Claude Code's `/context` and `/cost` commands.\n\n## Motivation\n\nCurrently, Deep Code already **stores token usage data internally** in `sessions-index.json`. According to the docs, each session entry tracks:\n\u003e \"token 用量 and 活跃 token 数\"\n\nHowever, there is **no way to view this information from the CLI interface**. Users have no visibility into:\n- How many tokens they have consumed in the current session\n- How much of the context window is being used\n- What is consuming the most tokens (system prompt, conversation history, skills, MCP tools)\n\n## Proposed Commands\n\n### `/tokens` – Show current session token consumption\n\nDisplays the token usage breakdown for the current session:\n- Input tokens (this turn)\n- Output tokens (this turn)\n- Thinking tokens (if thinking mode is enabled)\n- Total tokens (entire session)\n- Estimated cost (based on model pricing)\n\n### `/context` – Show context window breakdown\n\nDisplays what is consuming the context window:\n- System prompt size (tokens)\n- Conversation history size (# of messages, tokens)\n- Skills loaded and their contribution\n- Active MCP tools and their descriptions size\n- Total context window usage (e.g., 15K / 128K / 1M)\n\n### `/cost` – Show cumulative session cost\n\nShows the estimated cost of the current session based on model pricing:\n- Per-turn cost breakdown\n- Total session cost\n- Thinking vs non-thinking token cost\n\n## Why This Matters\n\n1. **Cost awareness** – Helps users monitor spend when using paid API models (especially with reasoning/thinking tokens which add significant cost)\n2. **Debug context limits** – When approaching context window limits, users can identify the culprit (bloated history, too many skills, etc.)\n3. **Optimization feedback** – Allows users to measure the impact of prompt optimization, skill trimming, or MCP cleanup\n4. **Parity with alternatives** – Tools like Claude Code already offer `/context` and `/cost`; adding these would reduce friction for users migrating to or evaluating Deep Code\n\n## Implementation Notes\n\n- The data already exists in `~/.deepcode/projects/\u003cproject-code\u003e/sessions-index.json` which stores \"token 用量\" per session entry\n- For real-time context window tracking, the token counts could be computed from the messages being sent to the model API\n- A lightweight tokenizer or cached counts per message would suffice — no need for full tokenization on every request\n\n---\n\n*This is an open-ended feature request. Happy to help with implementation or testing.*","author":{"url":"https://github.com/andrewsruge2501-max","@type":"Person","name":"andrewsruge2501-max"},"datePublished":"2026-07-07T02:05:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/224/deepcode-cli/issues/224"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:30465f9d-8107-96bf-98d6-c24c8c0c2bfb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idABC6:CD887:C03B4F:10DECD7:6A4E881F
html-safe-nonceaa0e0a7d6ffcbea904e9d857a33e2532af21ee107b1b2d3c58373e990dae9f0e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkM2OkNEODg3OkMwM0I0RjoxMERFQ0Q3OjZBNEU4ODFGIiwidmlzaXRvcl9pZCI6IjU4MjU5Mjg3MjE2ODk4MjU2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac42f799c66d8d30b372146129304548eff25e1f1e1fffd99b48d254f24df797fc
hovercard-subject-tagissue:4824554427
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lessweb/deepcode-cli/224/issue_layout
twitter:imagehttps://opengraph.githubassets.com/5de9593fdb6e27378ecbda436909ef2059e80c6f05657f377f60055c6a01d326/lessweb/deepcode-cli/issues/224
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/5de9593fdb6e27378ecbda436909ef2059e80c6f05657f377f60055c6a01d326/lessweb/deepcode-cli/issues/224
og:image:altFeature Request: Token Usage & Context Visibility It would be very useful to have visibility into token consumption and context size directly from the CLI, similar to Claude Code's /context and /co...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameandrewsruge2501-max
hostnamegithub.com
expected-hostnamegithub.com
None41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c
turbo-cache-controlno-preview
go-importgithub.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git
octolytics-dimension-user_id118287711
octolytics-dimension-user_loginlessweb
octolytics-dimension-repository_id1223512305
octolytics-dimension-repository_nwolessweb/deepcode-cli
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1223512305
octolytics-dimension-repository_network_root_nwolessweb/deepcode-cli
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6a744804e8e70f97b4d5a18a94dcc63db22f97a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/lessweb/deepcode-cli/issues/224#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fissues%2F224
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Flessweb%2Fdeepcode-cli%2Fissues%2F224
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=lessweb%2Fdeepcode-cli
Reloadhttps://github.com/lessweb/deepcode-cli/issues/224
Reloadhttps://github.com/lessweb/deepcode-cli/issues/224
Reloadhttps://github.com/lessweb/deepcode-cli/issues/224
Please reload this pagehttps://github.com/lessweb/deepcode-cli/issues/224
lessweb https://github.com/lessweb
deepcode-clihttps://github.com/lessweb/deepcode-cli
Notifications https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Fork 153 https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Star 1.7k https://github.com/login?return_to=%2Flessweb%2Fdeepcode-cli
Code https://github.com/lessweb/deepcode-cli
Issues 44 https://github.com/lessweb/deepcode-cli/issues
Pull requests 22 https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality 0 https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
Code https://github.com/lessweb/deepcode-cli
Issues https://github.com/lessweb/deepcode-cli/issues
Pull requests https://github.com/lessweb/deepcode-cli/pulls
Actions https://github.com/lessweb/deepcode-cli/actions
Projects https://github.com/lessweb/deepcode-cli/projects
Security and quality https://github.com/lessweb/deepcode-cli/security
Insights https://github.com/lessweb/deepcode-cli/pulse
feat: add /tokens /context /cost commands to show token usage and context sizehttps://github.com/lessweb/deepcode-cli/issues/224#top
https://github.com/andrewsruge2501-max
andrewsruge2501-maxhttps://github.com/andrewsruge2501-max
on Jul 7, 2026https://github.com/lessweb/deepcode-cli/issues/224#issue-4824554427
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.