Claude Code Setup
This guide covers connecting Claude Code to Hoard for seamless data access.
Quick Setup
-
Ensure Hoard server is running
Terminal window hoard serve -
Run the setup command
Terminal window hoard setup --claude -
Confirm instruction injection
If setup is running in an interactive project directory, Hoard prompts to update
CLAUDE.md. -
Restart Claude Code
-
Test the connection In Claude Code, ask: “What MCP tools do you have?”
Remote Hoard Server
If Hoard runs on another machine:
hoard setup remote --url https://hoard.example.com --token hoard_sk_... --claudeFor project-scope configuration:
hoard setup remote --url https://hoard.example.com --token hoard_sk_... --claude --project-scopeInstruction Injection
Hoard can inject a short guidance block into CLAUDE.md so agents consistently use:
memory_writefor stable facts/preferencesinbox_putfor durable notes/documentssyncwhen file changes are not visible yet
Manual control:
hoard instructions --claude --dry-runhoard instructions --claude --yesConfiguration Modes
Hoard supports two configuration modes for Claude Code:
Recommended for personal use
Writes the token directly to ~/.claude.json:
hoard setup --claudeGenerated ~/.claude.json:
{ "mcpServers": { "hoard": { "url": "http://127.0.0.1:19850/mcp", "headers": { "Authorization": "Bearer hoard_sk_544e528b4b1ae6..." } } }}Pros: Works immediately, no extra setup Cons: Token in plaintext (but in user config, not committed to git)
For teams sharing configurations
Uses environment variable in project .mcp.json:
hoard setup --claude --project-scopeGenerated .mcp.json:
{ "mcpServers": { "hoard": { "url": "http://127.0.0.1:19850/mcp", "headers": { "Authorization": "Bearer ${HOARD_TOKEN}" } } }}Required steps:
- Add to
~/.zshrcor~/.bashrc:Terminal window export HOARD_TOKEN="hoard_sk_544e528b4b1ae6..." - Add
.mcp.jsonto.gitignore - Restart terminal and Claude Code
Available Tools
| Tool | Description |
|---|---|
search | Search indexed content |
get | Get full entity content |
get_chunk | Get specific chunk |
memory_get | Retrieve stored context |
memory_put | Store context |
memory_search | Search stored memory |
memory_write | Store structured memory |
inbox_put | Drop a note into the agent inbox |
sync | Trigger a sync |
Verifying the Connection
hoard setup --verifyTroubleshooting
”Connection refused” errors
Ensure the Hoard server is running:
hoard serve --status# If not running:hoard serveTools not appearing
- Verify config exists:
cat ~/.claude.json - Check server URL matches:
http://127.0.0.1:19850/mcp - Restart Claude Code completely
Authentication errors
- Check token is valid:
hoard tokens list - Regenerate if needed:
hoard tokens add claude-code - Re-run setup:
hoard setup --claude
Next Steps
- Codex Setup - Configure Codex
- OpenClaw Setup - Configure OpenClaw
hoard instructions- Instruction injection details