Skip to content

AliAA1444/alkham

Repository files navigation

alkham

PyPI CI Python License: MIT

Frictionless, one-command capture of your AI coding-CLI sessions — Claude Code and Aider — as readable Markdown notes. Library-first; Obsidian by default, but works with any Markdown folder.

⚠️ Security — transcripts are captured verbatim. alkham does not redact. Never capture sessions containing live API keys, tokens, or other secrets: they will be written into your notes as-is. (Path-traversal and Markdown/YAML-injection from hostile log content are sanitized so a transcript can't corrupt your vault — see docs/ARCHITECTURE.md §10.)

Why alkham

Your best architectural reasoning, hard-won debugging insights, and the why behind decisions are trapped in raw JSONL/history files you never read again (and Claude Code deletes after ~30 days). alkham turns those disposable terminal logs into clean, chronological, human-legible notes you'll actually return to — and it's the only tool capturing Claude Code and Aider through one pluggable engine.

Quickstart

pip install alkham
alkham init      # pick an output folder + flavor, toggle features
alkham sync      # capture your most recent Claude Code or Aider session
✓ Captured 2026-05-14_add-jwt-refresh_a1b2c3.md  crowdflow

Capture is a single alkham sync today; automatic capture (alkham watch) arrives post-launch.

Works with or without Obsidian

The obsidian flavor emits wikilinks, tags, and a zero-orphan Map-of-Content. The plain flavor emits portable Markdown that opens cleanly in VS Code, Logseq, Notion, or any folder. Every behavior — routing, Auto-MOC, tagging, frontmatter — is independently toggleable, so alkham fits an existing knowledge base instead of overwriting it.

Use it as a library

from alkham.parsers import get_parser_for

session = get_parser_for("chat_log.jsonl").parse()
print(session.messages)            # -> list[Message]
print(session.files_modified)      # tool-use breadcrumbs

get_parser_for auto-detects the source and raises UnknownSourceError on an unrecognized file. The Session dataclass is a stability commitment.

CLI surface

Command Purpose
alkham init First-run wizard (output dir, flavor, toggles)
alkham sync [-t FILE] [-n] Capture the latest (or a specific) session; -n dry-runs
alkham backfill [--since DATE] [--project NAME] Batch-capture history
alkham config [--edit] Show (or edit) the config
alkham moc --project NAME Rebuild a project's MOC
alkham install-close-command Install the /close prompt (Claude Code)

Documentation

  • docs/PRODUCT_SPEC.md — what it does, for whom, how it feels to use
  • docs/ARCHITECTURE.md — how it's built (the technical source of truth)
  • docs/ROADMAP.md — the phased build plan
  • CONTRIBUTING.md — incl. how to add a parser for a new tool

License

MIT © Ali Alkhamees

About

Frictionless, one-command capture of AI coding-CLI sessions (Claude Code + Aider) as readable Markdown notes. Library-first, local-first, vault-agnostic.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages