Infracontext.
Infrastructure context for humans and agents.
Keep server details, including services, quirks, dependencies, and past
incidents, as YAML in git. ic briefs you before it connects and
gives AI agents the same information through typed tools.
The problem
The details you learn about a server during an incident are easy to lose once you close the terminal.
$ ssh web-01
connects you blind
- You reconstruct the box from memory: which services, what broke last time
- The wiki page was last touched two migrations ago
- Every incident starts with the same ten minutes of orientation
- Agents check random logs and rediscover your setup every session
- Findings end up in a closed ticket nobody reads again
$ ic ssh web-01
briefs you first, then connects
- Services, dependencies, and the last relevant finding, before your prompt appears
- Agents get the same context as typed MCP tools and Claude Code skills
ic learnrecords what you found in one line- Knowledge stays in git next to your code, where you can diff and review changes
- Fuzzy names and tab completion work from any directory
How it works
Three loosely coupled parts. Each is useful on its own.
you: ic ssh · ctx · status · learn agents: skills · MCP tools
| |
+----------------+-----------------+
|
+-------------+
| ic CLI |
+-------------+
/ | \
reads / writes / SSH \ HTTP
/ | \
+----------------+ +-----------+ +--------------------+
| .infracontext/ | | your | | Prometheus · Loki |
| YAML in git: | | servers | | CheckMK · Monit |
| nodes, edges, | +-----------+ +--------------------+
| learnings |
+----------------+
- The
icCLIThe hot path for humans: connect, get context, record learnings. It handles fuzzy names and tab completion from any directory. - YAML in
.infracontext/One file per node, committed to git. You can edit the files by hand, then diff and review them like code. - Agent integrationsClaude Code skills for USE-method triage, plus an MCP server with typed tools. Agents read the same context and write learnings back.
During an incident
Four commands cover the usual incident workflow.
--json for scripts.
Bare names resolve fuzzily: web finds vm:web-01.
Node IDs support tab completion, and the environment registry lets you
run every command from any directory.
For agents
Typed tools give agents the same infrastructure context before they start triage.
find_node, get_context, query_status, add_learning.
Agents record findings on the node with source: agent.
Access tiers set the permitted operations for each
machine, from local context to full remediation.
Features
Import nodes, map relationships, query monitoring systems, and validate stored data.
Source sync
Import from Proxmox VE, SSH config, Kubernetes, and SOS reports. Sync keeps any triage hints or learnings you added by hand.
Graph analysis
Single points of failure, impact analysis, cycles, orphans. Render the whole graph to HTML, SVG, or GraphML.
Monitoring queries
Prometheus, Loki, CheckMK, and Monit per node, straight from the CLI. --json on every query for scripting.
Federation
Compose repositories: a shared fleet repo for hypervisors, per-app repos on top. Cross-repo references like @fleet:physical_host:pve-01, fleet-wide SPOF and impact analysis.
Access tiers
Choose one of five tiers, from local_only (no SSH) to remediate (may make changes), per node or globally. Agents inherit the setting.
Living documentation
Humans and agents record findings as learnings on the node. Those learnings stay in git with the node and are available during the next incident.
Local overrides
Machine-specific settings (SSH aliases, source paths) live in .infracontext.local.yaml, which git ignores so those values stay out of the shared repo.
Doctor
ic doctor validates schemas, configuration, cross-repo references, and consistency between node IDs and file paths. If it finds broken data, it reports the issue instead of throwing a traceback.
Node YAML
A node needs only an ID and SSH alias before you can use it for triage.
version: "2.0" id: "vm:web-01" slug: web-01 type: vm name: "Production Web Server" ssh_alias: "acme-web01" triage: services: [nginx, php8.2-fpm] context: | Peak traffic 5-7pm weekdays. If CPU high, check PHP-FPM pool first. observability: - type: prometheus instance: web-prod:9100 - type: loki selector: '{service_name="web-prod"}' learnings: - date: "2026-06-12" context: "high CPU after deploy" finding: "Cold OPcache spikes CPU ~5 min after each deploy" source: agent
Keep triage hints minimal. Document setup details that would be costly, slow, or unsafe to rediscover from standard logs and commands.
The ic CLI
The CLI, built with Python and Typer, lets you document infrastructure and use that context while working on it.
Access tiers
Control what the agent is allowed to do on each node.
Quick start
Up and running in four steps.
git clone https://github.com/sysinit-at/infracontext.git # [mcp] bundles the MCP server used in step 4 uv tool install './infracontext[mcp]' # tab completion for node IDs and projects ic --install-completion
cd my-project
ic init
ic describe project create prod
# register once: ic then works from any directory
ic config env add prod . --default
# one step from an SSH alias ic describe node add web-prod # auto-discover via SSH (in Claude Code) /ic-collect web-prod # bulk import ic import ssh-config ic import kubectl ic import sos /path/to/sosreport ic describe source add mypve --type proxmox
# you ic ssh web ic learn web "what you found" # your agents (skills ship in the repo) claude mcp add infracontext -- ic mcp serve /ic-triage web-01 "high CPU" /ic-trace proxy-01 "requests to /api returning 502"
Get started.
Infracontext is open source under the MIT license. Clone the repo, run ic init, and use ic learn to save findings during the next incident.
We use Infracontext to manage customer fleets. Email hello@infracontext.net if you need help with yours.