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
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 personal configuration and runtime overrides in this order:
- Command-line flags — Highest priority, per-session overrides
- Personal profile —
config.tomlor the selectedconfig.<name>.tomlin the platform-specific Cosine config directory - Build and code defaults — Built-in distribution defaults
Explicit runtime flags override the selected personal profile. The legacy repository files cosine.toml and .cosine.toml are deprecated and retained only for existing project-automation features such as hooks, LSP settings, extra context, and project skills. They do not select profiles, credentials, inference endpoints, or models.
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