Repository navigation
Package tokenjam as a Claude Code plugin - #716
Conversation
Adds .claude-plugin/plugin.json and slash commands (/onboard, /status, /optimize, /doctor, /uninstall) that wrap the existing tj CLI entry points. The plugin deliberately ships no hooks.json or .mcp.json: a plugin manifest cannot register the main terminal statusLine at all (only subagentStatusLine is supported), and declaring the SessionStart resume-brief hook independently would risk double-firing against tj onboard's own idempotent hook wiring. So /onboard simply invokes `tj onboard --claude-code`, keeping settings.json to one writer. The MCP server (tj mcp) also stays out of the default install — it's built for SDK/API integrations already in the request path, not for Claude Code, where an in-loop MCP measurably taxes every turn. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
| Filename | Overview |
|---|---|
| plugin/commands/status.md | Adds a slash-command wrapper around the verbose TokenJam status report. |
| plugin/commands/doctor.md | Adds a slash-command wrapper around TokenJam’s configuration, ingestion, and storage health check. |
| plugin/commands/uninstall.md | Adds a slash-command wrapper for removing the CLI-managed Claude Code integration. |
| plugin/commands/onboard.md | Adds installation detection and delegates Claude Code onboarding to the existing CLI. |
| plugin/.claude-plugin/plugin.json | Defines the Claude Code plugin’s identity and package metadata. |
| plugin/README.md | Documents plugin installation, available commands, and architecture choices. |
Reviews (2): Last reviewed commit: "Move the Claude Code plugin into its own..." | Re-trigger Greptile
| --- | ||
|
|
||
| ## tj status | ||
| !`tj status --verbose 2>&1 || echo "tj is not installed. Run /onboard first, or install with npx tokenjam@latest / pipx install tokenjam."` |
There was a problem hiding this comment.
Nonzero results report missing CLI
When tj status returns 1 for active alerts, this fallback says that tj is not installed, causing Claude to recommend installation instead of accurately presenting the alerts. The same pattern in commands/doctor.md mislabels warnings, and in commands/optimize.md mislabels configuration or validation errors.
Prompt To Fix With AI
This is a comment left during a code review.
Path: commands/status.md
Line: 7
Comment:
**Nonzero results report missing CLI**
When `tj status` returns 1 for active alerts, this fallback says that `tj` is not installed, causing Claude to recommend installation instead of accurately presenting the alerts. The same pattern in `commands/doctor.md` mislabels warnings, and in `commands/optimize.md` mislabels configuration or validation errors.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| ## Instructions | ||
| Confirm to the user what was torn down (statusline, hooks, OTel env vars) and note that this only removes the CLI's Claude Code wiring, not the tokenjam plugin itself — that's removed separately via `/plugin uninstall tokenjam` or the plugin manager. |
There was a problem hiding this comment.
Failed teardown is confirmed successful
When removal of settings, hooks, environment configuration, files, or the package fails, tj uninstall reports the failure but still exits successfully; these instructions then tell Claude to confirm teardown, causing users to believe components were removed when they remain installed.
Prompt To Fix With AI
This is a comment left during a code review.
Path: commands/uninstall.md
Line: 9-10
Comment:
**Failed teardown is confirmed successful**
When removal of settings, hooks, environment configuration, files, or the package fails, `tj uninstall` reports the failure but still exits successfully; these instructions then tell Claude to confirm teardown, causing users to believe components were removed when they remain installed.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.`claude plugin validate --strict` failed on the previous layout: with .claude-plugin/plugin.json at the repo root, the validator also picked up this repo's own CLAUDE.md (load-bearing dev context for the codebase, not plugin behavior) and flagged it as "not loaded as project context." Relocating the plugin to plugin/ removes the collision without touching CLAUDE.md. A subdirectory plugin root is an officially supported layout (git-subdir marketplace source with a required `path` field), the same pattern claude-plugins-official itself uses for its example-plugin. Adds plugin/README.md documenting install (via a git-subdir source pointing at `path: "plugin"`) and the commands, and updates the root README's pointer accordingly. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Summary
plugin/(plugin/.claude-plugin/plugin.json, nametokenjam) plus five slash commands (/onboard,/status,/optimize,/doctor,/uninstall) that wrap the existingtjCLI entry points — no new Python code, no reimplemented logic.plugin/README.mddocuments install (agit-subdirmarketplace source withpath: "plugin") and the commands.CLAUDE.md(load-bearing dev context, unrelated to plugin behavior) — a subdirectory plugin root is an officially supported layout (git-subdirmarketplace source, same patternclaude-plugins-officialuses for its own example plugin).hooks/hooks.jsonand no.mcp.json:settings.jsononly supports theagentandsubagentStatusLinekeys — there is no plugin-manifest path to the main terminalstatusLine(plugins-reference, "File locations reference"; statusline docs)./onboardgets there by invokingtj onboard --claude-codeinstead.SessionStartresume-brief hook independently in the plugin would risk double-firing againsttj onboard's own idempotent, marker-based hook wiring./onboarddelegates to the existing entry point, so there's exactly one writer of~/.claude/settings.json.tj mcpstays out of the default install — it's built for SDK/API integrations already in the request path; auto-wiring it for Claude Code would contradict the project's own measured decision (+36% token tax) to keep Claude Code users on the zero-token statusline instead.Test plan
claude plugin validate ./plugin— passes clean (✔ Validation passed, no warnings).claude plugin validate ./plugin --strict— passes clean (✔ Validation passed), exit 0.tests/for existing "plugin" references —test_deadweight_plugins.pyetc. cover an unrelated tokenjam feature that prices other installed plugins' token cost, not this repo's own plugin packaging).🤖 Generated with Claude Code