How the agent works
Cosine is an AI software engineering agent that plans, writes, tests, and submits code by interacting with your existing repositories and tools.
The agent loop
Section titled “The agent loop”When you give Cosine a task, it follows a loop of reasoning, tool use, and response:
- Read context — Cosine reads files, searches the codebase, and consults memory to understand the current state.
- Plan — For larger or ambiguous tasks, Cosine may pause to propose a plan before making changes.
- Act — Cosine edits files, runs terminal commands, uses MCP tools, or delegates to subagents.
- Validate — Cosine checks its work by running tests, reviewing diffs, or asking for your confirmation.
- Respond — Cosine reports back with a summary, asks clarifying questions, or asks for your approval before continuing.
Tools Cosine can use
Section titled “Tools Cosine can use”Cosine has access to a set of tools depending on the surface and configuration:
- File system — Read, write, search, and navigate your codebase
- Terminal — Run shell commands in the task environment
- LSP — Go-to-definition, find references, diagnostics
- Browser — Navigate, screenshot, and extract data from web pages
- MCP — Connect to external tools and APIs via Model Context Protocol servers
- Git — Create commits, branches, and pull requests
- Memory — Save and recall project conventions and user preferences
Surfaces
Section titled “Surfaces”Cosine operates in multiple surfaces, each optimized for different workflows:
- Cloud — Browser-based workspace for reviewing, planning, and managing tasks
- CLI — Terminal user interface for local development and fast iteration
- Desktop — Native app combining local file access with a visual workspace
- VS Code — Extension for working inside your editor
Each surface shares the same agent core but exposes different controls and workflows. See Ways to use Cosine for a comparison.
Configuration layers
Section titled “Configuration layers”Cosine reads configuration from multiple sources, in order of precedence:
- Command-line flags — Highest priority, per-session overrides
- Repository config — Project-specific settings in
cosine.tomlor.cosine.toml - User config — Personal settings in
~/.cosine.toml - Environment variables — System-level overrides
- Defaults — Built-in defaults (lowest priority)
This layered approach lets you set team-wide conventions in repo config, keep personal preferences in user config, and override everything on the command line when needed.
Next steps
Section titled “Next steps”- Tasks and sessions — How work is structured and persisted
- Agents, modes and swarm — How behavior changes across modes
- CLI Overview — Get started with the terminal interface
- Cloud Overview — Get started in the browser