@gengjiawen/os-init 2.1.1 → 2.2.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.2.0](https://github.com/gengjiawen/os-init/compare/v2.1.1...v2.2.0) (2026-11-17)
4
+
5
+
6
+ ### Features
7
+
8
+ * keep Claude sessions for 370 days and compact at 178k ([#57](https://github.com/gengjiawen/os-init/issues/57)) ([757f75b](https://github.com/gengjiawen/os-init/commit/757f75bf02063dc43ee7c0565e6e620820532ece))
9
+
3
10
  ## [2.1.1](https://github.com/gengjiawen/os-init/compare/v2.1.0...v2.1.1) (2026-10-08)
4
11
 
5
12
 
@@ -9,9 +9,10 @@ const execa_1 = require("execa");
9
9
  const jsonc_parser_1 = require("jsonc-parser");
10
10
  const utils_1 = require("./utils");
11
11
  const CLAUDE_BASE_URL = 'https://ai.gengjiawen.com/api/claude/';
12
- const CLAUDE_AUTO_COMPACT_WINDOW = '128000';
12
+ const CLAUDE_AUTO_COMPACT_WINDOW = '178000';
13
13
  const CLAUDE_ATTRIBUTION_HEADER = '0';
14
14
  const CLAUDE_AUTO_MODE_SERVER = '0';
15
+ const CLAUDE_CLEANUP_PERIOD_DAYS = 370;
15
16
  function getClaudeSettingsDir() {
16
17
  return path.join(os.homedir(), '.claude');
17
18
  }
@@ -38,6 +39,7 @@ const CLAUDE_SETTINGS_TEMPLATE = `{
38
39
  "CLAUDE_CODE_AUTO_MODE_SERVER": "${CLAUDE_AUTO_MODE_SERVER}"
39
40
  },
40
41
  "includeCoAuthoredBy": false,
42
+ "cleanupPeriodDays": ${CLAUDE_CLEANUP_PERIOD_DAYS},
41
43
  "apiKeyHelper": "echo 'API_KEY_PLACEHOLDER'",
42
44
  "permissions": {
43
45
  "allow": [],
@@ -79,12 +79,13 @@ describe('writeClaudeConfig', () => {
79
79
  '"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"'
80
80
  )
81
81
  expect(claudeSettings).toContain(
82
- '"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "128000"'
82
+ '"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "178000"'
83
83
  )
84
84
  expect(claudeSettings).not.toContain('CLAUDE_CODE_DISABLE_1M_CONTEXT')
85
85
  expect(claudeSettings).not.toContain('CLAUDE_CODE_EFFORT_LEVEL')
86
86
  expect(claudeSettings).toContain('"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"')
87
87
  expect(claudeSettings).toContain('"CLAUDE_CODE_AUTO_MODE_SERVER": "0"')
88
+ expect(claudeSettings).toContain('"cleanupPeriodDays": 370')
88
89
 
89
90
  const vscodeSettings = fs.readFileSync(result.vscodeSettingsPath, 'utf8')
90
91
  expect(vscodeSettings).toContain('"editor.fontSize": 14')
@@ -95,7 +96,7 @@ describe('writeClaudeConfig', () => {
95
96
  '"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC"'
96
97
  )
97
98
  expect(vscodeSettings).toContain('"CLAUDE_CODE_AUTO_COMPACT_WINDOW"')
98
- expect(vscodeSettings).toContain('"128000"')
99
+ expect(vscodeSettings).toContain('"178000"')
99
100
  expect(vscodeSettings).not.toContain('CLAUDE_CODE_DISABLE_1M_CONTEXT')
100
101
  expect(vscodeSettings).toContain('"CLAUDE_CODE_ATTRIBUTION_HEADER"')
101
102
  expect(vscodeSettings).toContain('"CLAUDE_CODE_AUTO_MODE_SERVER"')
@@ -12,11 +12,13 @@ import {
12
12
  } from './utils'
13
13
 
14
14
  const CLAUDE_BASE_URL = 'https://ai.gengjiawen.com/api/claude/'
15
- const CLAUDE_AUTO_COMPACT_WINDOW = '128000'
15
+ const CLAUDE_AUTO_COMPACT_WINDOW = '178000'
16
16
  const CLAUDE_ATTRIBUTION_HEADER = '0'
17
17
  // The gateway does not pass auto-mode server classifier checks through.
18
18
  // Leave them off so Claude Code does not warn on every session.
19
19
  const CLAUDE_AUTO_MODE_SERVER = '0'
20
+ // Claude Code deletes session transcripts older than this on its cleanup sweep.
21
+ const CLAUDE_CLEANUP_PERIOD_DAYS = 370
20
22
 
21
23
  /** Return Claude settings directory path */
22
24
  function getClaudeSettingsDir(): string {
@@ -60,6 +62,7 @@ const CLAUDE_SETTINGS_TEMPLATE = `{
60
62
  "CLAUDE_CODE_AUTO_MODE_SERVER": "${CLAUDE_AUTO_MODE_SERVER}"
61
63
  },
62
64
  "includeCoAuthoredBy": false,
65
+ "cleanupPeriodDays": ${CLAUDE_CLEANUP_PERIOD_DAYS},
63
66
  "apiKeyHelper": "echo 'API_KEY_PLACEHOLDER'",
64
67
  "permissions": {
65
68
  "allow": [],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gengjiawen/os-init",
3
3
  "private": false,
4
- "version": "2.1.1",
4
+ "version": "2.2.0",
5
5
  "description": "",
6
6
  "main": "index.js",
7
7
  "bin": {