### lancetta advice output example Source: https://lancetta.app/docs/command-line Example output from the lancetta advice command, showing a suggestion with timing, effort level, and resource allocation details. The output is in English and includes a blank line between suggestions when using --all. ```text Lancetta: At this pace Claude stops in 51m, then waits 1h18m for its reset. - Lower the effort: it is set to xhigh. - Give routine work to a lighter model. - There is no free reset to fall back on: keep what is left for what matters most. - Move the next tasks to Codex: 88% of its 5-hour window and 80% of its week are left. (5 hours: 82% used, 21% an hour over the last 1h00m, from 14 readings.) ``` -------------------------------- ### Example: tmux or SketchyBar strip Source: https://lancetta.app/docs/command-line A shell script example that uses `lancetta usage --json` to build a custom status strip for tmux or SketchyBar, showing each agent's five-hour figure, a refusal mark, and a stale flag. ```APIDOC ## Example: tmux or SketchyBar strip ### Description A shell script that reads the Lancetta document via `usage --json` and formats a one-line status strip. ### Usage Run from a shell. It uses `jq` to parse the JSON output. ### Script ```sh #!/bin/sh # A tmux / SketchyBar strip: one line, each agent's 5-hour figure, a mark when the # account refused, and "(stale)" once a reading is more than ten minutes old. lancetta=/Applications/Lancetta.app/Contents/MacOS/Lancetta "$lancetta" usage --json 2>/dev/null | /usr/bin/jq -r ' [.agents[] | select(.reading != null) | .reading as $r | .agent + " " + (if $r.fiveHour.usedPercent == null then "?" else ($r.fiveHour.usedPercent | floor | tostring) + "%" end) + (if $r.blocked then " refused" else "" end) + (if now - $r.observedAt > 600 then " (stale)" else "" end) ] | join(" ") ' ``` ### Output Example For a document with one agent (Codex) having a reading of 41% used, observed long ago, and another agent (Claude) with no reading, the script prints: `Codex 41% (stale)` ``` -------------------------------- ### lancetta usage --json output example Source: https://lancetta.app/docs/command-line Example JSON document printed by `lancetta usage --json`. It shows the schema version, app version, write timestamp, agent readings with usage percentages and reset times, and advice entries. The document is read from `~/Library/Application Support/Lancetta/usage.json`. ```json { "schema": 1, "app": "0.61.0", "writtenAt": 1790400000, "agents": [ { "agent": "Codex", "route": "appServer", "reading": { "observedAt": 1790400000, "fiveHour": { "usedPercent": 41, "resetsAt": 1790417000 }, "sevenDay": { "usedPercent": 12.5, "resetsAt": 1790946000 }, "plan": "pro", "blocked": false, "blockedBucket": null, "models": [], "resetCreditsAvailable": 1 }, "problem": null }, { "agent": "Claude", "route": "account", "reading": null, "problem": { "code": "CLAUDE-9", "title": "Claude's account asked for a pause", "message": "Claude's account asked for a pause. Lancetta reads again in 1 minute.", "detail": "HTTP 429, waiting 60 s", "state": true } } ], "advice": [ { "kind": "stop", "tone": "caution", "agent": "Codex", "title": "At this pace Codex stops in 1h10m, then waits 3h33m for its reset.", "steps": [ "2 sessions of Codex are working at once: pause the ones that can wait.", "Give routine work to a lighter model.", "You hold a free reset: use it when it stops.", "Or pause it, and plan, review or write in the meantime." ], "basis": "5 hours: 41% used, 51% an hour over the last 1h00m, from 14 readings. The Sessions pane shows 2 of its sessions working now.", "at": 1790404200, "first": true } ] } ``` -------------------------------- ### Create lancetta symlink manually Source: https://lancetta.app/docs/command-line Creates a symlink named `lancetta` to Lancetta's binary in `~/.local/bin`. Use when the folder exists and is on your PATH. The app's Install button does this automatically. ```bash ln -s /Applications/Lancetta.app/Contents/MacOS/Lancetta ~/.local/bin/lancetta ``` -------------------------------- ### Configure lancetta advice as SessionStart hook Source: https://lancetta.app/docs/command-line JSON configuration for Claude Code's ~/.claude/settings.json to run 'lancetta advice' at the start of every session. The hook's output is added to the session's context, and nothing is added when there is nothing to suggest. ```json { "hooks": { "SessionStart": [ { "hooks": [{ "type": "command", "command": "lancetta advice" }] } ] } } ```