With the terminal and tmux in place, the workspace is ready - but the
workspace is only as useful as what runs inside it. These days, that
increasingly means an AI agent. There are so many AI-related articles and
how-tos out there that I wouldn't dare write another one. In this article I only
want to share a few notes on working with AI agents fully in the terminal - for
example, the MCP configuration when working on a remote machine (as described in
build-anywhere).
The way of working with AI agents entirely in the terminal is also a bit different from GUI apps like Cursor.
Working with an LLM in the terminal
When running prompts in tools like Claude Code there is no straightforward way
to review and accept every change as it happens. That's why I suggest getting
familiar with git and using it as a safety net and a way to control all
changes made to the source code. I use bare git in my terminal, but I know
there are some terminal-based tools that aim to make it more friendly. I
personally see value in plain git. Using its commands on a daily basis builds
more confidence when I need to use it inside some CI/CD scripts. The main idea
is that whenever there is a batch of changes generated by a prompt, I simply
review them with git diff. When the changes are large, I tend to open a PR on
a platform like GitHub. This is especially useful because it allows writing
comments on specific lines, and tools like Claude Code (using GitHub CLI)
can then easily download those comments and apply the required changes.
MCP configuration
Personally, I try to use as many CLI tools as possible, but in some cases MCP
is the only proper way to integrate an AI agent. For example, when working with
the frontend, Chrome MCP can save a lot of time. The tricky part is how to
configure it if you work in the terminal on a remote machine. To do this, add
the following to the .claude.json file:
"mcpServers": {
"chrome-devtools": {
"type": "stdio",
"command": "npx",
"args": [
"chrome-devtools-mcp@latest",
"--browserUrl",
"http://localhost:9222"
],
"env": {}
}
}Enabling Chrome remote debug
For any of this to work, something needs to actually listen on port 9222 on your local machine. That means starting Chrome with remote debugging enabled. On Windows:
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="C:\Users\{My USER}\chrome-debug"The command is similar on other systems. The important part is passing
--user-data-dir alongside the debug port - recent Chrome versions require
both, and it took me a while to track this down, so I want to share it here.
Also note that the SSH connection has to be established with the
-R 9222:localhost:9222 port forwarding option
(link).
Comments