Skip to main content

defossil

Status: prototype. No tests yet; anything can change without backward compatibility.

Improve your English by reviewing your own chats with AI coding agents. The name comes from "fossilized errors" — recurring mistakes that stick in a learner's language. You already write a lot of English when talking to agents like Claude Code and Codex. defossil collects those messages, reviews them with an LLM, and gives you two things:

  • Corrections — one per mistake: your fragment, the fix, and a short note on how to say it better.
  • Reports — the most valuable part. A short lesson over many corrections: the mistakes you repeat, the native-language patterns in your phrasing, shorter ways to say what you keep saying long — real examples from your own text. Fast to read and a realistic picture of your English.

How it works

Three background workers, one per step, each on its own 5-minute clock: the importer collects and classifies (always on), the review worker reviews, the report worker makes reports. The last two spend money, so they are gated by one in-memory auto-AI switch that starts off on every launch. Each table has a single writer, so corrections and reports are append-only and no step races another; a report window is a correction id range, which stays valid no matter when the report worker runs.

  1. Collect — archive every message you typed, verbatim, into SQLite, deduplicated by the source's own key. Only real typed text: tool output, command expansions, and programmatic runs are skipped. Sources: Claude Code and Codex CLI; one module per source.
  2. Classify — stamp each new message pending / non-english / too-short / no-prose / too-long / duplicate (the same text again within a week — a paste, not writing), once. Only pending goes to review; the text itself is never rewritten.
  3. Review — send pending messages to the LLM in batches, store what it corrects — real mistakes and style (wordiness, calques, register) — as corrections, and stamp the messages reviewed. A message is reviewed once, ever. On the dashboard a correction can be acknowledged, and the explain button asks the LLM for a deeper explanation.
  4. Report — a markdown lesson over each corrections_per_report corrections: repeated mistakes, native-language patterns, shorter phrasings, one focus habit until the next report. Reports are stored and never regenerated. Under each report is a chat: ask about a rule or an example, and every question and answer is stored with the report. The turns run in one CLI session per report, resumed with claude -p --resume or codex exec resume, so a turn sends only the question; when the CLI has lost the session (Claude Code drops transcripts after ~30 days, or the backend changed), a new one opens on the lesson and the stored turns, and the chat continues.

Architecture

web → Core → feature service → Db. Core is a container and the lifecycle: it opens the database, builds one service per feature, starts them in order and stops them in reverse. A feature is one job, named after the record it owns: message (the archive and its sources), correction, report (with the chat under each report: its turns and the CLI session they resume), setting, and ai — every prompt the app sends, plus the ai_calls log of what each call cost. Every table has exactly one owner, and only the owner writes SQL against it. Features reach each other through self.core.services.<other>.

The schema evolves through append-only migrations (core/migrations.py, tracked by PRAGMA user_version), so it can change without dropping data. Nothing is redone: a message is classified and reviewed once, corrections and reports only accumulate. The archive is the one thing the sources cannot give back (Claude Code deletes transcripts after ~30 days), and nothing drops it.

Usage

Python, FastAPI, SQLite. LLM calls go through the claude CLI by default (claude -p — works with a Claude subscription, no API key); a setting switches to codex exec. Local only: data never leaves the machine except text sent for review.

Run defossil start, open http://127.0.0.1:3677. The server runs in the background until defossil stop; defossil status tells whether it is up. It does not come back after a reboot. Plain defossil runs the same server in the foreground. macOS and Linux only.

One data dir takes one server: a second one refuses to start. The background server writes its log to defossil.log in the data dir; the file is never rotated.

Settings

The data root cannot live in the database it locates, so it is the one setting outside it: ~/.local/share/defossil by default, overridden only by --data-dir. Everything else — native language, AI backend, model and effort per prompt category, source roots, batch sizes, report section sizes, page size — lives in the settings table, is edited on the dashboard's settings page, and is read at use time, so a change applies without a restart.

Non-goals

Decided against — do not re-propose or implement:

  • Exercises — drills, quizzes, flashcards, spaced repetition built from the stored mistakes. The app shows mistakes and writes reports, nothing more.
  • Dismissing false positives — a "not a mistake" flag. Premature: the archive shows no false positives yet.
  • Fossils page — a page grouping corrections by category and fragment. Fragments group only when they repeat verbatim, so it adds little over the corrections page and the report.

License

MIT

Metadata

Release files for defossil 0.0.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for defossil 0.0.10
File Interpreter ABI Platform Actions
defossil-0.0.10-py3-none-any.whl Python 3 none any Details for defossil-0.0.10-py3-none-any.whl

Release files / defossil-0.0.10-py3-none-any.whl

Download URL defossil-0.0.10-py3-none-any.whl
Size 118.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46f455b31879cf9f1979ff5f96c51e3bcd3536269acddc14917ce30d73bfddd6
BLAKE2b-256 checksum
How to use checksums
8e195bf6d31c0d1100855ef8084eb5580e93c2ee40fb006f1389d76faa607fe4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.22 {"installer":{"name":"uv","version":"0.12.22","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for defossil 0.0.10

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page