context-usage

Solid

Analyze current session context and token usage from OpenCode SQLite database

AI & Automation 15 stars 3 forks Updated today MIT

Install

View on GitHub

Quality Score: 83/100

Stars 20%
40
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Context Usage Analysis **Recommended model tier:** balanced (sonnet) - straightforward SQL queries Analyze the current session's context window consumption, tool usage breakdown, and token costs by querying the OpenCode SQLite database directly. ## Prerequisites - This skill **only works on OpenCode**. Verify by checking the environment: - `$OPENCODE=1` — set by the OpenCode runtime - `$AIDE_PLATFORM=opencode` — set by aide when running under OpenCode - `$AIDE_SESSION_ID` — the current session ID (injected by aide) - The OpenCode database is at `~/.local/share/opencode/opencode.db`. - `sqlite3` must be available on the system. If `$OPENCODE` is not `1` or `$AIDE_PLATFORM` is not `opencode`, abort immediately and inform the user that this skill is only supported on OpenCode. Do **not** attempt to query other databases (e.g. Claude Code's storage) — the schema is OpenCode-specific. If `$AIDE_SESSION_ID` is not set, abort with a message explaining that the session ID could not be determined. ## Workflow Run the following queries **sequentially** in a single Bash call (chain with `&&`). Present results to the user in a formatted summary after all queries complete. ### Step 1: Validate environment ```bash test "$OPENCODE" = "1" && echo "Platform: OpenCode" || echo "ERROR: Not running on OpenCode (OPENCODE=$OPENCODE)" test "$AIDE_PLATFORM" = "opencode" && echo "AIDE Platform: opencode" || echo "WARNING: AIDE_PLATFORM=$AIDE_PLATFORM" test -n "$AIDE_SESSION_ID" && e...

Details

Author
jmylchreest
Repository
jmylchreest/aide
Created
5 months ago
Last Updated
today
Language
Go
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

context-budget-auditor

Measures token consumption across every loadable pmo-platform component in a Claude Code / Cowork session — the SKILL.md catalog, core/rules/, core/standards/schemas/specs/disciplines, agents, hooks, and the CLAUDE.md context-file chain — and reports total + per-component estimated token cost, a flagged-bloat section with the applied thresholds stated inline, and a K1/K2 load-vs-reference hint per component. Single Measure mode. Estimates are a heuristic, trend-over-time signal (not falsely-precise absolutes), and the skill roster is sourced live, never hardcoded. Read-and-report only — measures cost, changes nothing. Triggers: "audit the context budget", "measure token consumption", "how much context does the platform load", "what's the per-component token cost", "flag context bloat", "which components are bloated", "context budget report".

0 Updated today
cody-hutson
AI & Automation Listed

context

Context Manager - Token Budget Controller

10 Updated 1 weeks ago
samibs
AI & Automation Listed

context-doctor

Visualize and diagnose OpenClaw context window usage. Generates a terminal-rendered breakdown showing workspace files (status, chars, tokens), installed skills inventory, and token budget allocation across bootstrap components. Use when: (1) user asks about context window health or token usage, (2) debugging agent quality degradation ("agent got dumber"), (3) after editing workspace files to verify impact, (4) auditing bootstrap overhead. NOT for: conversation history analysis, model selection, or cost tracking.

2 Updated yesterday
unhealthy-outlander317