@anthropologies/claudestory 0.1.55 → 0.1.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # claudestory
2
2
 
3
- Cross-session context persistence for AI coding assistants. Tracks tickets, issues, roadmap phases, blockers, and session handovers in a `.story/` directory that AI tools read and write natively.
3
+ An agentic development framework. Track tickets, issues, and progress for your project in a `.story/` directory that AI tools read and write natively.
4
4
 
5
5
  ## Installation
6
6
 
package/dist/cli.js CHANGED
@@ -8358,7 +8358,7 @@ function getInstalledVersion() {
8358
8358
  }
8359
8359
  }
8360
8360
  function getRunningVersion() {
8361
- return "0.1.55";
8361
+ return "0.1.56";
8362
8362
  }
8363
8363
  var init_version_check = __esm({
8364
8364
  "src/autonomous/version-check.ts"() {
@@ -8965,7 +8965,7 @@ ${ticket.description}` : "",
8965
8965
  "# Autonomous Session Started",
8966
8966
  "",
8967
8967
  `You are now in autonomous mode. ${sessionDesc}${checkpointDesc}`,
8968
- "Do NOT stop to summarize. Do NOT ask the user. Pick a ticket or issue and start working immediately.",
8968
+ "Do NOT stop to summarize. Do NOT ask the user. Do NOT cancel for context management \u2014 compaction is automatic. Pick a ticket or issue and start working immediately.",
8969
8969
  "",
8970
8970
  "## Ticket Candidates",
8971
8971
  "",
@@ -8992,6 +8992,7 @@ ${ticket.description}` : "",
8992
8992
  "Do NOT ask the user for confirmation or approval.",
8993
8993
  "Do NOT stop or summarize between tickets \u2014 call autonomous_guide IMMEDIATELY.",
8994
8994
  "You are in autonomous mode \u2014 continue working until done.",
8995
+ "NEVER cancel due to context size. Claude Story's hooks compact context automatically and preserve all session state.",
8995
8996
  ...versionWarning ? [`**Warning:** ${versionWarning}`] : []
8996
8997
  ],
8997
8998
  transitionedFrom: "INIT"
@@ -9315,7 +9316,8 @@ ${driftPreamble}Recovered to state: **${mapping.state}**. Continue from here.`,
9315
9316
  reminders: [
9316
9317
  "Do NOT stop or summarize. Pick the next ticket IMMEDIATELY.",
9317
9318
  "Do NOT ask the user for confirmation.",
9318
- "You are in autonomous mode \u2014 continue working."
9319
+ "You are in autonomous mode \u2014 continue working.",
9320
+ "Context compacted successfully \u2014 all session state preserved. Continue working."
9319
9321
  ]
9320
9322
  });
9321
9323
  }
@@ -9417,6 +9419,30 @@ async function handleCancel(root, args) {
9417
9419
  if (info.state.state === "SESSION_END" || info.state.status === "completed") {
9418
9420
  return guideError(new Error("Session already ended."));
9419
9421
  }
9422
+ const isAutoMode = info.state.mode === "auto" || !info.state.mode;
9423
+ const hasTicketsRemaining = info.state.config.maxTicketsPerSession === 0 || info.state.completedTickets.length < info.state.config.maxTicketsPerSession;
9424
+ const isWorkingState = !["SESSION_END", "HANDOVER", "COMPACT"].includes(info.state.state);
9425
+ if (isAutoMode && hasTicketsRemaining && isWorkingState) {
9426
+ return {
9427
+ content: [{
9428
+ type: "text",
9429
+ text: [
9430
+ "# Cancel Rejected \u2014 Session Still Active",
9431
+ "",
9432
+ `You have completed ${info.state.completedTickets.length} ticket(s) with more work remaining.`,
9433
+ "Do NOT cancel an autonomous session due to context size.",
9434
+ "If you need to manage context, Claude Code handles compaction automatically.",
9435
+ "",
9436
+ "Continue working by calling `claudestory_autonomous_guide` with:",
9437
+ "```json",
9438
+ `{ "sessionId": "${info.state.sessionId}", "action": "report", "report": { "completedAction": "ticket_picked", "ticketId": "T-XXX" } }`,
9439
+ "```",
9440
+ "",
9441
+ "To force-cancel (admin only), run: `claudestory session stop`"
9442
+ ].join("\n")
9443
+ }]
9444
+ };
9445
+ }
9420
9446
  await recoverPendingMutation(info.dir, info.state, root);
9421
9447
  const cancelInfo = findSessionById(root, args.sessionId) ?? info;
9422
9448
  let ticketReleased = false;
@@ -9483,12 +9509,18 @@ function guideResult(state, currentState, opts) {
9483
9509
  contextPressure: state.contextPressure?.level ?? "low",
9484
9510
  branch: state.git?.branch ?? null
9485
9511
  };
9512
+ const allReminders = [...opts.reminders ?? []];
9513
+ if ((state.mode === "auto" || !state.mode) && currentState !== "SESSION_END") {
9514
+ allReminders.push(
9515
+ "NEVER cancel this session due to context size. Compaction is automatic \u2014 Claude Story preserves all session state across compactions via hooks."
9516
+ );
9517
+ }
9486
9518
  const output = {
9487
9519
  sessionId: state.sessionId,
9488
9520
  state: currentState,
9489
9521
  transitionedFrom: opts.transitionedFrom,
9490
9522
  instruction: opts.instruction,
9491
- reminders: opts.reminders ?? [],
9523
+ reminders: allReminders,
9492
9524
  contextAdvice: "ok",
9493
9525
  sessionSummary: summary
9494
9526
  };
@@ -10923,7 +10955,7 @@ var init_mcp = __esm({
10923
10955
  init_init();
10924
10956
  ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
10925
10957
  CONFIG_PATH2 = ".story/config.json";
10926
- version = "0.1.55";
10958
+ version = "0.1.56";
10927
10959
  main().catch((err) => {
10928
10960
  process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}
10929
10961
  `);
@@ -14354,7 +14386,7 @@ async function runCli() {
14354
14386
  registerSessionCommand: registerSessionCommand2,
14355
14387
  registerRepairCommand: registerRepairCommand2
14356
14388
  } = await Promise.resolve().then(() => (init_register(), register_exports));
14357
- const version2 = "0.1.55";
14389
+ const version2 = "0.1.56";
14358
14390
  class HandledError extends Error {
14359
14391
  constructor() {
14360
14392
  super("HANDLED_ERROR");
package/dist/index.d.ts CHANGED
@@ -1377,42 +1377,15 @@ declare const SnapshotV1Schema: z.ZodObject<{
1377
1377
  file: z.ZodString;
1378
1378
  message: z.ZodString;
1379
1379
  }, "strip", z.ZodTypeAny, {
1380
- type: string;
1381
1380
  message: string;
1381
+ type: string;
1382
1382
  file: string;
1383
1383
  }, {
1384
- type: string;
1385
1384
  message: string;
1385
+ type: string;
1386
1386
  file: string;
1387
1387
  }>, "many">>;
1388
1388
  }, "strip", z.ZodTypeAny, {
1389
- version: 1;
1390
- config: {
1391
- version: number;
1392
- type: string;
1393
- language: string;
1394
- project: string;
1395
- features: {
1396
- issues: boolean;
1397
- tickets: boolean;
1398
- handovers: boolean;
1399
- roadmap: boolean;
1400
- reviews: boolean;
1401
- } & {
1402
- [k: string]: unknown;
1403
- };
1404
- schemaVersion?: number | undefined;
1405
- recipe?: string | undefined;
1406
- recipeOverrides?: {
1407
- maxTicketsPerSession?: number | undefined;
1408
- compactThreshold?: string | undefined;
1409
- reviewBackends?: string[] | undefined;
1410
- handoverInterval?: number | undefined;
1411
- stages?: Record<string, Record<string, unknown>> | undefined;
1412
- } | undefined;
1413
- } & {
1414
- [k: string]: unknown;
1415
- };
1416
1389
  issues: z.objectOutputType<{
1417
1390
  id: z.ZodString;
1418
1391
  title: z.ZodString;
@@ -1449,8 +1422,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
1449
1422
  claimedBySession: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1450
1423
  }, z.ZodTypeAny, "passthrough">[];
1451
1424
  roadmap: {
1452
- date: string;
1453
1425
  title: string;
1426
+ date: string;
1454
1427
  phases: z.objectOutputType<{
1455
1428
  id: z.ZodString;
1456
1429
  label: z.ZodString;
@@ -1468,6 +1441,7 @@ declare const SnapshotV1Schema: z.ZodObject<{
1468
1441
  } & {
1469
1442
  [k: string]: unknown;
1470
1443
  };
1444
+ version: 1;
1471
1445
  project: string;
1472
1446
  notes: z.objectOutputType<{
1473
1447
  id: z.ZodString;
@@ -1493,19 +1467,11 @@ declare const SnapshotV1Schema: z.ZodObject<{
1493
1467
  status: z.ZodEnum<["active", "deprecated", "superseded"]>;
1494
1468
  }, z.ZodTypeAny, "passthrough">[];
1495
1469
  createdAt: string;
1496
- handoverFilenames: string[];
1497
- warnings?: {
1498
- type: string;
1499
- message: string;
1500
- file: string;
1501
- }[] | undefined;
1502
- }, {
1503
- version: 1;
1504
1470
  config: {
1505
- version: number;
1506
1471
  type: string;
1507
- language: string;
1472
+ version: number;
1508
1473
  project: string;
1474
+ language: string;
1509
1475
  features: {
1510
1476
  issues: boolean;
1511
1477
  tickets: boolean;
@@ -1527,6 +1493,13 @@ declare const SnapshotV1Schema: z.ZodObject<{
1527
1493
  } & {
1528
1494
  [k: string]: unknown;
1529
1495
  };
1496
+ handoverFilenames: string[];
1497
+ warnings?: {
1498
+ message: string;
1499
+ type: string;
1500
+ file: string;
1501
+ }[] | undefined;
1502
+ }, {
1530
1503
  issues: z.objectInputType<{
1531
1504
  id: z.ZodString;
1532
1505
  title: z.ZodString;
@@ -1563,8 +1536,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
1563
1536
  claimedBySession: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1564
1537
  }, z.ZodTypeAny, "passthrough">[];
1565
1538
  roadmap: {
1566
- date: string;
1567
1539
  title: string;
1540
+ date: string;
1568
1541
  phases: z.objectInputType<{
1569
1542
  id: z.ZodString;
1570
1543
  label: z.ZodString;
@@ -1582,8 +1555,35 @@ declare const SnapshotV1Schema: z.ZodObject<{
1582
1555
  } & {
1583
1556
  [k: string]: unknown;
1584
1557
  };
1558
+ version: 1;
1585
1559
  project: string;
1586
1560
  createdAt: string;
1561
+ config: {
1562
+ type: string;
1563
+ version: number;
1564
+ project: string;
1565
+ language: string;
1566
+ features: {
1567
+ issues: boolean;
1568
+ tickets: boolean;
1569
+ handovers: boolean;
1570
+ roadmap: boolean;
1571
+ reviews: boolean;
1572
+ } & {
1573
+ [k: string]: unknown;
1574
+ };
1575
+ schemaVersion?: number | undefined;
1576
+ recipe?: string | undefined;
1577
+ recipeOverrides?: {
1578
+ maxTicketsPerSession?: number | undefined;
1579
+ compactThreshold?: string | undefined;
1580
+ reviewBackends?: string[] | undefined;
1581
+ handoverInterval?: number | undefined;
1582
+ stages?: Record<string, Record<string, unknown>> | undefined;
1583
+ } | undefined;
1584
+ } & {
1585
+ [k: string]: unknown;
1586
+ };
1587
1587
  notes?: z.objectInputType<{
1588
1588
  id: z.ZodString;
1589
1589
  title: z.ZodNullable<z.ZodString>;
@@ -1608,8 +1608,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
1608
1608
  status: z.ZodEnum<["active", "deprecated", "superseded"]>;
1609
1609
  }, z.ZodTypeAny, "passthrough">[] | undefined;
1610
1610
  warnings?: {
1611
- type: string;
1612
1611
  message: string;
1612
+ type: string;
1613
1613
  file: string;
1614
1614
  }[] | undefined;
1615
1615
  handoverFilenames?: string[] | undefined;
package/dist/mcp.js CHANGED
@@ -7816,7 +7816,7 @@ function getInstalledVersion() {
7816
7816
  }
7817
7817
  }
7818
7818
  function getRunningVersion() {
7819
- return "0.1.55";
7819
+ return "0.1.56";
7820
7820
  }
7821
7821
 
7822
7822
  // src/autonomous/guide.ts
@@ -8439,7 +8439,7 @@ ${ticket.description}` : "",
8439
8439
  "# Autonomous Session Started",
8440
8440
  "",
8441
8441
  `You are now in autonomous mode. ${sessionDesc}${checkpointDesc}`,
8442
- "Do NOT stop to summarize. Do NOT ask the user. Pick a ticket or issue and start working immediately.",
8442
+ "Do NOT stop to summarize. Do NOT ask the user. Do NOT cancel for context management \u2014 compaction is automatic. Pick a ticket or issue and start working immediately.",
8443
8443
  "",
8444
8444
  "## Ticket Candidates",
8445
8445
  "",
@@ -8466,6 +8466,7 @@ ${ticket.description}` : "",
8466
8466
  "Do NOT ask the user for confirmation or approval.",
8467
8467
  "Do NOT stop or summarize between tickets \u2014 call autonomous_guide IMMEDIATELY.",
8468
8468
  "You are in autonomous mode \u2014 continue working until done.",
8469
+ "NEVER cancel due to context size. Claude Story's hooks compact context automatically and preserve all session state.",
8469
8470
  ...versionWarning ? [`**Warning:** ${versionWarning}`] : []
8470
8471
  ],
8471
8472
  transitionedFrom: "INIT"
@@ -8790,7 +8791,8 @@ ${driftPreamble}Recovered to state: **${mapping.state}**. Continue from here.`,
8790
8791
  reminders: [
8791
8792
  "Do NOT stop or summarize. Pick the next ticket IMMEDIATELY.",
8792
8793
  "Do NOT ask the user for confirmation.",
8793
- "You are in autonomous mode \u2014 continue working."
8794
+ "You are in autonomous mode \u2014 continue working.",
8795
+ "Context compacted successfully \u2014 all session state preserved. Continue working."
8794
8796
  ]
8795
8797
  });
8796
8798
  }
@@ -8892,6 +8894,30 @@ async function handleCancel(root, args) {
8892
8894
  if (info.state.state === "SESSION_END" || info.state.status === "completed") {
8893
8895
  return guideError(new Error("Session already ended."));
8894
8896
  }
8897
+ const isAutoMode = info.state.mode === "auto" || !info.state.mode;
8898
+ const hasTicketsRemaining = info.state.config.maxTicketsPerSession === 0 || info.state.completedTickets.length < info.state.config.maxTicketsPerSession;
8899
+ const isWorkingState = !["SESSION_END", "HANDOVER", "COMPACT"].includes(info.state.state);
8900
+ if (isAutoMode && hasTicketsRemaining && isWorkingState) {
8901
+ return {
8902
+ content: [{
8903
+ type: "text",
8904
+ text: [
8905
+ "# Cancel Rejected \u2014 Session Still Active",
8906
+ "",
8907
+ `You have completed ${info.state.completedTickets.length} ticket(s) with more work remaining.`,
8908
+ "Do NOT cancel an autonomous session due to context size.",
8909
+ "If you need to manage context, Claude Code handles compaction automatically.",
8910
+ "",
8911
+ "Continue working by calling `claudestory_autonomous_guide` with:",
8912
+ "```json",
8913
+ `{ "sessionId": "${info.state.sessionId}", "action": "report", "report": { "completedAction": "ticket_picked", "ticketId": "T-XXX" } }`,
8914
+ "```",
8915
+ "",
8916
+ "To force-cancel (admin only), run: `claudestory session stop`"
8917
+ ].join("\n")
8918
+ }]
8919
+ };
8920
+ }
8895
8921
  await recoverPendingMutation(info.dir, info.state, root);
8896
8922
  const cancelInfo = findSessionById(root, args.sessionId) ?? info;
8897
8923
  let ticketReleased = false;
@@ -8958,12 +8984,18 @@ function guideResult(state, currentState, opts) {
8958
8984
  contextPressure: state.contextPressure?.level ?? "low",
8959
8985
  branch: state.git?.branch ?? null
8960
8986
  };
8987
+ const allReminders = [...opts.reminders ?? []];
8988
+ if ((state.mode === "auto" || !state.mode) && currentState !== "SESSION_END") {
8989
+ allReminders.push(
8990
+ "NEVER cancel this session due to context size. Compaction is automatic \u2014 Claude Story preserves all session state across compactions via hooks."
8991
+ );
8992
+ }
8961
8993
  const output = {
8962
8994
  sessionId: state.sessionId,
8963
8995
  state: currentState,
8964
8996
  transitionedFrom: opts.transitionedFrom,
8965
8997
  instruction: opts.instruction,
8966
- reminders: opts.reminders ?? [],
8998
+ reminders: allReminders,
8967
8999
  contextAdvice: "ok",
8968
9000
  sessionSummary: summary
8969
9001
  };
@@ -10055,7 +10087,7 @@ async function ensureGitignoreEntries(gitignorePath, entries) {
10055
10087
  // src/mcp/index.ts
10056
10088
  var ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
10057
10089
  var CONFIG_PATH2 = ".story/config.json";
10058
- var version = "0.1.55";
10090
+ var version = "0.1.56";
10059
10091
  function tryDiscoverRoot() {
10060
10092
  const envRoot = process.env[ENV_VAR2];
10061
10093
  if (envRoot) {
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@anthropologies/claudestory",
3
- "version": "0.1.55",
4
- "license": "UNLICENSED",
5
- "description": "Cross-session context persistence for AI coding projects. Tracks tickets, issues, roadmap, and handovers so every session builds on the last.",
3
+ "version": "0.1.56",
4
+ "license": "PolyForm-Noncommercial-1.0.0",
5
+ "description": "An agentic development framework. Track tickets, issues, and progress for your project so every session builds on the last.",
6
6
  "keywords": [
7
7
  "claudestory",
8
8
  "claude-code",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: story
3
- description: Cross-session context persistence for AI coding projects. Load project context, manage sessions, guide setup.
3
+ description: Track tickets, issues, and progress for your project. Load project context, manage sessions, guide setup.
4
4
  ---
5
5
 
6
6
  # /story -- Project Context & Session Management
@@ -21,9 +21,21 @@ This file is referenced from SKILL.md for `/story auto`, `/story review`, `/stor
21
21
  - Follow the guide's instructions exactly -- it specifies which tools to call, what parameters to use
22
22
  - After each step completes, call `claudestory_autonomous_guide` with `action: "report"` and the results
23
23
 
24
+ **Recommended setup for long sessions:**
25
+
26
+ Run Claude Code with: `claude --model claude-opus-4-6 --dangerously-skip-permissions`
27
+
28
+ - **Skip-permissions** enables unattended execution -- no approval prompts consuming context
29
+ - **Claude Story handles compaction automatically** -- context preserved across compactions, do not cancel because context feels large
30
+ - Use only in **trusted repositories** -- skip-permissions disables safety prompts for all tool use
31
+
24
32
  **If the guide says to compact:** Call `claudestory_autonomous_guide` with `action: "pre_compact"`, then run `/compact`, then call with `action: "resume"`.
25
33
 
26
- **If something goes wrong:** Call `claudestory_autonomous_guide` with `action: "cancel"` to cleanly end the session.
34
+ **If something goes wrong:**
35
+ - Context feels large -- do nothing, compaction is automatic via hooks
36
+ - Compaction happened -- call with `action: "resume"` to continue
37
+ - Session stuck after compact -- run `claudestory session clear-compact` in terminal, then `action: "resume"`
38
+ - Unrecoverable error -- run `claudestory session stop` in terminal (admin escape hatch)
27
39
 
28
40
  ## Tiered Access -- Review, Plan, Guided Modes
29
41
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  This file is referenced from SKILL.md when no `.story/` directory exists but project indicators are present. SKILL.md has already determined that setup is needed before routing here.
4
4
 
5
+ **Skill command name:** When this file references `/story` in user-facing output, use the actual command that invoked you (e.g., `/story` for standalone install, `/story:go` for plugin install). Same for `/story auto` -- use `/story:go auto` if invoked as a plugin.
6
+
5
7
  **If arriving from Step 2b (scaffold detection):** The project already has an empty `.story/` scaffold but no tickets. Skip 1a and start at **1b. Existing Project -- Analyze**.
6
8
 
7
9
  ## Design Rules