Set up Claude Code as your terminal coding agent
Install Claude Code, teach it your project with a CLAUDE.md file, and run it interactively or as a scripted, headless agent.
A coding agent in your terminal that can read your repo, make changes, run commands, and be scripted for automation.
A coding agent is different from autocomplete. You describe an outcome, and it reads files, edits them, runs your tests, and reports back. Claude Code is one of the most widely used; the habits you build here carry over to any other coding agent.
A Claude subscription or an Anthropic API key, and a project folder (any language) under git.
Install it
macOS, Linux, or WSL:
curl -fsSL https://claude.ai/install.sh | bashWindows PowerShell:
irm https://claude.ai/install.ps1 | iexHomebrew and npm also work: brew install --cask claude-code or npm install -g @anthropic-ai/claude-code.
Start it in a project
cd your-project
claudeThe first run opens a browser to sign in. Then ask a question that requires reading code, such as "Explain how requests flow through this app." Nothing is changed yet; this is the safest way to see what it understands.
Give it a memory of your project
Inside the session, run:
/initThis writes a CLAUDE.md file: how to build, test, and lint the project, plus conventions it noticed. The file is loaded at the start of every session, so edit it like onboarding notes for a new teammate. Short and specific beats long.
Ask for a real change
Add input validation to the signup form and write tests for it. Run the tests.By default Claude Code asks before editing files or running commands. Read what it proposes. Approve one step at a time until you trust it on this codebase.
The best prompts name the goal, the constraints, and how to verify. "Make the tests in tests/api pass without changing the public API" will beat "fix the bug" every time.
Run it without the chat
Print mode runs one prompt and exits, which makes the agent scriptable:
claude -p "Summarize what changed in the last 5 commits"You can pipe into it too:
git diff main | claude -p "Review this diff for bugs. Be brief."That one line is the seed of real automation: put it in a git hook, a cron job, or CI.
Add tools with MCP
Claude Code can use any MCP server. For example, to give it a browser:
claude mcp add playwright npx @playwright/mcp@latestThe MCP guide covers this properly.
What to do next
Schedule it: run an AI agent every week with GitHub Actions.
Sources
Open-source tools change quickly. Commands here were checked on Nov 14, 2026; if one fails, the project's README is the source of truth.