> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hydradb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Grok Build

> Give Grok Build, xAI's coding agent, long-term memory with the HydraDB plugin.

The HydraDB plugin gives [Grok Build](https://docs.x.ai/build/overview), xAI's
coding agent, long-term memory. Grok Build supports the same hooks as Claude
Code, so the plugin recalls context before each prompt.

| Grok Build hook | Engine action |
| - | - |
| `SessionStart` | print status + async workspace sync |
| `UserPromptSubmit` | recall memory/knowledge, inject as `additionalContext` |
| `PostToolUse` (file writes) | incremental workspace sync |
| `Stop` | capture the completed turn |

**1. Set credentials**

```bash theme={"dark"}
export HYDRADB_API_KEY="your-api-key"
export HYDRADB_DATABASE="your-database"
```

**2. Install in Grok Build**

The [`xai-org/plugin-marketplace`](https://github.com/xai-org/plugin-marketplace)
listing is in review. Once merged, `/marketplace` browses and installs it from
the catalog. To run it from the local checkout today, follow the
[plugin README](https://github.com/hydra-db/hydradb-grok-plugin).

**MCP alternative:** `grok mcp add hydradb --url https://mcp.hydradb.com`. The
plugin already gives automatic recall, so MCP is optional.

It runs on the same engine as the [Claude Code plugin](/plugins/claude-code.md), so the [modes](/plugins/claude-code.md#modes) and [config variables](/plugins/claude-code.md#config-variables) there apply here too.

## Feedback and contributions

This plugin is open source. Feel free to [raise an issue](https://github.com/hydra-db/hydradb-grok-plugin/issues) or [contribute on GitHub](https://github.com/hydra-db/hydradb-grok-plugin).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.