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 }} ๏ {{ .TokenUsagePercent.Gauge }} "
}
type: claude
style: diamond
leading_diamond: ๎ถ
trailing_diamond: ๎ด
foreground: "#FFFFFF"
background: "#FF6B35"
template: " ๓ฐฏ {{ .Model.DisplayName }} ๏ {{ .TokenUsagePercent.Gauge }} "
type = "claude"
style = "diamond"
leading_diamond = "๎ถ"
trailing_diamond = "๎ด"
foreground = "#FFFFFF"
background = "#FF6B35"
template = " ๓ฐฏ {{ .Model.DisplayName }} ๏ {{ .TokenUsagePercent.Gauge }} "
Template (informatie)โ
\udb82\udfc9 {{ .Model.DisplayName }} \uf2d0 {{ .TokenUsagePercent.Gauge }}
Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.SessionID | string | Unique identifier for the Claude session |
.Model | Model | AI model information |
.Workspace | Workspace | Workspace directory information |
.Cost | Cost | Cost and duration information |
.ContextWindow | ContextWindow | Token usage information |
.TokenUsagePercent | Percentage | Percentage of context window used (0-100) |
.FormattedCost | string | Formatted cost string (e.g., "$0.15" or "$0.0012") |
.FormattedTokens | string | Human-readable token count (e.g., "1.2K", "15.3M") |
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 |
.ProjectDir | string | Root project directory |
Kosten Eigenschappenโ
| Name | Type | Description |
|---|---|---|
.TotalCostUSD | float64 | Total cost in USD |
.TotalDurationMS | int64 | Total session duration in milliseconds |
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 |
Percentage-methodenโ
De TokenUsagePercent eigenschap is een Percentage type dat extra functionaliteit biedt:
| Method | Returns | Description |
|---|---|---|
.Gauge | string | Visual gauge showing remaining capacity using 5 bar blocks (โฐโฐโฐโฐโฑ) |
.GaugeUsed | string | Visual gauge showing used capacity using 5 bar blocks (โฐโฑโฑโฑโฑ) |
.String | string | Numeric percentage value (e.g., "75" for use in templates) |
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.