Direct naar hoofdinhoud

Claude Code

Onofficiรซle Beta-vertaling

Deze pagina is vertaald door PageTurner AI (beta). Niet officieel goedgekeurd door het project. Een fout gevonden? Probleem melden โ†’

Watโ€‹

Toont Claude Code-sessiegegevens inclusief het huidige AI-model, tokenverbruik, kosten en werkruimtedetails. Laat een visuele meter zien van contextvenstergebruik en geformatteerde kosten/token-informatie voor het monitoren van je Claude-gebruik.

Dit segment integreert met de statusregelfunctionaliteit van Claude Code om realtime sessiegegevens in je prompt te tonen.

Voorbeeldconfiguratieโ€‹

{
"type": "claude",
"style": "diamond",
"leading_diamond": "๎‚ถ",
"trailing_diamond": "๎‚ด",
"foreground": "#FFFFFF",
"background": "#FF6B35",
"template": " ๓ฐฏ‰ {{ .Model.DisplayName }} ๏‹ {{ .TokenGauge }} "
}

Template (informatie)โ€‹

standaard sjabloon
\udb82\udfc9 {{ .Model.DisplayName }} \uf2d0 {{ .TokenGauge }}

Optiesโ€‹

NameTypeDefaultDescription
gauge_marked_charstringโ–ฐCharacter used for filled blocks in gauge visualizations
gauge_unmarked_charstringโ–ฑCharacter used for empty blocks in gauge visualizations

Eigenschappenโ€‹

NameTypeDescription
.CWDstringCurrent working directory; same value as .Workspace.CurrentDir
.SessionIDstringUnique identifier for the Claude session
.SessionNamestringCustom session name; empty when absent
.TranscriptPathstringPath to the conversation transcript file
.ModelModelAI model information
.WorkspaceWorkspaceWorkspace directory information
.VersionstringClaude Code version
.OutputStyleOutputStyleCurrent output style information
.EffortEffortReasoning effort information
.ThinkingThinkingExtended thinking state
.CostCostCost and duration information
.ContextWindowContextWindowToken usage information
.Exceeds200KTokensboolWhether the most recent API response exceeded 200K total tokens
.VimVimVim mode information; empty when absent
.AgentAgentAgent information; empty when absent
.WorktreeWorktreeClaude Code worktree information; empty when absent
.FastModeboolWhether fast mode is enabled; false when absent or unsupported
.TokenUsagePercentPercentagePercentage of context window used (0-100)
.TokenGaugestringGauge showing remaining context capacity using configured characters (e.g., โ–ฐโ–ฐโ–ฐโ–ฑโ–ฑ)
.TokenGaugeUsedstringGauge showing used context capacity using configured characters (e.g., โ–ฐโ–ฐโ–ฑโ–ฑโ–ฑ)
.FiveHourGaugestringGauge showing 5-hour rate limit usage using configured characters
.SevenDayGaugestringGauge showing 7-day rate limit usage using configured characters
.FiveHourResetsAttime.Time5-hour rate limit window reset time
.SevenDayResetsAttime.Time7-day rate limit window reset time
.FiveHourResetsIntime.Durationtime until 5-hour resets; 0=unavailable, neg=past
.SevenDayResetsIntime.Durationtime until 7-day resets; 0=unavailable, neg=past
.FormattedCoststringFormatted cost string (e.g., "$0.15" or "$0.0012")
.FormattedTokensstringHuman-readable token count (e.g., "1.2K", "15.3M")
.FormattedDurationstringTotal session duration (e.g., "2m 5s")
.FormattedAPIDurationstringAPI wait time (e.g., "0m 45s")
.FiveHourUsagePercentage5-hour rolling rate limit usage (0-100)
.SevenDayUsagePercentage7-day rate limit usage (0-100)

Model Eigenschappenโ€‹

NameTypeDescription
.IDstringTechnical model identifier
.DisplayNamestringHuman-readable model name (e.g., "Claude 3.5 Sonnet")

Werkruimte Eigenschappenโ€‹

NameTypeDescription
.CurrentDirstringCurrent working directory; same value as .CWD
.ProjectDirstringDirectory where Claude Code was launched; may differ from .CurrentDir
.AddedDirs[]stringAdditional directories added via /add-dir or --add-dir
.GitWorktreestringPath to the linked git worktree, empty when not inside a linked git worktree

OutputStyle Propertiesโ€‹

NameTypeDescription
.NamestringName of the current output style

Effort Propertiesโ€‹

NameTypeDescription
.LevelstringReasoning effort level (low, medium, high, xhigh, max); empty when absent or unsupported

Thinking Propertiesโ€‹

NameTypeDescription
.EnabledboolWhether extended thinking is enabled; false when absent

Vim Propertiesโ€‹

NameTypeDescription
.ModestringCurrent vim mode; empty when vim mode is disabled

Agent Propertiesโ€‹

NameTypeDescription
.NamestringAgent name; empty when no agent is active

Worktree Propertiesโ€‹

NameTypeDescription
.NamestringName of the active Claude Code worktree
.PathstringAbsolute path to the worktree directory
.BranchstringGit branch name for the worktree; empty when absent
.OriginalCWDstringDirectory Claude Code was in before entering worktree
.OriginalBranchstringBranch checked out before entering worktree; empty when absent

Kosten Eigenschappenโ€‹

NameTypeDescription
.TotalCostUSDfloat64Total cost in USD
.TotalDurationMSDurationMSTotal session duration in milliseconds (formats as "Xm Ys")
.TotalAPIDurationMSDurationMSTime spent waiting for API responses (formats as "Xm Ys")
.TotalLinesAddedintLines of code added in the session
.TotalLinesRemovedintLines of code removed in the session

ContextVenster Eigenschappenโ€‹

NameTypeDescription
.TotalInputTokensintTotal input tokens used in the session
.TotalOutputTokensintTotal output tokens generated in the session
.ContextWindowSizeintMaximum context window size for the model
.CurrentUsageCurrentUsageCurrent message token usage

HuidigGebruik Eigenschappenโ€‹

NameTypeDescription
.InputTokensintInput tokens for the current message
.OutputTokensintOutput tokens for the current message

RateLimits Eigenschappenโ€‹

Beschikbaar wanneer Claude Code ratelimitsgegevens levert (Pro/Max-abonnees). Toegankelijk via .RateLimits.

NameTypeDescription
.FiveHourRateLimitWindow5-hour rolling window
.SevenDayRateLimitWindow7-day rolling window

RateLimitWindow Eigenschappenโ€‹

NameTypeDescription
.UsedPercentage*float64Usage percentage (0-100), nil if unknown
.ResetsAt*int64Unix epoch seconds when window resets

Percentage-methodenโ€‹

Het Percentage-type (teruggestuurd door .TokenUsagePercent, .FiveHourUsage, .SevenDayUsage) biedt extra methoden voor direct gebruik in sjablonen:

MethodReturnsDescription
.GaugestringVisual gauge showing remaining capacity using hardcoded โ–ฐ/โ–ฑ characters
.GaugeUsedstringVisual gauge showing used capacity using hardcoded โ–ฐ/โ–ฑ characters
.StringstringNumeric percentage value (e.g., "75" for use in templates)
Aangepaste metertekens

Gebruik .TokenGauge, .TokenGaugeUsed, .FiveHourGauge en .SevenDayGauge in plaats van de onbewerkte .Percentage-methoden hierboven - deze respecteren de gauge_marked_char en gauge_unmarked_char opties.

Hoe het werktโ€‹

Het segment leest sessiegegevens uit de POSH_CLAUDE_STATUS omgevingsvariabele, die automatisch wordt ingesteld bij gebruik van het oh-my-posh claude commando. De gegevens omvatten:

  • Informatie over het huidige AI-model

  • Tokenverbruik en contextvensterbenutting

  • Sessiekosten en duur

  • Werkruimtemapinformatie

Het segment wordt alleen getoond wanneer Claude Code actief sessiegegevens levert.