Claude Code
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โ
- json
- yaml
- toml
{
"type": "claude",
"style": "diamond",
"leading_diamond": "๎ถ",
"trailing_diamond": "๎ด",
"foreground": "#FFFFFF",
"background": "#FF6B35",
"template": " ๓ฐฏ {{ .Model.DisplayName }} ๏ {{ .TokenGauge }} "
}
type: claude
style: diamond
leading_diamond: ๎ถ
trailing_diamond: ๎ด
foreground: "#FFFFFF"
background: "#FF6B35"
template: " ๓ฐฏ {{ .Model.DisplayName }} ๏ {{ .TokenGauge }} "
type = "claude"
style = "diamond"
leading_diamond = "๎ถ"
trailing_diamond = "๎ด"
foreground = "#FFFFFF"
background = "#FF6B35"
template = " ๓ฐฏ {{ .Model.DisplayName }} ๏ {{ .TokenGauge }} "
Template (informatie)โ
\udb82\udfc9 {{ .Model.DisplayName }} \uf2d0 {{ .TokenGauge }}
Optiesโ
| Name | Type | Default | Description |
|---|---|---|---|
gauge_marked_char | string | โฐ | Character used for filled blocks in gauge visualizations |
gauge_unmarked_char | string | โฑ | Character used for empty blocks in gauge visualizations |
Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.CWD | string | Current working directory; same value as .Workspace.CurrentDir |
.SessionID | string | Unique identifier for the Claude session |
.SessionName | string | Custom session name; empty when absent |
.TranscriptPath | string | Path to the conversation transcript file |
.Model | Model | AI model information |
.Workspace | Workspace | Workspace directory information |
.Version | string | Claude Code version |
.OutputStyle | OutputStyle | Current output style information |
.Effort | Effort | Reasoning effort information |
.Thinking | Thinking | Extended thinking state |
.Cost | Cost | Cost and duration information |
.ContextWindow | ContextWindow | Token usage information |
.Exceeds200KTokens | bool | Whether the most recent API response exceeded 200K total tokens |
.Vim | Vim | Vim mode information; empty when absent |
.Agent | Agent | Agent information; empty when absent |
.Worktree | Worktree | Claude Code worktree information; empty when absent |
.FastMode | bool | Whether fast mode is enabled; false when absent or unsupported |
.TokenUsagePercent | Percentage | Percentage of context window used (0-100) |
.TokenGauge | string | Gauge showing remaining context capacity using configured characters (e.g., โฐโฐโฐโฑโฑ) |
.TokenGaugeUsed | string | Gauge showing used context capacity using configured characters (e.g., โฐโฐโฑโฑโฑ) |
.FiveHourGauge | string | Gauge showing 5-hour rate limit usage using configured characters |
.SevenDayGauge | string | Gauge showing 7-day rate limit usage using configured characters |
.FiveHourResetsAt | time.Time | 5-hour rate limit window reset time |
.SevenDayResetsAt | time.Time | 7-day rate limit window reset time |
.FiveHourResetsIn | time.Duration | time until 5-hour resets; 0=unavailable, neg=past |
.SevenDayResetsIn | time.Duration | time until 7-day resets; 0=unavailable, neg=past |
.FormattedCost | string | Formatted cost string (e.g., "$0.15" or "$0.0012") |
.FormattedTokens | string | Human-readable token count (e.g., "1.2K", "15.3M") |
.FormattedDuration | string | Total session duration (e.g., "2m 5s") |
.FormattedAPIDuration | string | API wait time (e.g., "0m 45s") |
.FiveHourUsage | Percentage | 5-hour rolling rate limit usage (0-100) |
.SevenDayUsage | Percentage | 7-day rate limit usage (0-100) |
Model Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.ID | string | Technical model identifier |
.DisplayName | string | Human-readable model name (e.g., "Claude 3.5 Sonnet") |
Werkruimte Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.CurrentDir | string | Current working directory; same value as .CWD |
.ProjectDir | string | Directory where Claude Code was launched; may differ from .CurrentDir |
.AddedDirs | []string | Additional directories added via /add-dir or --add-dir |
.GitWorktree | string | Path to the linked git worktree, empty when not inside a linked git worktree |
OutputStyle Propertiesโ
| Name | Type | Description |
|---|---|---|
.Name | string | Name of the current output style |
Effort Propertiesโ
| Name | Type | Description |
|---|---|---|
.Level | string | Reasoning effort level (low, medium, high, xhigh, max); empty when absent or unsupported |
Thinking Propertiesโ
| Name | Type | Description |
|---|---|---|
.Enabled | bool | Whether extended thinking is enabled; false when absent |
Vim Propertiesโ
| Name | Type | Description |
|---|---|---|
.Mode | string | Current vim mode; empty when vim mode is disabled |
Agent Propertiesโ
| Name | Type | Description |
|---|---|---|
.Name | string | Agent name; empty when no agent is active |
Worktree Propertiesโ
| Name | Type | Description |
|---|---|---|
.Name | string | Name of the active Claude Code worktree |
.Path | string | Absolute path to the worktree directory |
.Branch | string | Git branch name for the worktree; empty when absent |
.OriginalCWD | string | Directory Claude Code was in before entering worktree |
.OriginalBranch | string | Branch checked out before entering worktree; empty when absent |
Kosten Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.TotalCostUSD | float64 | Total cost in USD |
.TotalDurationMS | DurationMS | Total session duration in milliseconds (formats as "Xm Ys") |
.TotalAPIDurationMS | DurationMS | Time spent waiting for API responses (formats as "Xm Ys") |
.TotalLinesAdded | int | Lines of code added in the session |
.TotalLinesRemoved | int | Lines of code removed in the session |
ContextVenster Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.TotalInputTokens | int | Total input tokens used in the session |
.TotalOutputTokens | int | Total output tokens generated in the session |
.ContextWindowSize | int | Maximum context window size for the model |
.CurrentUsage | CurrentUsage | Current message token usage |
HuidigGebruik Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.InputTokens | int | Input tokens for the current message |
.OutputTokens | int | Output tokens for the current message |
RateLimits Eigenschappenโ
Beschikbaar wanneer Claude Code ratelimitsgegevens levert (Pro/Max-abonnees). Toegankelijk via .RateLimits.
| Name | Type | Description |
|---|---|---|
.FiveHour | RateLimitWindow | 5-hour rolling window |
.SevenDay | RateLimitWindow | 7-day rolling window |
RateLimitWindow Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.UsedPercentage | *float64 | Usage percentage (0-100), nil if unknown |
.ResetsAt | *int64 | Unix epoch seconds when window resets |
Percentage-methodenโ
Het Percentage-type (teruggestuurd door .TokenUsagePercent, .FiveHourUsage, .SevenDayUsage)
biedt extra methoden voor direct gebruik in sjablonen:
| Method | Returns | Description |
|---|---|---|
.Gauge | string | Visual gauge showing remaining capacity using hardcoded โฐ/โฑ characters |
.GaugeUsed | string | Visual gauge showing used capacity using hardcoded โฐ/โฑ characters |
.String | string | Numeric percentage value (e.g., "75" for use in templates) |
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.