One command. Full project context. For AI agents.
Stop your agents from burning tokens on discovery. devctx gives Claude Code, Hermes, and any AI agent a structured snapshot of your entire dev environment in a single call.
$ devctx{
"services": {
"hermes-gateway": { "port": 8642, "status": "listening", "pid": 4821 },
"postgres-alt": { "port": 5433, "status": "listening" },
"redis/dragonfly": { "port": 6379, "status": "listening" }
},
"git": {
"hermes-agent": { "branch": "improve/cycle-13", "dirty": false, "ahead": 2 },
"my-app": { "branch": "main", "dirty": true, "changed_files": 3 }
},
"deploy": {
"railway": { "projects": [{ "name": "my-api", "id": "abc123" }] }
},
"env": {
"set": ["ANTHROPIC_API_KEY", "GITHUB_TOKEN"],
"missing": ["OPENAI_API_KEY"]
},
"hints": [
"hermes-agent has 2 unpushed commit(s) on improve/cycle-13",
"my-app has 3 uncommitted change(s)",
"missing env vars: OPENAI_API_KEY"
]
}AI agents waste tokens discovering your environment through trial and error — checking ports, running git status on every repo, probing for services, retrying when something's down. Each discovery call re-sends the full conversation history.
devctx eliminates the discovery phase entirely.
| Without devctx | With devctx | |
|---|---|---|
| Tool calls to orient | 5-15 | 1 |
| Tokens on discovery | 2,000-8,000+ | ~500 |
| Retry loops from missing context | Common | Eliminated |
| Works across agents | Manual per-agent | Universal |
pip install devctxOr install from source:
git clone https://github.com/DevvGwardo/devctx.git
cd devctx
pip install .# Full snapshot (default)
devctx
# Specific sections
devctx --services # Running services & ports
devctx --git # Git state across repos
devctx --deploy # Railway, DigitalOcean status
devctx --env # Environment variable health
devctx --hints # Agent-friendly hints only
# Options
devctx --scan-dir ~/projects --scan-dir ~/work # Custom scan directories
devctx --check-env MY_CUSTOM_VAR # Check additional env vars
devctx --compact # Minified JSON outputdevctx ships with a built-in MCP server so any MCP-compatible agent can call it as a tool.
Add to Claude Code:
claude mcp add devctx -- devctx-mcpAdd to Hermes (~/.hermes/config.yaml):
mcp_servers:
devctx:
command: devctx-mcpThe MCP server exposes a single tool — get_dev_context — that returns the same structured JSON as the CLI.
Note: MCP subprocesses don't inherit interactive-shell environment variables. To ensure API keys and other secrets appear in the env section, put your exports in ~/.zshenv (not ~/.zshrc), or on macOS use launchctl setenv VAR value to persist them across login and non-login shells.
Add to your CLAUDE.md or agent system prompt:
At the start of every task, run `devctx` to understand the current environment.
Use the `hints` field to inform your approach before writing any code.
| Collector | What it checks | How |
|---|---|---|
| services | Running services on known ports, Docker containers | Socket probing, lsof, docker ps |
| git | Branch, dirty state, ahead/behind, last commit | git CLI across scanned directories |
| deploy | Railway projects, DigitalOcean droplets | Config files + CLI tools |
| env | Presence of expected environment variables | os.environ (values never exposed) |
| hints | Agent-actionable insights from all of the above | Aggregation + heuristics |
Drop a new file in devctx/collectors/, implement a collect_*() function that returns a dict, and wire it into cli.py:snapshot(). That's it.
Inspired by InsForge's context engineering approach:
- One call, full picture — No sequential discovery. The agent gets everything it needs in ~500 tokens.
- Structured output — JSON that agents can parse, not free text that needs interpretation.
- Hints, not just data — The
hintsfield tells the agent what to do, not just what is. - Security by default — Environment variables report presence only, never values. No secrets in output.
- Agent-agnostic — Works with Claude Code, Hermes, any MCP client, or plain
bash.
MIT


