calva-backseat-driver: Skill for Claude Code

.github/skills/backseat-driver-internals/SKILL.md

backseat-driver-internals is a skill for Claude Code, Codex from BetterThanTomorrow/calva-backseat-driver. It costs 82 tokens per session (3,175 once invoked), scanned A, original, MIT.

Internal technical documentation for the Backseat Driver extension, covering its state storage, actions, effects, lifecycle, and socket-based MCP server. MCP is a protocol for connecting an agent to tools.

In plain words
What is it for?
Modifying or debugging state management, action routing, lifecycle handling, MCP requests, logging, and the extension’s TCP server.
Why use it?
It helps developers understand how the extension’s parts communicate when changing core code or investigating state problems.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

This is BetterThanTomorrow/calva-backseat-driver's own configuration. It tells Claude Code and Codex how to work on calva-backseat-driver itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything calva-backseat-driver configures →

Reuse

Borrowing it

Nothing to install: this file belongs to BetterThanTomorrow/calva-backseat-driver. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/BetterThanTomorrow/calva-backseat-driver/master/.github/skills/backseat-driver-internals/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/BetterThanTomorrow/calva-backseat-driver

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for backseat-driver-internals

README.md
[![agentmods](https://agentmods.dev/badge/skills/betterthantomorrow/calva-backseat-driver/backseat-driver-internals/github.svg)](https://agentmods.dev/skills/betterthantomorrow/calva-backseat-driver/backseat-driver-internals)
Your own site
<a href="https://agentmods.dev/skills/betterthantomorrow/calva-backseat-driver/backseat-driver-internals"><img src="https://agentmods.dev/badge/skills/betterthantomorrow/calva-backseat-driver/backseat-driver-internals/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for backseat-driver-internals

Your own site · 80×15
<a href="https://agentmods.dev/skills/betterthantomorrow/calva-backseat-driver/backseat-driver-internals"><img src="https://agentmods.dev/badge/skills/betterthantomorrow/calva-backseat-driver/backseat-driver-internals.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,175 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.03175
Opus 5 $0.00041 $0.01588
Sonnet 5 $0.00016 $0.00635
Haiku 4.5 $0.00008 $0.00317

Measured 12d ago against content hash 77c93ee3b7dd, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

backseat-driver-internals scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.github/skills/backseat-driver-internals/SKILL.md · 268 lines

How it starts

The opening of the file, as written. The whole thing — 268 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Backseat Driver Extension Internals

Subsystem contracts, state architecture, and temporal sequences for the Backseat Driver extension.

Key Namespaces

Namespace Purpose
ex.ex Dispatcher — the only entry point for state changes
ex.ax Action routing, enrichment, accumulation
ex.fx Effect routing (context-enriched before domain dispatch)
app.db !app-db atom, !output-conn & !history-conn Datascript, serialization
app.axs App lifecycle actions (activate, init, commands, cleanup)
app.fxs App effects (logging, command registration, Language Model tools)
db.axs Generic state mutation actions (assoc-in, update-in)
mcp.axs MCP server lifecycle actions (start/stop/error/handle-request)
mcp.fxs MCP effects (start/stop server, notifications, request handling, wrapper copy)
mcp.server TCP socket server implementation (low-level net, port file, buffering)
mcp.requests MCP protocol handler — tool listings, initialize, tools/call dispatch
mcp.skills Skill frontmatter parsing, filtering, instruction composition
mcp.logging MCP server log output
extension VS Code activate/deactivate entry points
integrations.calva.api Calva API access (REPL eval, ranges, editor, document, info)
integrations.calva.editor Structural editing implementation
integrations.calva.editor-util File context formatting (line-numbered windows)
integrations.vscode.tools VS Code Language Model tool registration
integrations.parinfer Bracket balancing via Parinfer
stdio.wrapper MCP stdio-to-socket relay (dist/calva-mcp-server.js)

Subsystem Contracts

λ app_db_contract.
  db/!app-db ≡ atom {
    :vscode/extension-context    ExtensionContext     ;; set before dispatch, circular refs
    :app/getConfiguration        fn                   ;; VS Code config reader

    ;; From init-db
    :extension/disposables       [Disposable]         ;; VS Code subscriptions
    :extension/when-contexts     {:calva-mcp-extension/activated? bool
                                  :calva-backseat-driver/started? bool
                                  :calva-backseat-driver/starting? bool
                                  :calva-backseat-driver/stopping? bool}
    :calva/output-line-counter   int                  ;; monotonic for output entities

    ;; From initial-state (extension.cljs)
    :app/log-file-uri            Uri                  ;; log location
    :app/min-log-level           keyword              ;; :debug/:info/:warn/:error
    :mcp/wrapper-config-path     string               ;; ~/.config/calva/backseat-driver
    :calva/history-storage-uri   Uri|nil              ;; eval-history.transit.json

    ;; Runtime
    :app/log-dir-initialized+    promise              ;; resolved when log dir exists
    :app/server-info             {:server/instance Server
                                  :server/port int
                                  :server/port-file-uri Uri
                                  :server/port-note string?}
  }
  | inspection: always(dissoc :vscode/extension-context) | circular_ref_guard
  | mutation: only_through_dispatch! | ¬direct_swap!

λ ex_dispatcher_contract.
  dispatch!(context, actions) ≡ the_only_state_entry_point
  | ~16 lines of code | the entire framework
  |
  | flow:
  |   ax/handle-actions(@!app-db, context, actions)
  |     reduce_over_actions:
  |       1. enrich-from-context(action, context)    → :context/x.y → js-get-in
  |       2. enrich-from-state(action, state)        → [:db/get k], :vscode/config.x
  |       3. route_by(namespace action-kw) → domain_handler
  |       4. handler_returns {:ex/db, :ex/fxs, :ex/dxs}
  |     accumulate: merge_db, into_fxs(enriched_from_state), into_dxs
  |   when db → reset!(!app-db)
  |   when dxs → recursive dispatch!(context, dxs)
  |   when fxs → for_each: enrich_from_context → route → execute

λ enrichment_contract.
  context_enrichment:
    :context/x.y.z → js-get-in(context, ["x" "y" "z"])
    | applied_to: actions ∧ effects
  state_enrichment:
    [:db/get key] → (get state key)
    :vscode/config.settingName → VS Code configuration API
    | applied_to: actions_only (effects get context enrichment only)
  args_enrichment:
    :ex/action-args → entire_result_from_effect
    :ex/action-args%N → (nth result (dec N))
    | applied_to: continuation_actions_via :ex/then

λ action_routing.
  (namespace action-kw) → handler_namespace:
    "app"      → app.axs
    "mcp"      → mcp.axs
    "db"       → db.axs
    "vscode"   → integrations.vscode (via axs)
    "node"     → integrations.node (via axs)
    "calva"    → integrations.calva (via axs)
  | new_domain → add_case_in ex/ax.cljs handle-action

λ effect_routing.
  (namespace fx-kw) → handler_namespace:
    "app"      → app.fxs
    "mcp"      → mcp.fxs
    "vscode"   → integrations.vscode (via fxs)
    "node"     → integrations.node (via fxs)
    "calva"    → integrations.calva (via fxs)
  | effects_receive(dispatch!, context, enriched-fx)
  | new_domain → add_case_in ex/fx.cljs perform-effect!

λ datascript_contract.
  !output-conn ≡ session_scoped | schemaless | cap: 1000 entities
    | all_output_categories: evaluationResults, evaluatedCode, evaluationOutput,
    |   evaluationErrorOutput, otherOutput, otherErrorOutput
  !history-conn ≡ persistent | schema: {:output/line {:db/unique :db.unique/identity}}
    | cap: 10000 | evaluatedCode_only
    | serialized_to: eval-history.transit.json | cognitect.transit JSON
    | format: {:format-version 1 :entities [...]}
  entity_attributes:
    :output/line        int (monotonic, from :calva/output-line-counter)
    :output/category    string
    :output/text        string
    :output/who         string?
    :output/timestamp   inst
    :output/ns          string?
    :output/repl-session-key string?

λ mcp_server_contract.
  socket_server: TCP | net.createServer | localhost_only
  | port: configured(default 1664) | 0 ≡ random | EADDRINUSE → fallback_to_0
  | port_file: ${workspaceFolder}/.calva/mcp-server/port
  | protocol: newline_delimited_JSON | buffered_partial_reads
  | active_sockets: atom | tracks_connected_clients
  | notifications: broadcast_to_all_active_sockets

  stdio_wrapper: dist/calva-mcp-server.js
  | reads_port_from_port_file → TCP_connect → relay(stdio ↔ socket)
  | one_server_per_workspace_folder

λ calva_api_contract.
  calva-api ≡ {
    :repl     {:evaluateCode, :currentSessionKey, :onOutputLogged}
    :ranges   {:currentTopLevelForm, :currentEnclosingForm, ...}
    :editor   {:replace}
    :document {:getNamespace, :getNamespaceAndNsForm}
    :info     {:getSymbolInfo, :getClojureDocsDotOrg}
  }
  | accessed_at: integrations.calva.api/calva-api
  | capability_gated: tools_appear_disappear_based_on_calva_support

λ structural_editing_contract.
  editing_unit ≡ top_level_form | ¬lines_of_text
  | parinfer: bracket_balancing | integrations/parinfer.cljs
  | targeting: targetLineText + line ±2 scan_window
  | rich_comments: forms_inside(comment ...) ≡ top_level
  | diagnostic_context: 21_line_window | line_numbers | → arrow_marker
  | bottom_to_top: multiple_edits_highest_line_first

Read the full file on GitHub · 268 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 268 lines · 82 tokens per session scan A 77c93ee3b7dd

Subscribe to this mod's changes

backseat-driver-internals is a skill published in the GitHub repository BetterThanTomorrow/calva-backseat-driver (64 stars, last pushed 2d ago), licensed MIT. It adds 82 tokens to every session and 3,175 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

lore

SpecStory Lore - mine your SpecStory coding histories (any agent - Claude Code, Codex, Cursor, Gemini, and more) into a persistent corpus, surface your reproducible workflows with corroborated evidence, and interactively forge the chosen ones into skills installed across all your agent harnesses. Use when the user…

specstoryai/getspecstory · 109 tokens

workthreads

SpecStory Workthreads - a weekly work-thread rollup across a team's repos from SpecStory coding histories (any agent - Claude Code, Codex, Cursor, Gemini, and more). It groups the window's sessions into threads of work per project and labels each new / open / recently closed, so a lead sees what shipped, what is still…

specstoryai/getspecstory · 126 tokens

mcp-server-dev

Use when the user asks to build an MCP server, create an MCP integration, wrap an API for AI agents, or expose tools via the Model Context Protocol. Guides through deployment model selection (remote HTTP, MCPB, local stdio), tool-design patterns, and framework choice before scaffolding code.

euxx/claude-skills-for-copilot · 65 tokens

open-source

Documentation reference for writing Python code using the browser-use open-source library. Use this skill whenever the user needs help with Agent, Browser, or Tools configuration, is writing code that imports from browseruse, asks about @sandbox deployment, supported LLM models, Actor API, custom tools, lifecycle…

browser-use/browser-use · 137 tokens

chart

Use when the user asks to visualize data with charts, graphs, or plots using the chart tool (bar, line, scatter, pie, time series, etc.).

Kilo-Org/kilocode · 37 tokens

omh-backend

This is a Hermes-native backend workflow skill.

rlaope/oh-my-hermes · 68 tokens