Skip to content

Commit d91a12d

Browse files
MickaelV0claude
andauthored
feat(plugin): Grok skill, SessionStart hook, and MCP with dual-agent docs (#202)
* feat: ship as a Claude Code plugin marketplace Adds `.claude-plugin/marketplace.json` and `.claude-plugin/plugin.json` so this repo can be installed directly from inside Claude Code: /plugin marketplace add cocoindex-io/cocoindex-code /plugin install cocoindex-code@cocoindex-code The existing `skills/ccc/SKILL.md` is auto-discovered as the plugin's skill — no file moves, the `npx skills add` workflow keeps working unchanged. README gets a short subsection under "Skill (Recommended)" linking the new install path. Refs: https://code.claude.com/docs/en/plugin-marketplaces * chore: point plugin manifests to Roxabi fork Update owner, homepage, repository, and README install command from cocoindex-io to Roxabi/cocoindex-code. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs(plugin): add Grok skill-only install matching Claude Code Document Grok plugin setup (marketplace install + enable) with the same skill-only pattern as the Claude Code plugin: no bundled hooks or MCP. Clarify index freshness is agent-driven via the ccc skill, and note Grok compat MCP disable for users who want CLI/skill search only. All marketplace and manifest URLs point at cocoindex-io/cocoindex-code. * feat(plugin): bundle Grok SessionStart hook and MCP with opt-out docs Add hooks/hooks.json (SessionStart incremental ccc index) and .mcp.json (ccc mcp stdio). Document full Grok install with --trust and how to disable hook and MCP for a skill-only setup matching Claude Code. * docs(readme): clarify single marketplace for Claude and Grok Add an explicit note that one .claude-plugin/marketplace.json serves both agents with the same plugin id and skill; Grok activates hooks/MCP via --trust. * fix(plugin): EOF newlines for pre-commit and clarify Grok install Add trailing newlines to plugin JSON manifests (CI end-of-file-fixer). Document installing via cocoindex-io/cocoindex-code shorthand when the bare plugin name does not resolve from marketplace. --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4f73934 commit d91a12d

5 files changed

Lines changed: 87 additions & 13 deletions

File tree

.claude-plugin/marketplace.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "cocoindex-code",
33
"version": "1.0.0",
4-
"description": "AST-based semantic code search for Claude Code, Cursor, and any skill-compatible coding agent — install in one command.",
4+
"description": "AST-based semantic code search for Claude Code, Grok, Cursor, and any skill-compatible coding agent — install in one command.",
55
"owner": {
6-
"name": "Roxabi",
7-
"email": "mickael@bouly.io"
6+
"name": "CocoIndex",
7+
"email": "hi@cocoindex.io"
88
},
99
"plugins": [
1010
{
1111
"name": "cocoindex-code",
1212
"source": "./",
13-
"description": "Semantic code search skill — wraps the `ccc` CLI to give coding agents AST-aware search over the current codebase.",
13+
"description": "Semantic code search — ccc skill, optional SessionStart index hook, and MCP server (Grok: disable hook/MCP for skill-only).",
1414
"category": "development",
1515
"tags": [
1616
"semantic-search",
@@ -20,8 +20,8 @@
2020
"rag",
2121
"skill"
2222
],
23-
"homepage": "https://github.com/Roxabi/cocoindex-code",
24-
"repository": "https://github.com/Roxabi/cocoindex-code",
23+
"homepage": "https://github.com/cocoindex-io/cocoindex-code",
24+
"repository": "https://github.com/cocoindex-io/cocoindex-code",
2525
"license": "Apache-2.0"
2626
}
2727
]

.claude-plugin/plugin.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"name": "cocoindex-code",
33
"version": "1.0.0",
4-
"description": "AST-based semantic code search via the ccc CLI. Bundles the ccc skill so coding agents handle init, indexing, and search automatically.",
4+
"description": "AST-based semantic code search via the ccc CLI. Bundles the ccc skill; Grok installs also activate a SessionStart index hook and MCP server (disable either for skill-only).",
55
"author": {
6-
"name": "Roxabi",
7-
"email": "mickael@bouly.io"
6+
"name": "CocoIndex",
7+
"email": "hi@cocoindex.io"
88
},
9-
"homepage": "https://github.com/Roxabi/cocoindex-code",
10-
"repository": "https://github.com/Roxabi/cocoindex-code",
9+
"homepage": "https://github.com/cocoindex-io/cocoindex-code",
10+
"repository": "https://github.com/cocoindex-io/cocoindex-code",
1111
"license": "Apache-2.0",
1212
"keywords": [
1313
"semantic-search",
@@ -16,6 +16,7 @@
1616
"rag",
1717
"indexing",
1818
"claude-code",
19+
"grok",
1920
"skill"
2021
]
2122
}

.mcp.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"mcpServers": {
3+
"cocoindex-code": {
4+
"command": "ccc",
5+
"args": ["mcp"]
6+
}
7+
}
8+
}

README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Next, set up your [coding agent integration](#coding-agent-integration) — or j
6363

6464
## Coding Agent Integration
6565

66+
This repository is a **single plugin marketplace** (`.claude-plugin/marketplace.json`) consumed by both **Claude Code** and **Grok** — same plugin id `cocoindex-code`, same `ccc` skill. Grok optionally activates the bundled hooks and MCP server with `--trust`; Claude Code users can install the same marketplace and rely on the skill alone or load hooks/MCP from the plugin as needed.
67+
6668
### Skill (Recommended)
6769

6870
Install the `ccc` skill so your coding agent automatically uses semantic search when needed:
@@ -82,11 +84,59 @@ Works with [Claude Code](https://docs.anthropic.com/en/docs/claude-code) and oth
8284
For Claude Code users, this repository is also a [plugin marketplace](https://code.claude.com/docs/en/plugin-marketplaces). Install the skill from inside Claude Code with:
8385

8486
```text
85-
/plugin marketplace add Roxabi/cocoindex-code
87+
/plugin marketplace add cocoindex-io/cocoindex-code
8688
/plugin install cocoindex-code@cocoindex-code
8789
```
8890

89-
This bundles the same `ccc` skill, with version pinning and `/plugin marketplace update` for updates.
91+
This bundles the same `ccc` skill, with version pinning and `/plugin marketplace update` for updates. The repository also ships `hooks/hooks.json` and `.mcp.json` for Grok (and Claude Code plugin installs that load those files); Claude users who want skill-only search can rely on the skill alone and add MCP manually in the [MCP Server](#mcp-server) section below instead of using the bundled `.mcp.json`.
92+
93+
#### Grok plugin
94+
95+
For [Grok](https://github.com/xai-org/grok) users, install via Grok's plugin system. The plugin bundles three components:
96+
97+
| Component | Purpose |
98+
|-----------|---------|
99+
| **Skill** (`skills/ccc/`) | Agent runs `ccc search` / `ccc index` via the CLI (same as Claude Code above) |
100+
| **Hook** (`hooks/hooks.json`) | `SessionStart` → incremental `ccc index` when `.cocoindex_code/` exists |
101+
| **MCP** (`.mcp.json`) | `ccc mcp` stdio server — `search` tool with `refresh_index=true` by default |
102+
103+
Grok does **not** import Claude's `enabledPlugins` or plugin cache; install separately even if you already use cocoindex in Claude Code.
104+
105+
**Full install** (skill + hook + MCP):
106+
107+
```bash
108+
grok plugin marketplace add cocoindex-io/cocoindex-code
109+
grok plugin install cocoindex-io/cocoindex-code --trust
110+
grok plugin enable cocoindex-code
111+
```
112+
113+
Prefer the GitHub shorthand (`cocoindex-io/cocoindex-code`) for install — `grok plugin install cocoindex-code` can fail when no marketplace plugin matches that bare name.
114+
115+
`--trust` is required so Grok activates the plugin's hooks and MCP server (skills load when the plugin is enabled).
116+
117+
**Skill-only** (match Claude Code — no auto-index hook, no MCP tool):
118+
119+
Install and enable as above, then disable the optional components:
120+
121+
1. **Hooks** — open `/hooks`, select the `SessionStart` hook from `cocoindex-code`, press `Space` to disable.
122+
2. **MCP** — open `/mcps`, select `cocoindex-code`, press `Space` to disable; or persist in `~/.grok/config.toml`:
123+
124+
```toml
125+
[mcp_servers.cocoindex-code]
126+
enabled = false
127+
```
128+
129+
The agent still owns indexing via the `ccc` skill (`ccc index` / `ccc search --refresh` when stale), same as Claude Code.
130+
131+
To avoid importing MCP servers from your Claude/Cursor user config (unrelated to this plugin):
132+
133+
```toml
134+
[compat.claude]
135+
mcps = false
136+
137+
[compat.cursor]
138+
mcps = false
139+
```
90140

91141
### MCP Server
92142

hooks/hooks.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"hooks": [
6+
{
7+
"type": "command",
8+
"timeout": 60,
9+
"command": "command -v ccc >/dev/null && test -d \"${CLAUDE_PROJECT_DIR}/.cocoindex_code\" && (cd \"${CLAUDE_PROJECT_DIR}\" && ccc index) 2>/dev/null || true"
10+
}
11+
]
12+
}
13+
]
14+
}
15+
}

0 commit comments

Comments
 (0)