context-usage
SolidAnalyze current session context and token usage from OpenCode SQLite database
AI & Automation 18 stars
5 forks Updated 2 days ago MIT
Install
Quality Score: 83/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
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
- 7 months ago
- Last Updated
- 2 days ago
- 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-diet
Use when the user asks to audit coding-agent context, reduce token or context waste, diagnose Context Diet, start or stop the local service, explain a policy decision, run a benchmark, retrieve exact context, understand why a block stayed native, or troubleshoot Codex or Claude Code setup.
0 Updated 1 months ago
mSolstice AI & Automation Listed
context-budget
Reduce unnecessary instructions and tool output using measured session information.
0 Updated 4 days ago
misaon AI & Automation Listed
context-status
Show current context status and session health. Use to check how much context has been used, whether auto-compact is approaching, and what state will be preserved.
6 Updated 1 weeks ago
alohays