Company as code

A company is going to be a git repository.

Not as a metaphor. A Kortix project is a git repo, and that repo is the company: its agents, the skills it has built up, everything it has learned, and the definition of the machines all of it runs on. Versioned. Diffable. Owned outright.

kortix init · kortix ship · one repo · any model

Configuration
Files in a repo you own
Runtime
OpenCode, declared in the repo
Every change
A commit you can diff and revert
Work lands via
Change request to main
The definition

Two files define the company.

kortix.yaml is the Kortix layer: the machine sessions boot on, the connectors, the triggers, the secret names, and what each agent is allowed to touch. The OpenCode config is the runtime the agents think in. Everything past those two is files in the repo.

kortix.yaml
# Schema version 2. The runtime is OpenCode.kortix_version: 2runtime: opencode project:  name: Northwind # The agent that answers when nothing names one.default_agent: kortix # Where the runtime config lives. Past this: files.opencode:  config_dir: .kortix/opencode # Secret NAMES only. The values are encrypted in the# platform and injected when the machine boots.env:  required: [STRIPE_API_KEY]  optional: [LINEAR_API_KEY] # The machine a session boots on.sandbox:  default: python  templates:    - slug: python      image: python:3.12-slim      cpu: 2      memory: 4 # Reach into the outside world. The definition is in# git. The credentials never are.connectors:  - slug: gmail-read    provider: pipedream    app: gmail    authorization_strategy: user # Governance: what each agent may touch — never what# it says. An omitted grant resolves to none.agents:  kortix:    connectors: all    secrets: all    skills: all    kortix_cli: all   invoice-clerk:    sandbox: python    connectors: [gmail-read]    secrets: [STRIPE_API_KEY]    skills: [reconcile-invoices]    kortix_cli: [project.cr.open]

The Kortix layer — one file, at the repo root.

.kortix/opencode/opencode.jsonc
{  // Docs: https://opencode.ai/docs/  "$schema": "https://opencode.ai/config.json",  "theme": "system",  "default_agent": "kortix",  // The session is already an isolated machine on a  // throwaway branch, so the agent starts wide open.  // Tighten per tool here when you want a stricter  // policy.  "permission": "allow"}

The runtime — models, tools, permissions.

.kortix/opencode/agents/invoice-clerk.md
---description: Reconciles invoices against payments.mode: primarypermission:  bash: ask--- You are the invoice clerk for Northwind. Match every payment to an invoice by number, neverby amount. When you cannot, open a change requestand say exactly what you could not reconcile.

The agent — a stock OpenCode agent file. What it says lives here.

  • kortix.yaml grants

    Which machine, which connectors, which secrets, which skills, which CLI verbs. Governance only. Omit a grant and it resolves to none — an agent gets what you gave it and nothing else.

  • The OpenCode config decides

    Prompts, models, tools, plugins and permissions. An agent is a stock OpenCode agent — markdown at baseline, and past that the tools, plugins and model config sitting beside it in the same repo. Read the directory and you know exactly what that agent will do.

  • Neither file holds a secret

    The manifest names secrets and grants them per agent. The values are encrypted in the platform, injected into the machine at runtime, and never written to the repo or the logs.

Open the repo

The company is right there, in plain text.

Agents, skills and memory are not rows in a database you cannot see. They are markdown files next to your code, cloned into every session, readable by a person and editable by an agent.

  • northwind/the repo, and the company
  • kortix.yamlthe Kortix layer
  • .kortix/
  • memory/
  • MEMORY.mdwhat the company has learned
  • opencode/
  • opencode.jsoncthe runtime agents think in
  • agents/one OpenCode agent per file
  • kortix.md
  • invoice-clerk.md
  • skills/how this company does a job
  • reconcile-invoices/
  • SKILL.mdread once, used every session
  • tools/the tools you wrote yourself
  • plugins/and the ones you installed
  • src/and the rest of your repo

And what is deliberately not in it

Secret values
The repo holds names and grants. The values are encrypted in the platform and injected when a machine boots.
Channel routing
Which Slack or Teams channel reaches which agent is live project state, set in the dashboard. Connecting one adds a connector the agents can call.
Live session state
A session runs on its own machine on its own branch. Nothing it does touches the repo until it commits and opens a change request.
Auditable

grep your whole company.

There is no hidden layer to ask about. Every belief, every permission and every instruction is a line in a file, and the tools you already use answer the question.

northwind — main
# what does the company believe about pricing?$ grep -ri "annual" .kortix/memoryMEMORY.md: never quote annual before the security review # who is allowed to touch the Stripe key?$ grep -n "STRIPE_API_KEY" kortix.yaml18:  required: [STRIPE_API_KEY]48:    secrets: [STRIPE_API_KEY] # who changed the invoice clerk, and when?$ git log --oneline .kortix/opencode/agents/8f2a1c4  invoice-clerk: stop guessing at refunds1d90b73  invoice-clerk: first draft of the persona

One search, whole company

Every agent prompt, every skill, every remembered fact and every grant is text in one repo. No console to click through, no export to request.

History you can prove

Every change to an agent, a skill or a memory file is a commit with an author, a timestamp and a diff. Nothing vanishes and nothing happens in the dark.

Undo is git revert

A bad instruction went in on Tuesday? Read the diff, revert the commit, open a change request. The company goes back to how it was.

Every change is reviewed

The company learns one approved commit at a time.

When an agent works out a better way to do the job, it does not quietly remember it. It edits the skill, commits it on its own branch, and opens a change request. A person reads the diff and decides.

Change request9f4c2b7e → main·opened by invoice-clerk

skill: reconcile-invoices — handle partial refunds

.kortix/opencode/skills/reconcile-invoices/SKILL.md+5 −1
## Matching a payment to an invoice 1. Pull the invoice by number, never by amount.2. If the amounts differ, flag it for a human.2. If the difference matches a refund already on   file, close it as a partial refund and note the   refund id on the invoice.3. If they differ for any other reason, flag it for   a human and say what you checked. Never issue a refund yourself.
Reviewed by a person, then merged to main

A prompt change looks like a code change

An agent rewriting its own instructions arrives the same way a database migration does: a branch, a commit, a diff, a reviewer. The company has one review process, not two.

Nothing merges itself

The machine can propose. A person decides. Work reaches main only through a change request someone approved, so the company cannot drift while you are not looking.

It improves itself

The company files patches against itself.

An agent can read its own configuration, edit it, and propose the change. Put that on a schedule and the repo gets better at being your company while everyone is asleep.

kortix.yaml — triggers
agents:  memory-reflector:    # it may open a change request. Nothing else.    kortix_cli: [project.cr.open] triggers:  - slug: memory-reflector    name: Memory reflector    type: cron    agent: memory-reflector    enabled: false    cron: "0 0 3 * * *"    timezone: UTC    prompt: |      Reflect on the last 24 hours of project      activity. Review git history, merged change      requests and session digests. Update      .kortix/memory/ and open one change request      titled `memory: ...`. Exit without one when      there is no durable knowledge.

From the starter template. Every new project ships with it, switched off.

  1. 00

    You switch it on

    Flip enabled to true and it fires at 03:00 UTC, with nobody watching. Triggers are cron schedules and signed webhooks, declared in the same file as everything else.

  2. 01

    A session starts

    It gets its own cloud computer and its own branch, holding exactly the one grant the manifest gave it: permission to open a change request.

  3. 02

    It edits the company

    It reads the git history and the sessions of the last day, then writes what it learned into .kortix/memory/ as plain markdown.

  4. 03

    You get a diff

    One change request, waiting in the morning. Merge it and the company knows something new. Close it and nothing happened.

Yours to take

It is a git repo. It does what git repos do.

No export flow, no support ticket, no proprietary format to unpick. The company is already text on a branch, so it clones, forks, reverts, and walks out the door with you.

any directory, any machine
# turn any directory into a Kortix$ kortix init # check it compiles, ask for the missing secrets,# push it up, and bring the whole thing live$ kortix ship # from here it is just a repo$ git clone git@github.com:northwind/northwind.git$ git revert 8f2a1c4$ kortix cr
A company you can clone
Fork it for a second business unit. Branch it to try a different set of agents. Hand the whole thing to a new team and they get the skills, the memory and the grants with it.
The same on a laptop as in the cloud
kortix init scaffolds it, kortix ship brings it live. It is the same repo doing the same thing, so local development and the live system stopped being different categories.
Any model, your own keys
Bring any provider, or the ChatGPT, Claude or Cursor subscription you already pay for. The model is configuration in your repo, not a decision a vendor makes for you.
Open source and self-hostable
Run it on Kortix Cloud, in your own VPC, or fully on-prem. Read the code, fork it, audit it. Nobody rents your company back to you.
One repo

Turn a directory into a company.

kortix init makes any directory a Kortix. kortix ship brings it live. From then on it is one repo you own — versioned, diffable, and improving itself one reviewed change at a time.

Company as Code | Kortix