Skip to main content

Universal agent activity ledger. Records what AI agents do.

Project description

inscript

Universal agent activity ledger.

When an AI agent works on code, inscript records everything: which project, which files, what changed. Any tool can read ~/.inscript/ for context.

Install

pip install inscript

What it records

~/.inscript/
  active_project              ← which codebase right now
  active_session              ← current session ID
  config.toml                 ← retention policy
  sessions/
    <session-id>/
      meta.json               ← start time, project, status
      touches.jsonl           ← every file read/edit/write
      diffs.jsonl             ← raw changes (Edit old→new, Write content hash)
      summary.json            ← stats written on session end
  overlap/
    <project-hash>.jsonl      ← when 2+ sessions touch the same files

Setup

inscript init    # configure retention, storage, diffs

Then add hooks to ~/.claude/settings.json:

{
  "hooks": {
    "SessionStart": [
      {
        "hooks": [{ "type": "command", "command": "inscript-hook" }]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "Read|Edit|Write|Glob|Grep",
        "hooks": [{ "type": "command", "command": "inscript-hook", "async": true }]
      }
    ],
    "Stop": [
      {
        "hooks": [{ "type": "command", "command": "inscript-hook" }]
      }
    ]
  }
}

CLI

inscript              # status: active project + session
inscript log          # activity log for current session
inscript log <id>     # activity log for a specific session
inscript overlap      # show file collisions across sessions
inscript export <id>  # export session as markdown
inscript cleanup      # enforce retention policy
inscript init         # setup wizard

Python API

from inscript_pkg import active_project, active_session, list_sessions

project = active_project()    # Path or None
session = active_session()    # session ID or None
all_sessions = list_sessions()  # [{session_id, start_time, project, status}, ...]

How it works

Three Claude Code hooks write to ~/.inscript/:

  • SessionStart → creates sessions/<id>/meta.json
  • PostToolUse → appends to touches.jsonl and diffs.jsonl
  • Stop → writes summary.json with session stats

Any MCP server, script, or tool can read these files. No coordination needed. The agent doesn't know inscript exists.

Overlap detection

When two Claude Code sessions work on the same project simultaneously, inscript records which files both sessions touch. Run inscript overlap to see collisions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inscript-0.2.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inscript-0.2.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file inscript-0.2.0.tar.gz.

File metadata

  • Download URL: inscript-0.2.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for inscript-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4fec59b83c0a8ac3e0d0875c6a582c54eaf2893e52b5e5e599a5c2be0f597501
MD5 5891df398b2c40b4f275ea58c74b157d
BLAKE2b-256 4896901b3d5dbf6106e59e82ec3d5c90f8cf0a143fbdfe764e4b02c0fd928057

See more details on using hashes here.

File details

Details for the file inscript-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: inscript-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for inscript-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 195c2d1775295d78ed29d5e504a3963d1fe848da9e14509cbc726c1fb8f2326d
MD5 7725b90cdf48f8ca83a8152a8436f499
BLAKE2b-256 f76027c14e41b513efe22a50291c234f367950b801fabb865b76981c5428d3a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page