
Spökpejl
A crime novel written in dialogue with a language model, and the reader I built so it could be read on a phone.
I wanted to know whether a novel could be written together with a language model, and what that would demand of me. It could. The work simply moved: from forming sentences to holding structure and continuity together, and deciding what got to stay.
Det stora arbetet handlade för mig snarare om att hålla i tyglarna vad det gäller övergripande idé & synopsis, ge relevant bakgrundsinformation kring detaljer – stora som små, samt korrigera och skruva på formuleringar.
Someone is moving ships without touching them
En novembernatt går passagerarfärjan M/S Baltic Crown på grund i Sandhamnsleden. Ombord visar varje instrument att hon ligger mitt i rännan. Utredningen stannar vid det bekväma: en trött styrman på hundvakten.
Klara Wallin mäter sjöbotten för att kartor ska bli sanna. Rutinuppdraget att mäta in olycksplatsen tar en timme att utföra och blir omöjligt att lämna: grundet ligger åttio meter från leden, och färdskrivarens position har suttit blickstilla mitt i rännan medan djupet rasade under kölen. Någon har matat fartyget ett falskt läge. Inte den breda störningen som blivit Östersjöns vardag, utan en lögn skräddarsydd för ett enda fartyg.
Klara vet vad en skärm som ljuger kostar. Femton år tidigare valde hon plotterns lugna triangel framför ekolodet och rösten från en nittonåring på fördäck.
Myndigheterna ser mönstret och tiger – att peka ut en fiende är att tvingas handla. Kvar finns 285, en hemvärnsbåtpluton av vanliga människor som navigerar på öga, papper och minne. Det enda vapen som inte går att störa ut.

Writing a book with a language model
The book was worked out in a long dialogue, sentence by sentence. I did not send in a brief and get a chapter back. I sat inside the text the whole way, proposing and cutting, and the model did the same in the other direction.
What made it work was not the model but the discipline around it. A language model forgets, and it guesses willingly. So everything that could not be forgotten had to be written down outside the conversation.
Five files that may not be contradicted
- Language bible
- Typography, prose standard and 34 rules of language discipline
- Domain canon
- Sea, navigation, diving, charts and military units
- Style bible
- Voice and rhythm, with a voice guide per character
- Character bible
- Who is who, and what they have already said
- Place bible
- The geography, down to which jetty lies where
The book is built into a reader
The manuscript lives as numbered markdown files. A build step assembles them in order and writes out a web app with a table of contents, chapters, glossary and afterword. The text has one source, and the reader is a product of it.
The reading position is saved, so the book opens where it was left. It can also be added to the home screen and read as an app.

The pages do not scroll
The app measures how much text fits on the screen and breaks there. A page is a page, and it is recalculated when the reader changes text size, line spacing, or turns the device. It is the only part of the build that was hard.

Ett eget korrekturläge
Corrections run as their own flow alongside the writing. Every remark gets a number and is worked off until the list is empty. Spökpejl went through 239 corrections before release.
The book is then the reference for the ones that follow. A detail established here may not be contradicted in book two, which is why the whole of book one travels along as a reference while the next is written.
