--- title: Host Context Detection created: 2026-04-28 updated: 2026-04-28 type: concept tags: [concept, homelab, agents] confidence: high --- # Host Context Detection Detects which host's filesystem a repository clone represents, enabling AI agents to understand their operational context without asking. ## Quick Reference | Host | IP | Context | Agent | Port | |------|-----|---------|-------|------| | **ubuntu** | 192.168.50.61 | ubuntu | OpenCode | 4096 | | **grizzley** | 192.168.50.84 | grizzley | Hermes | 8644 | | **ice** | 192.168.50.197 | ice | OpenCode | 4096 | ## Detection Methods ```bash # Via Python python3 scripts/detect_host_context.py # Via Shell source scripts/load-host-context.sh ``` ## Context Files | File | Purpose | |------|---------| | `.host-context` | Context marker per host (gitignored) | | `scripts/detect_host_context.py` | Python detector | | `scripts/load-host-context.sh` | Shell loader | ## Agent Integration | Agent | Harness | Context Detection | |-------|---------|-------------------| | OpenCode | systemd | `.opencode/opencode.json` init | | Hermes | systemd | Runs on grizzley (implicit) | | Claude Code | CLI | direnv / shell env | | Cline | VS Code | Terminal env | ## Related - [[opencode-cluster|OpenCode cluster]] — OpenCode instances across the cluster - [[hermes-gateway|Hermes gateway]] — runs on grizzley - [[forge-ai|Forge AI]] — ForgeCode CLI coding harness