Piotr Sobczak · AI Engineer · jak pracuję z agentem Piotr Sobczak · AI Engineer · how I work with an agent

Drugi mózg Second brain

Cały kontekst pracy, projekty, klientów, decyzje i lekcje, trzymam w plikach Markdown w jednym repozytorium. Agent czyta je na starcie każdej sesji, zapisuje decyzje w trakcie i zostawia prompt na następną sesję. Nic nie żyje w czacie.

All my working context, projects, clients, decisions and lessons, lives in Markdown files in one repository. The agent reads them at the start of every session, writes down decisions along the way and leaves a prompt for the next session. Nothing lives in the chat.

NarzędzieTool Claude Code w terminalu Claude Code in the terminal
RytmRhythm codziennie, każda sesja w każdym terminalu kończy się zapisem every day, every session in every terminal ends with a save
Po coWhy żeby ciągłość pracy nie wisiała na mojej pamięci so continuity does not hang on my memory
GdzieWhere jedno prywatne repozytorium git one private git repository

Na czym to się trzymaWhat this rests on

Zasada 1Rule 1

Pliki, nie czat

Files, not chat

Każda decyzja, każdy fakt od klienta, każda lekcja trafia do pliku w trakcie sesji, nie na koniec. Czat jest ulotny, plik ma datę, autora i historię zmian.

Every decision, every fact from a client, every lesson goes into a file during the session, not at the end. Chat is fleeting, a file has a date, an author and a change history.

Zasada 2Rule 2

Hierarchia prawdy

Hierarchy of truth

Rzeczywistość bije dokumentację. Wśród dokumentów najpierw instrukcje główne, potem mapa projektów, potem pamięć. Gdy dwa pliki się nie zgadzają, wygrywa wyższy, i to jest spisane.

Reality beats documentation. Among documents, the main instructions come first, then the project map, then memory. When two files disagree, the higher one wins, and that is written down.

Zasada 3Rule 3

Jeden router na start

One router at the start

Agent nie szuka po omacku. Instrukcje główne dostaje od narzędzia sam z siebie, więc pierwsza komenda, którą piszę, to przeczytanie mapy projektów. Z niej trafia do właściwego folderu i do ostatniego stanu. Bez tego zgaduje. Otwiera nie ten folder, pracuje na stanie sprzed tygodnia i dopisuje do tego wnioski. Przekonałem się na własnej skórze, stąd ta reguła.

The agent doesn't search blindly. The tool loads the main instructions on its own, so the first command I type is to read the project map. From there it goes to the right folder and to the last state. Without the router the agent guesses. It opens the wrong folder, works from a week-old state and draws conclusions on top of it. I learned that the hard way, hence the rule.

Jak wygląda repozytoriumWhat the repository looks like

Jedno repozytorium git, prywatne. Struktura jest ta sama dla produktu, dla klienta i dla badania rynku, dlatego agent nie musi się uczyć nowego układu przy każdym temacie.

One git repository, private. The structure is the same for the product, for a client, and for market research, so the agent doesn't have to learn a new layout for every topic.

.claude/
├── CLAUDE.md                  kim jestem, zasady pracy, tabela "słowo → który plik czytać"
├── projekt/
│   ├── STRUKTURA.md           router #0: mapa projektów (aktywne / narzędzia / wstrzymane / zamknięte)
│   ├── CLAUDE-REFERENCE.md    procedury: deploy, kopie, weryfikacja UI, klucze (gdzie, nie jakie)
│   └── sessions/
│       ├── <projekt>/
│       │   ├── MASTER-STATUS.md       stan: identyfikacja, decyzje, pipeline, Last / Next
│       │   ├── WIKI.md                co to jest, słownik, decyzje architektoniczne
│       │   ├── CONTINUATION-<data>.md prompt do wklejenia w nowej sesji: stan, zadania, bramki
│       │   ├── SKRZYNKA-TERMINALI.md  poczta między oknami pracującymi nad tym samym
│       │   ├── docs/  research/  transkrypcje/  correspondence-*.txt
│       │   └── leads/<firma>/         to samo, poziom niżej: jeden folder na jedną rozmowę z firmą
│       └── ... kolejne foldery: produkt, klienci, badania rynku, narzędzia
├── memory/                    jeden plik = jeden fakt, nagłówek: typ, opis
│   ├── MEMORY.md              indeks, jedna linia na fakt, ładowany do każdej sesji
│   └── feedback-*.md  user-*.md  project-*.md  reference-*.md
├── agents/   skills/   hooks/  role z modelem, metody, skrypty strażników wpięte w ustawienia
└── .git                       pełna historia zmian, każdy commit z opisem po ludzku
.claude/
├── CLAUDE.md                  who I am, working rules, a table "word → which file to read"
├── projekt/
│   ├── STRUKTURA.md           router #0: project map (active / tools / paused / closed)
│   ├── CLAUDE-REFERENCE.md    procedures: deploy, backups, UI checks, keys (where, not what)
│   └── sessions/
│       ├── <project>/
│       │   ├── MASTER-STATUS.md       state: who the client is, decisions, pipeline, Last / Next
│       │   ├── WIKI.md                what it is, glossary, architecture decisions
│       │   ├── CONTINUATION-<date>.md prompt to paste into a new session: state, tasks, gates
│       │   ├── SKRZYNKA-TERMINALI.md  mail between windows working on the same thing
│       │   ├── docs/  research/  transkrypcje/  correspondence-*.txt
│       │   └── leads/<company>/       the same, one level down: one folder per conversation with a company
│       └── ... further folders: product, clients, market research, tools
├── memory/                    one file = one fact, header: type, description
│   ├── MEMORY.md              index, one line per fact, loaded into every session
│   └── feedback-*.md  user-*.md  project-*.md  reference-*.md
├── agents/   skills/   hooks/  roles with a model, methods, guard scripts wired into the settings
└── .git                       full change history, every commit with a human-readable description

The file names are the real ones, in Polish where I named them in Polish.

Warstwa 1 · InstrukcjeLayer 1 · Instructions

CLAUDE.md, czyli kto i jak

CLAUDE.md, who and how

Krótki plik, poniżej dwustu linii, bo powyżej agent zaczyna gubić własne zasady. Kim jestem, jak ze mną pracować, zasady (spec przed kodem, przegląd człowieka przed scaleniem, commit za zgodą), i tabela, która mówi agentowi, jakie słowo w moim poleceniu oznacza, który plik ma otworzyć. Słowo "wdrożenie" ładuje stan wdrożenia, nazwa klienta ładuje jego folder. Agent nie zgaduje.

A short file, under two hundred lines, because above that the agent starts losing its own rules. Who I am, how to work with me, the rules (spec before code, human review before merge, commit only when I say so), and a table that tells the agent which word in my request means which file to open. The word "deployment" loads the deployment state, a client's name loads their folder. The agent doesn't guess.

zasady pracyworking rules tabela słowo → plikword → file table hierarchia prawdyhierarchy of truth ekonomia modelimodel economics
Warstwa 2 · MapaLayer 2 · Map

STRUKTURA.md, czyli gdzie co leży

STRUKTURA.md, what's where

Tabela wszystkich projektów, ze ścieżką, jednym zdaniem o czym, miejscem stanu i bramką. Osobno aktywne, narzędzia, wstrzymane i zamknięte, z powodem zamknięcia i lekcją. Ten plik czyta się jako pierwszy w każdej sesji i to on zatrzymuje dryf między tematami.

A table of every project, with the path, one sentence on what it is, where the state lives and what the gate is. Separately active, tools, paused and closed, with a reason for closing and a lesson. This file is read first in every session, and it's what stops drift between topics.

aktywneactive wstrzymanepaused zamknięte + lekcjaclosed + lesson repozytoria zewnętrzneexternal repositories infrastrukturainfrastructure
Warstwa 3 · ProjektLayer 3 · Project

Folder projektu, czyli stan i historia

Project folder, state and history

MASTER-STATUS to jeden plik z tym, co wiemy, co postanowiliśmy i kiedy, co jest w toku i co dalej. Pod nim badania, transkrypcje rozmów, korespondencja z datami, dokumenty. Dla rozmowy z firmą to samo, folder niżej, czyli brief, przygotowanie do spotkania, oferta, draft umowy, log wiadomości. Ktokolwiek wejdzie do folderu, wie, na czym stoimy.

MASTER-STATUS is one file with what we know, what we decided and when, what's in progress and what's next. Below it, research, call transcripts, dated correspondence, documents. For a conversation with a company, the same thing one level down, meaning brief, meeting prep, offer, draft contract, message log. Whoever opens the folder knows where things stand.

MASTER-STATUS CONTINUATION research/ korespondencjacorrespondence transkrypcjetranscripts
Warstwa 4 · PamięćLayer 4 · Memory

memory/, czyli jeden fakt na plik

memory/, one fact per file

Nie historia projektu, tylko fakty, które mają przetrwać projekty. Kim jestem i jak lubię pracować, poprawki, które mi dał człowiek ("nie usuwaj masowo, proponuj"), stałe ustalenia, odnośniki. Pamięć faktów jest wbudowana w narzędzie, jeden plik na fakt i indeks ładowany do każdej sesji. Domyślnie zostaje na jednym komputerze, więc trzymam ją w repozytorium i jedzie razem z resztą. Dopisałem do niej jedną rzecz, której narzędzie nie daje, czyli regułę, że fakt obalony się kasuje, a nie poprawia w nieskończoność.

Not a project history, just facts meant to outlive projects. Who I am and how I like to work, corrections a human gave me ("don't mass-delete, propose"), standing decisions, references. The fact memory is built into the tool, one file per fact and an index loaded into every session. By default it stays on one machine, so I keep it in the repository and it travels with everything else. I added one thing the tool does not give, the rule that a fact proven wrong gets deleted rather than patched forever.

useruser feedbackfeedback projectproject referencereference MEMORY.md = indeksMEMORY.md = index

Od promptu do commitaFrom prompt to commit

Sesja ma początek, środek i koniec, i każdy z nich zostawia ślad w plikach. Następna sesja startuje od pliku, który zostawiła poprzednia, nie od mojej pamięci.

A session has a beginning, a middle and an end, and each of them leaves a trace in the files. The next session starts from the file the previous one left, not from my memory.

StartStart

Prompt z pliku

Prompt from a file

Wklejam prompt, który zostawiła poprzednia sesja. Agent czyta mapę projektów, potem folder, potem ostatni stan.

I paste in the prompt the previous session left. The agent reads the project map, then the folder, then the last state.

  • przeczytaj router
  • przeczytaj stan projektu
  • zadania w kolejności
  • bramki, czego nie wolno
  • read the router
  • read the project state
  • tasks in order
  • gates, what's not allowed
PracaWork

Zapis w trakcie

Writing as I go

Decyzja pada, decyzja idzie do pliku, z datą. Fakt od klienta idzie do logu korespondencji. Większa robota idzie jako brief do innego okna, wraca jako raport. Spec zanim kod, czyli problem, czego nie robimy, kryteria akceptacji. Testy piszę z tych kryteriów, więc spec jest jednocześnie listą rzeczy do sprawdzenia.

A decision is made, the decision goes into a file, with a date. A fact from a client goes into the correspondence log. Bigger work goes to another window as a brief and comes back as a report. Spec before code, meaning the problem, the non goals and the acceptance criteria. I write the tests from those criteria, so the spec doubles as the checklist.

  • spec zanim kod
  • przeklikanie w przeglądarce
  • lekcja od razu do pamięci
  • nic nie wysyła się samo
  • spec before code
  • clicking through the app in the browser
  • a lesson goes into memory right away
  • nothing sends itself
KoniecEnd

Zamknięcie

Closing

Aktualizacja stanu, prompt na następną sesję, wpis do skrzynki dla innych okien, commit z opisem po ludzku, push.

State update, a prompt for the next session, an entry in the mailbox for other windows, a commit with a human-readable message, push.

  • MASTER-STATUS: Last / Next
  • CONTINUATION z promptem
  • skrzynka
  • git push
  • MASTER-STATUS: Last / Next
  • CONTINUATION with the prompt
  • mailbox
  • git push
# PRZYKŁAD PROMPTU NA START (skrócony, z prawdziwego pliku, wdrożenie u klienta) Read .claude/projekt/STRUKTURA.md. Potem, w tej kolejności: (1) sessions/<projekt>/MASTER-STATUS.md (pipeline: wpisy z ostatnich dwóch dni, Last/Next), (2) CHANGELOG, (3) skrzynka, (4) raport z ostatniej kontroli. STAN: kolejna paczka wdrożona w piątek. Kontrola dnia po: zero błędów w logach, kopia zapasowa zrobiona, zespół klienta klika na środowisku testowym. ZADANIA w kolejności: 1. kontrola dnia po raz drugi (logi, kopia, pamięć serwera), wynik do raportu, 2. poprawka z uwag zespołu jako PR na gałęzi, testy z kryteriów akceptacji, 3. przeklikanie w przeglądarce przed prośbą o przegląd, 4. wpis do skrzynki dla okna strategicznego. BRAMKI: deploy tylko za moim OK; nic ręcznie na serwerze; migracja bazy tylko po zrzucie; dane klienta nie opuszczają jego folderu; nic nie idzie do klienta, zanim tego nie przeczytam.
# EXAMPLE START PROMPT (shortened, from a real file, a client deployment) Read .claude/projekt/STRUKTURA.md. Then, in this order: (1) sessions/<project>/MASTER-STATUS.md (pipeline: entries from the last two days, Last/Next), (2) CHANGELOG, (3) mailbox, (4) report from the last check. STATE: the next batch was deployed on Friday. Day-after check: zero errors in the logs, backup done, the client's team is clicking through on the test environment. TASKS in order: 1. day-after check again (logs, backup, server memory), result into the report, 2. fix from the team's feedback as a PR on a branch, tests from the acceptance criteria, 3. clicking through in the browser before asking for a review, 4. entry in the mailbox for the strategy window. GATES: deploy only with my OK; nothing by hand on the server; database migration only after a dump; client data doesn't leave its folder; nothing goes to the client before I have read it.

Terminale rozmawiają przez plikiTerminals talk through files

Nad jednym tematem pracuje kilka okien, jedno strategiczne (plan dnia, decyzje), jedno wykonawcze (kod, dokumenty), czasem osobne do badań. Okna mają rozdzielone role i rozdzielone pliki, żeby nie wchodziły sobie w edycje. Nie dzielą pamięci, więc dostały pocztę, plik skrzynki w folderze projektu. Wpis ma dwie do pięciu linii, datę, nadawcę, co się stało i gdzie leży szczegół. Adresat dopisuje status. Duże rzeczy idą osobnym plikiem, brief w jedną stronę, raport w drugą, skrzynka tylko wskazuje. Narzędzie ma dziś własny kanał między sesjami i czasem go używam, ale trwały ślad zostaje w pliku. Wiadomość znika razem z sesją, wpis w repozytorium przeczyta jutro ktokolwiek.

Several windows work on one topic, one strategic (day plan, decisions), one for execution (code, documents), sometimes a separate one for research. The windows have separate roles and separate files, so they do not step on each other's edits. They don't share memory, so they got mail, a mailbox file in the project folder. An entry is two to five lines, a date, a sender, what happened and where the detail lives. The recipient adds a status. Bigger things go as a separate file, a brief one way, a report the other, the mailbox just points to it. The tool now has its own channel between sessions and I use it sometimes, but the lasting record stays in a file. A message disappears with the session, an entry in the repository can be read tomorrow by anyone.

### 2026-09-07 rano / okno techniczne: AWARIA POBIERANIA Z NIEDZIELI NAPRAWIONA, przed zespołem klienta FAKTY: w niedzielę po południu przebieg pobierania padł na obu środowiskach naraz; przyczyna w czyszczeniu starych zadań, poprawka wdrożona 7:13, kontrola o 8:00 czysta. ZROBIONE: raport z przyczyną i poprawką (plik), pozycja w kolejce dopinania przesunięta na pierwszą. CZEKA NA DECYZJĘ CZŁOWIEKA: czy pomiar zużycia pamięci serwera wchodzi na stałe do kontroli floty. [PRZECZYTANE 7.09 / okno strategiczne]
### 2026-09-07 morning / technical window: SUNDAY'S DOWNLOAD FAILURE FIXED, before the client's team FACTS: on Sunday afternoon the download run failed on both environments at once; the cause was in cleaning up old jobs, the fix was deployed at 7:13, the 8:00 check was clean. DONE: report with the cause and the fix (file), the item moved to the top of the follow-up queue. WAITING FOR A HUMAN DECISION: whether server memory usage joins the fleet check for good. [READ 2026-09-07 / strategy window]

Jedna zasada nie ustępuje. Decyzje podejmuje wyłącznie człowiek. Agent zatrzymuje się i pyta przed commitem, przed wdrożeniem, przed każdą wiadomością na zewnątrz i przed zmianą własnych zasad. Skrzynka przenosi informacje o decyzjach, z datą, nigdy ich nie tworzy. Gdy dwa wpisy się przeczą, wygrywa nowsza decyzja człowieka.

One rule does not bend. Only a human makes decisions. The agent stops and asks before a commit, before a deploy, before any message that leaves the repository and before changing its own rules. The mailbox carries information about decisions, with a date, it never creates them. When two entries disagree, the newer human decision wins.

Jeden agent myśli, inni robiąOne agent thinks, the others do

Sesja główna to najmocniejszy model Claude w roli lidera technicznego. Osąd, spec, przegląd wyników, dokumenty. Wykonanie idzie do agentów z przypiętym modelem, dobranym do zadania (model routing). Podział jest prosty. Osąd zostaje u najmocniejszego modelu, mechanika idzie tam, gdzie jest tańsza i szybsza. Powód jest twardszy niż koszt. Każdy agent pracuje we własnym oknie i oddaje streszczenie, więc przeszukanie stu plików nie zajmuje miejsca w sesji, która podejmuje decyzje.

The main session is the strongest Claude model in the role of technical lead. Judgment, spec, review of results, documents. Execution goes to agents with a model pinned to them, matched to the task (model routing). The split is simple. Judgment stays with the strongest model, mechanical work goes where it is cheaper and faster. The reason is harder than cost. Each agent works in its own window and returns a summary, so reading a hundred files does not take up room in the session that makes the decisions.

RolaModelDo czegoCzego nie robi
Sesja głównaFable, najmocniejszyspec, decyzje architektoniczne, przegląd kodu i raportów, teksty do klienta, syntezanie klepie mechaniki, nie przeczesuje repozytorium
ReasonerOpus, mocnytrudna logika, migracje, integracje, wieloetapowe debugowanienie podejmuje decyzji o architekturze
WorkerSonnet, szybkiszablony, testy z gotowych kryteriów, fixtures, transformacje plikównie zgaduje, dostaje dokładny brief
ScoutHaiku, najtańszyprzeszukiwanie kodu i plików, inwentaryzacje, zbieranie cytatówtylko czyta, nic nie zmienia
RoleModelWhat forWhat it doesn't do
Main sessionFable, strongestspec, architecture decisions, reviewing code and reports, client-facing text, synthesisdoesn't do mechanical work, doesn't crawl the repository
ReasonerOpus, stronghard logic, migrations, integrations, multi-step debuggingdoesn't make architecture decisions
WorkerSonnet, fasttemplates, tests from ready criteria, fixtures, file transformationsdoesn't guess, gets an exact brief
ScoutHaiku, cheapestsearching code and files, inventories, gathering quotesread only, changes nothing

Do tego metody, czyli skille. Panel ekspertów do decyzji (kilka person debatuje nad ofertą, a ja siedzę przy stole i odpowiadam na ich pytania), przegląd kodu, testy end-to-end, zamknięcie sesji. Oraz oczy. To, co powtarzalne, sprawdza Playwright, testy end-to-end w CI i zrzuty do przeglądu. Gdy stan istnieje tylko u mnie, agent dostaje most do mojej przeglądarki (Claude in Chrome), klika po aplikacji i robi zrzuty, każde działanie ze skutkiem zatwierdzam ręcznie, a werdykt daję ze zrzutu, nie z zielonego testu. Zielony test nie widzi tekstu, który stracił sens.

On top of that there are methods, skills. An expert panel for decisions (a few personas debate an offer, and I sit at the table answering their questions), code review, end-to-end tests, closing a session. And eyes. Whatever is repeatable is checked by Playwright, end-to-end tests in CI and screenshots for review. When the state exists only on my machine, the agent gets a bridge to my browser (Claude in Chrome), clicks around the app and takes screenshots, I approve every action with consequences by hand, and I give the verdict from the screenshot, not from a green test. A green test doesn't see text that has lost its meaning.

Co pilnuje, żeby się nie rozjechałoWhat keeps it from drifting apart

System oparty na plikach bez strażników rozjeżdża się w miesiąc. To hooki Claude Code, czyli skrypty, które narzędzie odpala samo, przed komendą albo przy zamykaniu sesji. Uruchamia je narzędzie, nie model, więc nie wystarczy, żeby agent uznał, że tym razem nie trzeba. Powstały z researchu, jak inni pracują na tym narzędziu, z dokumentacji i z własnej praktyki.

A system built on files drifts apart within a month without guards. These are Claude Code hooks, scripts the tool runs on its own, before a command or when a session closes. The tool runs them, not the model, so it is not enough for the agent to decide that this time they do not apply. They came from research into how others work with this tool, from the documentation and from my own practice.

  1. Blokada komend. Skrypt przed każdą komendą powłoki. Kasowanie bez odwrotu, wymuszony push, twardy reset gita i każda komenda, która zmienia prywatne repozytorium na publiczne, są zatrzymywane na twardo, niezależnie od tego, co agent uważa.
  2. Skaner sekretów. Przed commitem idzie skan po wzorcach kluczy, których używam. Same klucze żyją w jednym pliku poza gitem, a w repozytorium jest tylko tabela, który klucz do czego i gdzie leży. Skaner łapie wzorce, więc drugą warstwą jest to, że wartości w ogóle nie ma w katalogu, po którym agent chodzi.
  3. Strażnik kontekstu. Jakość pracy agenta spada, zanim skończy się miejsce w oknie kontekstu. Zjawisko ma nazwę, context rot. Im więcej tokenów w oknie, tym gorzej model przypomina sobie to, co w nim jest, a środek gubi najszybciej. Przy 40 procentach okna ostrzega, przy połowie zatrzymuje pracę i każe domknąć sesję w plikach. Połowa miliona tokenów to ten sam próg, który Claude Code pozwala ustawić samemu, u mnie jest wymuszony skryptem, a nie zostawiony mojej dobrej woli. Gdy mimo to jadę dalej, drugie przypomnienie przychodzi tuż przed tym, jak narzędzie samo streści rozmowę, czyli w ostatnim momencie, w którym da się jeszcze zapisać stan własnymi słowami.
  4. Skaner dryfu. Osobny przebieg porównuje, co mówią pliki, z tym, co jest w kodzie, na serwerze i w gicie, grupuje rozjazdy po temacie i proponuje poprawkę. Wykonanie za zgodą, nigdy samo.
  5. Separacja. Każdy klient ma folder, każdy klient ma bramki, czyli co z jego folderu wolno przenieść dalej (nic) i co z badań rynku wolno pokazać jemu (tylko źródła jawne). Agent pilnuje tego w każdym tekście, który wychodzi na zewnątrz. To reguła w plikach, mój przegląd i bramki per folder.
  6. Treść z zewnątrz. Treść z zewnątrz to dane, nie polecenia. Strona, dokument albo wiadomość, którą agent czyta, nie zmienia zasad z plików, a wszystko, co wychodzi na zewnątrz, przechodzi przeze mnie.
  1. Command blocker. A script before every shell command. Deletion with no way back, a force push, a hard git reset and any command that turns a private repository public are hard-stopped, no matter what the agent thinks.
  2. Secret scanner. Before a commit, a scan runs over the key patterns I use. The keys themselves live in one file outside git, and the repository only holds a table of which key is for what and where it lives. A scanner catches patterns, so the second layer is that the values are not in the directory the agent works in.
  3. Context guard. The quality of the agent's work drops before the context window runs out of space. The effect has a name, context rot. The more tokens in the window, the worse the model recalls what is in it, and the middle goes first. At 40 percent of the window it warns, at half it stops the work and tells me to close the session in the files. Half of a million tokens is the same threshold Claude Code lets you set yourself, here it is enforced by a script rather than left to my good intentions. If I push on anyway, a second reminder comes just before the tool summarises the conversation itself, the last moment when the state can still be written down in my own words.
  4. Drift scanner. A separate run compares what the files say with what's in the code, on the server and in git, groups the mismatches by topic and proposes a fix. It runs only when I approve it, never on its own.
  5. Separation. Every client has a folder, every client has gates, meaning what may move out of their folder (nothing) and what from market research may be shown to them (only public sources). The agent enforces this in every piece of text that goes out. That is a rule in the files, my review and per-folder gates.
  6. Outside content. Content from outside is data, not instructions. A page, a document or a message the agent reads does not change the rules from the files, and anything that goes out passes through me.

Architektura, na której pracujęThe architecture I work on

Nic egzotycznego. Laptop, terminal, przeglądarka, prywatny git, jeden serwer z kontenerami i kopie zapasowe. Agent ma dostęp do tego, do czego ja, z wyjątkiem kluczy, które widzi tylko jako nazwy.

Nothing exotic. A laptop, a terminal, a browser, private git, one server with containers, and backups. The agent has access to what I have, except for the keys, which it only sees as names.

LAPTOP · TU SIEDZĘ JA I AGENT LAPTOP · WHERE THE AGENT AND I SIT CHMURA · KOD I PAMIĘĆ CLOUD · CODE AND MEMORY SERWER · TO, CO DZIAŁA DLA KLIENTÓW SERVER · WHAT RUNS FOR CLIENTS Claude Code kilka okien, jedno na projekt several windows, one per project instrukcje, skille, strażnicy, subagenci instructions, skills, guards, subagents Drugi mózg (pliki) Second brain (files) kopia repozytorium, wszystkie projekty repository copy, all projects Przeglądarka z mostem Browser with a bridge agent klika i robi zrzuty, ja daję werdykt the agent clicks, I judge the screenshot Repozytoria kodu Code repositories osobny folder na każde repo, zmiany przez PR, bo tam odpala się CI a separate folder for each repo, changes via PR, that is where CI runs Klucze poza gitem Keys outside git jeden plik, agent widzi nazwy, nie wartości one file, the agent sees names, not values Modele Models harness na modelach Claude the harness runs on Claude models kod produktu na modelu po benchmarku product code on the benchmark winner Git, repozytoria prywatne Git, private repositories drugi mózg i kod produktu osobno, second brain and product code apart, historia zmian jest dowodem the change history is the evidence CI po pushu CI after push lint, typy, testy, kontrola dryfu schematu lint, types, tests, schema drift checks Kopie zapasowe Backups codziennie, odtworzenie sprawdzane przy UAT daily, restore tested on UAT refresh Dokumentacja bibliotek na żywo Live library documentation serwer MCP podaje API, agent nie zgaduje MCP server, current API, no guessing Jeden serwer, kontenery One server, containers osobny kontener na klienta, wspólny obraz one container per client, shared image deploy skryptem, kopia, wymiana, wycofanie deploy by script, backup, swap, rollback Strażnik floty Fleet watchdog sonda co pół godziny, alert przy zmianie a probe every half hour, alert on change Środowisko testowe klienta Client test environment kopia produkcji, zespół klika przed zmianą production copy, the team clicks first Bazy i dzienniki Databases and logs zdarzenia z czasem, z nich liczę miary timestamped events, I count metrics Wyłączone usługi Switched-off services wyłączam to, czego nikt nie używa I switch off what nobody uses
serce warstwycore of the layer pliki i kodfiles and code narzędzia i środowiskatools and environments

Zasada przepływu. Edycja lokalnie, commit, push, dopiero potem wdrożenie skryptem. Na serwerze nie zmieniam nic ręcznie, nawet przy pilnej poprawce, bo poprawka poza gitem znika przy następnym wdrożeniu i za tydzień nikt nie wie, czemu problem wrócił. Skrypt robi kopię, podmienia wersję i umie ją wycofać jednym poleceniem.

Flow rule. Edit locally, commit, push, only then deploy by script. I change nothing by hand on the server, not even for an urgent fix, because a fix outside git disappears at the next deploy and a week later nobody knows why the problem came back. The script takes a backup, swaps the version and can roll it back with one command.

Co kosztuje i co nie działa samoWhat it costs and what doesn't run itself

Co daje
  • Zero powtarzania kontekstu. Nowa sesja, nowy dzień, nowy komputer, ten sam stan.
  • Każda decyzja ma datę i miejsce. "Kiedy to ustaliliśmy?" to grep, nie wspomnienie.
  • Ktokolwiek wejdzie po mnie, w to samo repozytorium, startuje z pełnym obrazem.
  • Agent poprawia mnie, gdy łamię własne zasady, bo zasady są w plikach, które on czyta.
Co kosztuje
  • Rytuał zamknięcia sesji to kwadrans. Pominięty raz, mści się następnego dnia.
  • Pliki się rozjeżdżają. Stąd hierarchia prawdy i skaner dryfu, i tak co jakiś czas trzeba posprzątać.
  • Kontekst kilku klientów w jednym miejscu wymaga twardej separacji folderów i bramek.
  • Jeden serwer to świadomy wybór przy dzisiejszej skali, najtańsza izolacja, jaką da się mieć, z osobnym kontenerem na klienta. Awaria hosta zatrzymuje wszystkich naraz, więc trzyma to kopia, z której umiem odtworzyć, i skrypt, który umie cofnąć wersję. Granicą jest dzień, w którym ktoś zapłaci za gwarancję dostępności.
  • Czego jeszcze nie ma. Zestawu testów dla promptów, który po każdej zmianie sprawdza na zapisanych przykładach, czy model dalej odpowiada tak samo. Zapisu każdego wywołania modelu z czasem, kosztem i wynikiem, żeby po tygodniu dało się powiedzieć, gdzie poszły pieniądze. Miary jakości pracy agentów na produkcji. W tej kolejności.
  • To jest sposób pracy, nie produkt. Nie da się go kupić, trzeba go prowadzić. To, co opisałem wyżej, ma dziś nazwę. Harness, czyli wszystko poza modelem, prowadnice, które ustawiają agenta z góry, i czujniki, które go poprawiają po fakcie.
What it gives
  • Zero repeating context. A new session, a new day, a new computer, the same state.
  • Every decision has a date and a place. "When did we decide that?" is a grep, not a memory.
  • Whoever comes after me, into the same repository, starts with the full picture.
  • The agent corrects me when I break my own rules, because the rules are in files it reads.
What it costs
  • The session-closing ritual takes fifteen minutes. Skip it once, it bites back the next day.
  • Files drift apart. Hence the hierarchy of truth and the drift scanner, and every so often it still needs a clean-up.
  • Context from several clients in one place needs a hard separation of folders and gates.
  • One server is a deliberate choice at today's scale, the cheapest isolation available, with a separate container per client. A host failure stops everyone at once, so what holds it up is a backup I can restore from and a script that can roll a version back. The limit is the day someone pays for an availability guarantee.
  • What is still missing. A test set for prompts that checks on saved examples, after every change, whether the model still answers the same way. A record of every model call with time, cost and result, so that after a week I can say where the money went. A measure of how well the agents do in production. In that order.
  • This is a way of working, not a product. You can't buy it, you have to run it. What I described above has a name now. A harness, which is everything except the model, the guides that steer the agent up front and the sensors that correct it afterwards.

RAG, kiedy się opłacaRAG, when it pays off

Zbudowałem też agentowi pamięć semantyczną. Baza wektorowa, otwarty model osadzeń uruchomiony u siebie, potok badań, zapis sesji z oceną jakości i deduplikacją. Wiem, jak to działa od środka, i wiem, kiedy nie ma sensu. Baza wektorowa zarabia na siebie, gdy wiedzy jest więcej, niż mieści okno modelu, a pytania są rozmyte. Baza wiedzy dla handlowców, historia reklamacji, dokumentacja produktów. Notatki jednej osoby mieszczą się w oknie. Tam wygrywa plik z datą i autorem, bo kosztuje zero i czyta go człowiek. Dlatego wyżej są pliki, nie wektory.

I also built semantic memory for an agent. A vector database, a self hosted open embedding model, a research pipeline, session capture with quality scoring and deduplication. I know how it works from the inside, and I know when it makes no sense. A vector database earns its keep when there is more knowledge than fits in the model window and the questions are fuzzy. A knowledge base for sales, complaint history, product documentation. One person's notes fit in the window. There a file with a date and an author wins, because it costs nothing and a human can read it. That is why what you see above is files, not vectors.

Konkretnie. Trzy osie metadanych na każdym fragmencie, domena, projekt i etap życia, z indeksami pod filtrowanie, żeby pytanie o wdrożenie u jednego klienta szło po filtrze, nie tylko po podobieństwie. Jeden punkt zapisu przez API z kluczem, a w nim cięcie na fragmenty z zakładką, deduplikacja po skrócie treści i ocena jakości modelem na wejściu, żeby śmieci nie trafiały do indeksu. Osiem typów źródeł, od researchu po zapis sesji. Wyszukiwanie wystawione agentowi przez serwer MCP i lista sprawdzonych zapytań na start, żeby nie zgadywał słów. Dwie kolekcje, osobno wiedza projektowa, osobno baza wiedzy dziedzinowej.

Concretely. Three axes of metadata on every chunk, domain, project and lifecycle stage, with indexes for filtering, so that a question about one client's deployment goes through a filter, not just through similarity. One write path through an API with a key, and inside it chunking with overlap, deduplication by content hash and a quality score from a model on the way in, so that junk never reaches the index. Eight source types, from research to session capture. Search exposed to the agent through an MCP server, plus a list of proven queries to start from, so it does not guess the words. Two collections, project knowledge and a domain knowledge base kept apart.

Co z tego dla zespołu, do którego dołączamWhat this means for the team I join

Wchodzę z gotowym warsztatem. Instrukcje agenta, role modeli, strażnicy komend i sekretów, przekazywanie sesji przez pliki. Powstał dla jednej osoby, więc w zespole najpierw sprawdzam, co przeżyje kontakt z cudzymi opiniami. Dokładam to do tego, co zespół już ma, jako pliki obok kodu, w formacie, który czyta większość narzędzi, zmieniane przez PR, i zostaje tyle, ile zespół uzna za przydatne.

I arrive with a toolkit that already works. Agent instructions, model roles, command and secret guards, session handover through files. It was built for one person, so in a team I first check what survives contact with other people's opinions. I fit it to what the team already has, as files next to the code, in the format most tools read, changed through PRs, and what stays is what the team finds useful.

Piszę pod następną osobę. Nie zostawiam po sobie wiedzy do przekazania ustnie, więc przejęcie projektu ode mnie nie wymaga ani mojej obecności, ani mojego kalendarza.

I write for the next person. I leave behind nothing that has to be handed over in conversation, so taking a project over from me needs neither my presence nor my calendar.

Mierzę, zanim uwierzę. Model, narzędzie albo baza wchodzą do systemu po benchmarku na prawdziwych danych i wychodzą, gdy logi pokazują, że nikt z nich nie korzysta.

I measure before I believe. A model, a tool or a database enters the system after a benchmark on real data and leaves when the logs show nobody uses it.

Tak pracuję. Projekty i kontakt są na stronie głównej. Napisz na piotr.sobczak@odok.pl.

This is how I work. Projects and contact are on the home page. Write to piotr.sobczak@odok.pl.