agentpack-cli 0.1.25__tar.gz → 0.1.27__tar.gz

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.
Files changed (85) hide show
  1. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/PKG-INFO +45 -36
  2. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/README.md +44 -35
  3. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/pyproject.toml +1 -1
  4. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/__init__.py +1 -1
  5. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/hook_cmd.py +116 -7
  6. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/init.py +57 -0
  7. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/stats.py +4 -1
  8. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/status.py +27 -2
  9. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/config.py +12 -0
  10. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/data/agentpack.md +5 -4
  11. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/installers/antigravity.py +8 -0
  12. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/installers/codex.py +2 -0
  13. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/installers/cursor.py +9 -4
  14. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/installers/windsurf.py +4 -2
  15. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/renderers/markdown.py +3 -2
  16. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/.gitignore +0 -0
  17. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/LICENSE +0 -0
  18. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/__init__.py +0 -0
  19. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/antigravity.py +0 -0
  20. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/base.py +0 -0
  21. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/claude.py +0 -0
  22. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/codex.py +0 -0
  23. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/cursor.py +0 -0
  24. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/detect.py +0 -0
  25. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/generic.py +0 -0
  26. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/adapters/windsurf.py +0 -0
  27. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/__init__.py +0 -0
  28. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/dependency_graph.py +0 -0
  29. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/go_imports.py +0 -0
  30. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/java_imports.py +0 -0
  31. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/js_ts_imports.py +0 -0
  32. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/python_imports.py +0 -0
  33. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/ranking.py +0 -0
  34. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/rust_imports.py +0 -0
  35. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/symbols.py +0 -0
  36. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/analysis/tests.py +0 -0
  37. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/application/__init__.py +0 -0
  38. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/application/pack_service.py +0 -0
  39. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/cli.py +0 -0
  40. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/__init__.py +0 -0
  41. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/_shared.py +0 -0
  42. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/benchmark.py +0 -0
  43. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/claude_cmd.py +0 -0
  44. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/diff.py +0 -0
  45. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/doctor.py +0 -0
  46. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/explain.py +0 -0
  47. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/install.py +0 -0
  48. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/mcp_cmd.py +0 -0
  49. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/monitor.py +0 -0
  50. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/pack.py +0 -0
  51. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/quickstart.py +0 -0
  52. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/scan.py +0 -0
  53. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/summarize.py +0 -0
  54. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/commands/watch.py +0 -0
  55. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/__init__.py +0 -0
  56. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/bootstrap.py +0 -0
  57. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/cache.py +0 -0
  58. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/context_pack.py +0 -0
  59. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/diff.py +0 -0
  60. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/git.py +0 -0
  61. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/git_hooks.py +0 -0
  62. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/global_install.py +0 -0
  63. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/ignore.py +0 -0
  64. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/merkle.py +0 -0
  65. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/models.py +0 -0
  66. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/redactor.py +0 -0
  67. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/scanner.py +0 -0
  68. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/snapshot.py +0 -0
  69. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/token_estimator.py +0 -0
  70. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/core/vscode_tasks.py +0 -0
  71. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/installers/__init__.py +0 -0
  72. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/installers/claude.py +0 -0
  73. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/integrations/__init__.py +0 -0
  74. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/integrations/git_hooks.py +0 -0
  75. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/integrations/global_install.py +0 -0
  76. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/integrations/vscode_tasks.py +0 -0
  77. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/mcp_server.py +0 -0
  78. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/renderers/__init__.py +0 -0
  79. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/renderers/compact.py +0 -0
  80. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/renderers/receipts.py +0 -0
  81. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/session/__init__.py +0 -0
  82. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/session/state.py +0 -0
  83. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/summaries/__init__.py +0 -0
  84. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/summaries/base.py +0 -0
  85. {agentpack_cli-0.1.25 → agentpack_cli-0.1.27}/src/agentpack/summaries/offline.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: agentpack-cli
3
- Version: 0.1.25
3
+ Version: 0.1.27
4
4
  Summary: Task-aware context packing for AI coding agents — Claude, Cursor, Windsurf, Codex, and Antigravity
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -44,7 +44,7 @@ Description-Content-Type: text/markdown
44
44
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
45
45
  [![CI](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg)](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
46
46
 
47
- > **Status: alpha (v0.1.25).** Works, tested, used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Not yet validated across a wide range of repos. API may change before 1.0.
47
+ > **Status: alpha (v0.1.27).** Works, tested, used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Not yet validated across a wide range of repos. API may change before 1.0.
48
48
  >
49
49
  > **Platform note:** macOS and Linux are fully supported. Windows support is not yet implemented (git hooks use POSIX shell; the Claude Code session hooks use `python3`/`rm -f`). Contributions welcome.
50
50
 
@@ -102,8 +102,7 @@ agentpack quickstart --task "fix auth token expiry"
102
102
 
103
103
  # One-time setup per project
104
104
  cd your-project
105
- agentpack init # creates config, session, task.md nothing else needed
106
- agentpack install # auto-detects your IDE (optional but recommended)
105
+ agentpack init # creates config/session/task.md + detected agent integration
107
106
 
108
107
  # Every terminal session
109
108
  agentpack watch # keeps context fresh automatically — that's it
@@ -240,7 +239,7 @@ AgentPack is not a coding assistant. It's a context preparation tool. The output
240
239
 
241
240
  These tools have native file access via tool calls. Claude reads exactly the files it needs, on demand, per turn. Pre-packing context adds overhead without much benefit on small-to-medium repos.
242
241
 
243
- AgentPack's value here is different: `agentpack install --agent <x>` configures your agent to auto-inject a ranked context pack on session start and auto-repack whenever you commit. On large repos where tool-call exploration piles up across turns, this front-loads the cost once instead of paying per-turn.
242
+ AgentPack's value here is different: `agentpack init --agent <x>` configures your agent to read or inject a ranked context pack and auto-repack when the repo changes. On large repos where tool-call exploration piles up across turns, this front-loads the cost once instead of paying per-turn.
244
243
 
245
244
  ### Where agentpack genuinely wins
246
245
 
@@ -305,8 +304,7 @@ The full workflow:
305
304
 
306
305
  ```bash
307
306
  # One-time project setup
308
- agentpack init # creates config, session, task.md
309
- agentpack install # configure your agent (optional but recommended)
307
+ agentpack init # creates config/session/task.md + detected agent integration
310
308
 
311
309
  # Every terminal session — just one command
312
310
  agentpack watch # auto-resumes session, refreshes context on file/task changes
@@ -321,11 +319,11 @@ Then open Claude Code / Cursor / Codex and write your coding task normally.
321
319
 
322
320
  | Agent | Automation level | Method |
323
321
  |---|---|---|
324
- | Claude Code (hook) | Highest | `UserPromptSubmit` hook auto-injects context |
325
- | Codex | Medium | `AGENTS.md` + `init` + `watch` |
326
- | Cursor | Medium | `.cursor/rules/agentpack.mdc` + `init` + `watch` |
327
- | Windsurf | Medium | `.windsurfrules` + `init` + `watch` |
328
- | Antigravity | Medium | `.agent/skills/agentpack/SKILL.md` + `GEMINI.md` + `init` + `watch` |
322
+ | Claude Code (hook) | Highest | `init` writes `CLAUDE.md`, `.claude/settings.json` hooks, and `.mcp.json` |
323
+ | Codex | Medium | `init` writes `AGENTS.md` + git hooks |
324
+ | Cursor | Medium | `init` writes `.cursorrules`, `.cursor/rules/agentpack.mdc`, VS Code task + git hooks |
325
+ | Windsurf | Medium | `init` writes `.windsurfrules`, VS Code task + git hooks |
326
+ | Antigravity | Medium | `init` writes `GEMINI.md`, VS Code task + git hooks |
329
327
  | Generic | Basic | `watch` mode + read `context.md` |
330
328
 
331
329
  ### Honest limitations
@@ -342,8 +340,7 @@ Then open Claude Code / Cursor / Codex and write your coding task normally.
342
340
  ```bash
343
341
  pip install agentpack-cli
344
342
  cd your-project
345
- agentpack init # one-time setup: config + session + task.md
346
- agentpack install # auto-detects your IDE (Claude Code, Cursor, Windsurf, Codex, Antigravity)
343
+ agentpack init # one-time setup: config/session/task.md + detected agent integration
347
344
  agentpack watch # in another terminal — keeps context fresh automatically
348
345
  ```
349
346
 
@@ -357,38 +354,38 @@ agentpack global-install # apply
357
354
  source ~/.zshrc
358
355
  ```
359
356
 
360
- Then opt each project in: `cd your-project && agentpack init`. After that git hooks repack on commit and the Claude Code hook injects context on every session start — no manual steps.
357
+ Then opt each project in: `cd your-project && agentpack init`. After that repo hooks or shell hooks keep context fresh, and Claude Code gets prompt-time context hints — no manual steps.
361
358
 
362
359
  ---
363
360
 
364
361
  ## Agent setup
365
362
 
366
- Run once per project. Each command is idempotent safe to re-run, never clobbers unrelated config.
363
+ `agentpack init` is the normal one-command project setup. It creates `.agentpack/` state and installs the detected agent integration. Re-run it any time; integration writes are idempotent and never clobber unrelated config.
367
364
 
368
- `agentpack install` without `--agent` auto-detects the active IDE from environment variables and project files. Pass `--agent` explicitly to override.
365
+ Use `--agent` explicitly to override detection. `agentpack install` remains available when you only want to repair or reconfigure agent files without reinitializing project state.
369
366
 
370
367
  ### Claude Code
371
368
 
372
369
  ```bash
373
- agentpack install --agent claude
370
+ agentpack init --agent claude
374
371
  ```
375
372
 
376
373
  Configures:
377
374
  - `CLAUDE.md` — tells Claude to read the context pack before each task
378
375
  - `.claude/settings.json` — two hooks:
379
376
  - `SessionStart`: clears injection sentinel so first prompt gets context
380
- - `UserPromptSubmit`: runs `agentpack hook` — detects repo changes via `root_hash`, triggers background repack using your prompt as task. With MCP: emits Option-B hint (~100 tokens, task + top files). Without MCP: emits capped fallback (top 8 files, ≤3k chars)
377
+ - `UserPromptSubmit`: runs `agentpack hook` — detects repo changes via `root_hash`, detects clear task switches, updates `.agentpack/task.md`, and triggers background repack using your prompt as task. With MCP: emits Option-B hint (~100 tokens, task + top files). Without MCP: emits capped fallback (top 8 files, ≤3k chars)
381
378
 
382
379
  After this, context is injected automatically into every Claude Code session. No `/agentpack` command needed — it just happens.
383
380
 
384
381
  ### Cursor
385
382
 
386
383
  ```bash
387
- agentpack install --agent cursor
384
+ agentpack init --agent cursor
388
385
  ```
389
386
 
390
387
  Configures:
391
- - `.cursorrules` — rule: read `.agentpack/context.md` before every conversation
388
+ - `.cursorrules` — rule: write current task, run `agentpack pack --task auto`, then read `.agentpack/context.md`
392
389
  - `.cursor/rules/agentpack.mdc` — `alwaysApply: true` rule (Cursor v0.43+)
393
390
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
394
391
  - `.vscode/tasks.json` — "AgentPack: Repack context" in Command Palette + `runOn: folderOpen`
@@ -396,43 +393,42 @@ Configures:
396
393
  ### Windsurf
397
394
 
398
395
  ```bash
399
- agentpack install --agent windsurf
396
+ agentpack init --agent windsurf
400
397
  ```
401
398
 
402
399
  Configures:
403
- - `.windsurfrules` — rule: read `.agentpack/context.md` before every conversation
400
+ - `.windsurfrules` — rule: write current task, run `agentpack pack --task auto`, then read `.agentpack/context.md`
404
401
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
405
402
  - `.vscode/tasks.json` — "AgentPack: Repack context" in Command Palette + `runOn: folderOpen`
406
403
 
407
404
  ### Codex
408
405
 
409
406
  ```bash
410
- agentpack install --agent codex
407
+ agentpack init --agent codex
411
408
  ```
412
409
 
413
410
  Configures:
414
- - `AGENTS.md` — tells Codex to read the context pack before each task
411
+ - `AGENTS.md` — tells Codex to write current task, repack, and read the context pack before each task
415
412
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
416
413
 
417
414
  ### Antigravity
418
415
 
419
416
  ```bash
420
- agentpack install --agent antigravity
417
+ agentpack init --agent antigravity
421
418
  ```
422
419
 
423
420
  Configures:
424
- - `.agent/skills/agentpack/SKILL.md` — AgentPack context as a Skill; Antigravity activates it automatically for coding tasks
425
- - `GEMINI.md` — registers the agentpack skill reference
421
+ - `GEMINI.md` — registers the agentpack skill reference and task-switch protocol
426
422
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
427
423
  - `.vscode/tasks.json` — "AgentPack: Repack context" in Command Palette + `runOn: folderOpen`
428
424
 
429
- The Skill descriptor activates AgentPack automatically no `--task` flag required when working in Antigravity.
425
+ `agentpack pack` writes `.agent/skills/agentpack/SKILL.md`, which Antigravity can activate automatically for coding tasks.
430
426
 
431
427
  ### Auto-repack comparison
432
428
 
433
429
  | Mechanism | Claude Code | Cursor | Windsurf | Codex | Antigravity |
434
430
  |---|---|---|---|---|---|
435
- | Config file patched | `CLAUDE.md` + `.claude/settings.json` | `.cursorrules` + `.cursor/rules/*.mdc` | `.windsurfrules` | `AGENTS.md` | `.agent/skills/agentpack/SKILL.md` + `GEMINI.md` |
431
+ | Config file patched | `CLAUDE.md` + `.claude/settings.json` | `.cursorrules` + `.cursor/rules/*.mdc` | `.windsurfrules` | `AGENTS.md` | `GEMINI.md` + generated `.agent/skills/agentpack/SKILL.md` after pack |
436
432
  | Auto-inject on startup | ✅ `UserPromptSubmit` hook | ✅ `alwaysApply` | ✅ rules file | ✅ `AGENTS.md` | ✅ Skill auto-activation |
437
433
  | Auto-repack when stale | ✅ hook (content hash via `root_hash`, ~1ms when fresh) | ✅ git hooks | ✅ git hooks | ✅ git hooks | ✅ git hooks |
438
434
  | Manual repack shortcut | ✅ `/agentpack` slash cmd | ✅ VS Code task | ✅ VS Code task | `agentpack pack` | ✅ VS Code task |
@@ -546,7 +542,7 @@ agentpack global-install --agent antigravity # Antigravity
546
542
  What it does:
547
543
  - **Git template hooks** (`~/.git-templates/hooks/`) — git copies these into every repo on `git init` / `git clone`. On `post-commit`, `post-merge`, `post-checkout`: silently repacks **only if `.agentpack/config.toml` exists** — no-op in repos that haven't opted in.
548
544
  - **Shell cd hook** (`~/.zshrc` or `~/.bashrc`) — on `cd`, repacks if stale **only in opted-in repos**. Never touches repos without `.agentpack/config.toml`. Never auto-inits.
549
- - **Agent config** — same as `agentpack install --agent <x>` for the current project.
545
+ - **Agent config** — same agent-specific files that `agentpack init --agent <x>` or `agentpack install --agent <x>` writes for the current project.
550
546
 
551
547
  All changes are idempotent, reversible, and non-destructive. Existing hooks and rc files are appended to, never overwritten. Repos you haven't explicitly run `agentpack init` in are never touched.
552
548
 
@@ -637,6 +633,7 @@ Initialize AgentPack in the current directory.
637
633
  ```bash
638
634
  agentpack init # interactive mode picker
639
635
  agentpack init --yes # non-interactive, use defaults (good for CI)
636
+ agentpack init --agent codex # force an agent integration
640
637
  agentpack init --share-cache # commit cache/ to git for team sharing
641
638
  ```
642
639
 
@@ -651,11 +648,19 @@ Creates:
651
648
  snapshots/ # file hash snapshots
652
649
  ```
653
650
 
651
+ Also installs the detected agent integration:
652
+ - Claude: `CLAUDE.md`, `.claude/settings.json` hooks, `.mcp.json`
653
+ - Cursor: `.cursorrules`, `.cursor/rules/agentpack.mdc`, git hooks, VS Code task
654
+ - Windsurf: `.windsurfrules`, git hooks, VS Code task
655
+ - Codex: `AGENTS.md`, git hooks
656
+ - Antigravity: `GEMINI.md`, git hooks, VS Code task
657
+ - Generic: no agent-specific files
658
+
654
659
  ---
655
660
 
656
661
  ### `agentpack install`
657
662
 
658
- Configure agentpack for your AI coding agent.
663
+ Repair or reconfigure agent-specific files without reinitializing project state.
659
664
 
660
665
  ```bash
661
666
  agentpack install # auto-detect IDE
@@ -663,7 +668,7 @@ agentpack install --agent claude # CLAUDE.md + .claude/settings.json hooks
663
668
  agentpack install --agent cursor # .cursorrules + .mdc + git hooks + VS Code tasks
664
669
  agentpack install --agent windsurf # .windsurfrules + git hooks + VS Code tasks
665
670
  agentpack install --agent codex # AGENTS.md + git hooks
666
- agentpack install --agent antigravity # .agent/skills/agentpack/SKILL.md + GEMINI.md + git hooks + VS Code tasks
671
+ agentpack install --agent antigravity # GEMINI.md + git hooks + VS Code tasks
667
672
  ```
668
673
 
669
674
  All installs are idempotent — safe to re-run, merge with existing config, never duplicate.
@@ -1063,6 +1068,10 @@ include_tests = true
1063
1068
  include_configs = true
1064
1069
  include_receipts = true
1065
1070
 
1071
+ [hooks]
1072
+ task_switch_detection = true
1073
+ task_switch_min_terms = 1
1074
+
1066
1075
  [agents.claude]
1067
1076
  output = ".agentpack/context.claude.md"
1068
1077
  patch_claude_md = true
@@ -1287,7 +1296,7 @@ src/agentpack/
1287
1296
  cursor.py # CursorInstaller: .cursorrules + .mdc + auto-repack
1288
1297
  windsurf.py # WindsurfInstaller: .windsurfrules + auto-repack
1289
1298
  codex.py # CodexInstaller: AGENTS.md + git hooks
1290
- antigravity.py # AntigravityInstaller: GEMINI.md + .agent/skills/ + auto-repack
1299
+ antigravity.py # AntigravityInstaller: GEMINI.md + auto-repack
1291
1300
 
1292
1301
  integrations/ # system/tool integration (not core domain)
1293
1302
  git_hooks.py # install/remove .git/hooks post-commit/merge/checkout
@@ -1392,7 +1401,7 @@ Add to `.github/workflows/agentpack-context.yml` — see the full example in [CI
1392
1401
 
1393
1402
  ```bash
1394
1403
  # One-time project setup
1395
- agentpack init # creates config, session, task.md
1404
+ agentpack init # creates config/session/task.md + detected agent integration
1396
1405
  # Edit .agentpack/task.md to set your task
1397
1406
 
1398
1407
  # Every terminal session — just one command
@@ -1495,7 +1504,7 @@ agentpack pack --task "fix bug" --budget 40000 # explicit token cap
1495
1504
  ### Watch mode for active sessions
1496
1505
 
1497
1506
  ```bash
1498
- agentpack init # one-time setup (creates session + task.md)
1507
+ agentpack init # one-time setup (creates session/task.md + detected agent integration)
1499
1508
  agentpack watch # in another terminal — auto-resumes each time
1500
1509
  ```
1501
1510
 
@@ -5,7 +5,7 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
  [![CI](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml/badge.svg)](https://github.com/vishal2612200/agentpack/actions/workflows/ci.yml)
7
7
 
8
- > **Status: alpha (v0.1.25).** Works, tested, used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Not yet validated across a wide range of repos. API may change before 1.0.
8
+ > **Status: alpha (v0.1.27).** Works, tested, used in real sessions. Python and JavaScript/TypeScript are the best-supported languages. Not yet validated across a wide range of repos. API may change before 1.0.
9
9
  >
10
10
  > **Platform note:** macOS and Linux are fully supported. Windows support is not yet implemented (git hooks use POSIX shell; the Claude Code session hooks use `python3`/`rm -f`). Contributions welcome.
11
11
 
@@ -63,8 +63,7 @@ agentpack quickstart --task "fix auth token expiry"
63
63
 
64
64
  # One-time setup per project
65
65
  cd your-project
66
- agentpack init # creates config, session, task.md nothing else needed
67
- agentpack install # auto-detects your IDE (optional but recommended)
66
+ agentpack init # creates config/session/task.md + detected agent integration
68
67
 
69
68
  # Every terminal session
70
69
  agentpack watch # keeps context fresh automatically — that's it
@@ -201,7 +200,7 @@ AgentPack is not a coding assistant. It's a context preparation tool. The output
201
200
 
202
201
  These tools have native file access via tool calls. Claude reads exactly the files it needs, on demand, per turn. Pre-packing context adds overhead without much benefit on small-to-medium repos.
203
202
 
204
- AgentPack's value here is different: `agentpack install --agent <x>` configures your agent to auto-inject a ranked context pack on session start and auto-repack whenever you commit. On large repos where tool-call exploration piles up across turns, this front-loads the cost once instead of paying per-turn.
203
+ AgentPack's value here is different: `agentpack init --agent <x>` configures your agent to read or inject a ranked context pack and auto-repack when the repo changes. On large repos where tool-call exploration piles up across turns, this front-loads the cost once instead of paying per-turn.
205
204
 
206
205
  ### Where agentpack genuinely wins
207
206
 
@@ -266,8 +265,7 @@ The full workflow:
266
265
 
267
266
  ```bash
268
267
  # One-time project setup
269
- agentpack init # creates config, session, task.md
270
- agentpack install # configure your agent (optional but recommended)
268
+ agentpack init # creates config/session/task.md + detected agent integration
271
269
 
272
270
  # Every terminal session — just one command
273
271
  agentpack watch # auto-resumes session, refreshes context on file/task changes
@@ -282,11 +280,11 @@ Then open Claude Code / Cursor / Codex and write your coding task normally.
282
280
 
283
281
  | Agent | Automation level | Method |
284
282
  |---|---|---|
285
- | Claude Code (hook) | Highest | `UserPromptSubmit` hook auto-injects context |
286
- | Codex | Medium | `AGENTS.md` + `init` + `watch` |
287
- | Cursor | Medium | `.cursor/rules/agentpack.mdc` + `init` + `watch` |
288
- | Windsurf | Medium | `.windsurfrules` + `init` + `watch` |
289
- | Antigravity | Medium | `.agent/skills/agentpack/SKILL.md` + `GEMINI.md` + `init` + `watch` |
283
+ | Claude Code (hook) | Highest | `init` writes `CLAUDE.md`, `.claude/settings.json` hooks, and `.mcp.json` |
284
+ | Codex | Medium | `init` writes `AGENTS.md` + git hooks |
285
+ | Cursor | Medium | `init` writes `.cursorrules`, `.cursor/rules/agentpack.mdc`, VS Code task + git hooks |
286
+ | Windsurf | Medium | `init` writes `.windsurfrules`, VS Code task + git hooks |
287
+ | Antigravity | Medium | `init` writes `GEMINI.md`, VS Code task + git hooks |
290
288
  | Generic | Basic | `watch` mode + read `context.md` |
291
289
 
292
290
  ### Honest limitations
@@ -303,8 +301,7 @@ Then open Claude Code / Cursor / Codex and write your coding task normally.
303
301
  ```bash
304
302
  pip install agentpack-cli
305
303
  cd your-project
306
- agentpack init # one-time setup: config + session + task.md
307
- agentpack install # auto-detects your IDE (Claude Code, Cursor, Windsurf, Codex, Antigravity)
304
+ agentpack init # one-time setup: config/session/task.md + detected agent integration
308
305
  agentpack watch # in another terminal — keeps context fresh automatically
309
306
  ```
310
307
 
@@ -318,38 +315,38 @@ agentpack global-install # apply
318
315
  source ~/.zshrc
319
316
  ```
320
317
 
321
- Then opt each project in: `cd your-project && agentpack init`. After that git hooks repack on commit and the Claude Code hook injects context on every session start — no manual steps.
318
+ Then opt each project in: `cd your-project && agentpack init`. After that repo hooks or shell hooks keep context fresh, and Claude Code gets prompt-time context hints — no manual steps.
322
319
 
323
320
  ---
324
321
 
325
322
  ## Agent setup
326
323
 
327
- Run once per project. Each command is idempotent safe to re-run, never clobbers unrelated config.
324
+ `agentpack init` is the normal one-command project setup. It creates `.agentpack/` state and installs the detected agent integration. Re-run it any time; integration writes are idempotent and never clobber unrelated config.
328
325
 
329
- `agentpack install` without `--agent` auto-detects the active IDE from environment variables and project files. Pass `--agent` explicitly to override.
326
+ Use `--agent` explicitly to override detection. `agentpack install` remains available when you only want to repair or reconfigure agent files without reinitializing project state.
330
327
 
331
328
  ### Claude Code
332
329
 
333
330
  ```bash
334
- agentpack install --agent claude
331
+ agentpack init --agent claude
335
332
  ```
336
333
 
337
334
  Configures:
338
335
  - `CLAUDE.md` — tells Claude to read the context pack before each task
339
336
  - `.claude/settings.json` — two hooks:
340
337
  - `SessionStart`: clears injection sentinel so first prompt gets context
341
- - `UserPromptSubmit`: runs `agentpack hook` — detects repo changes via `root_hash`, triggers background repack using your prompt as task. With MCP: emits Option-B hint (~100 tokens, task + top files). Without MCP: emits capped fallback (top 8 files, ≤3k chars)
338
+ - `UserPromptSubmit`: runs `agentpack hook` — detects repo changes via `root_hash`, detects clear task switches, updates `.agentpack/task.md`, and triggers background repack using your prompt as task. With MCP: emits Option-B hint (~100 tokens, task + top files). Without MCP: emits capped fallback (top 8 files, ≤3k chars)
342
339
 
343
340
  After this, context is injected automatically into every Claude Code session. No `/agentpack` command needed — it just happens.
344
341
 
345
342
  ### Cursor
346
343
 
347
344
  ```bash
348
- agentpack install --agent cursor
345
+ agentpack init --agent cursor
349
346
  ```
350
347
 
351
348
  Configures:
352
- - `.cursorrules` — rule: read `.agentpack/context.md` before every conversation
349
+ - `.cursorrules` — rule: write current task, run `agentpack pack --task auto`, then read `.agentpack/context.md`
353
350
  - `.cursor/rules/agentpack.mdc` — `alwaysApply: true` rule (Cursor v0.43+)
354
351
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
355
352
  - `.vscode/tasks.json` — "AgentPack: Repack context" in Command Palette + `runOn: folderOpen`
@@ -357,43 +354,42 @@ Configures:
357
354
  ### Windsurf
358
355
 
359
356
  ```bash
360
- agentpack install --agent windsurf
357
+ agentpack init --agent windsurf
361
358
  ```
362
359
 
363
360
  Configures:
364
- - `.windsurfrules` — rule: read `.agentpack/context.md` before every conversation
361
+ - `.windsurfrules` — rule: write current task, run `agentpack pack --task auto`, then read `.agentpack/context.md`
365
362
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
366
363
  - `.vscode/tasks.json` — "AgentPack: Repack context" in Command Palette + `runOn: folderOpen`
367
364
 
368
365
  ### Codex
369
366
 
370
367
  ```bash
371
- agentpack install --agent codex
368
+ agentpack init --agent codex
372
369
  ```
373
370
 
374
371
  Configures:
375
- - `AGENTS.md` — tells Codex to read the context pack before each task
372
+ - `AGENTS.md` — tells Codex to write current task, repack, and read the context pack before each task
376
373
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
377
374
 
378
375
  ### Antigravity
379
376
 
380
377
  ```bash
381
- agentpack install --agent antigravity
378
+ agentpack init --agent antigravity
382
379
  ```
383
380
 
384
381
  Configures:
385
- - `.agent/skills/agentpack/SKILL.md` — AgentPack context as a Skill; Antigravity activates it automatically for coding tasks
386
- - `GEMINI.md` — registers the agentpack skill reference
382
+ - `GEMINI.md` — registers the agentpack skill reference and task-switch protocol
387
383
  - `.git/hooks/post-commit`, `post-merge`, `post-checkout` — background repack on tree change
388
384
  - `.vscode/tasks.json` — "AgentPack: Repack context" in Command Palette + `runOn: folderOpen`
389
385
 
390
- The Skill descriptor activates AgentPack automatically no `--task` flag required when working in Antigravity.
386
+ `agentpack pack` writes `.agent/skills/agentpack/SKILL.md`, which Antigravity can activate automatically for coding tasks.
391
387
 
392
388
  ### Auto-repack comparison
393
389
 
394
390
  | Mechanism | Claude Code | Cursor | Windsurf | Codex | Antigravity |
395
391
  |---|---|---|---|---|---|
396
- | Config file patched | `CLAUDE.md` + `.claude/settings.json` | `.cursorrules` + `.cursor/rules/*.mdc` | `.windsurfrules` | `AGENTS.md` | `.agent/skills/agentpack/SKILL.md` + `GEMINI.md` |
392
+ | Config file patched | `CLAUDE.md` + `.claude/settings.json` | `.cursorrules` + `.cursor/rules/*.mdc` | `.windsurfrules` | `AGENTS.md` | `GEMINI.md` + generated `.agent/skills/agentpack/SKILL.md` after pack |
397
393
  | Auto-inject on startup | ✅ `UserPromptSubmit` hook | ✅ `alwaysApply` | ✅ rules file | ✅ `AGENTS.md` | ✅ Skill auto-activation |
398
394
  | Auto-repack when stale | ✅ hook (content hash via `root_hash`, ~1ms when fresh) | ✅ git hooks | ✅ git hooks | ✅ git hooks | ✅ git hooks |
399
395
  | Manual repack shortcut | ✅ `/agentpack` slash cmd | ✅ VS Code task | ✅ VS Code task | `agentpack pack` | ✅ VS Code task |
@@ -507,7 +503,7 @@ agentpack global-install --agent antigravity # Antigravity
507
503
  What it does:
508
504
  - **Git template hooks** (`~/.git-templates/hooks/`) — git copies these into every repo on `git init` / `git clone`. On `post-commit`, `post-merge`, `post-checkout`: silently repacks **only if `.agentpack/config.toml` exists** — no-op in repos that haven't opted in.
509
505
  - **Shell cd hook** (`~/.zshrc` or `~/.bashrc`) — on `cd`, repacks if stale **only in opted-in repos**. Never touches repos without `.agentpack/config.toml`. Never auto-inits.
510
- - **Agent config** — same as `agentpack install --agent <x>` for the current project.
506
+ - **Agent config** — same agent-specific files that `agentpack init --agent <x>` or `agentpack install --agent <x>` writes for the current project.
511
507
 
512
508
  All changes are idempotent, reversible, and non-destructive. Existing hooks and rc files are appended to, never overwritten. Repos you haven't explicitly run `agentpack init` in are never touched.
513
509
 
@@ -598,6 +594,7 @@ Initialize AgentPack in the current directory.
598
594
  ```bash
599
595
  agentpack init # interactive mode picker
600
596
  agentpack init --yes # non-interactive, use defaults (good for CI)
597
+ agentpack init --agent codex # force an agent integration
601
598
  agentpack init --share-cache # commit cache/ to git for team sharing
602
599
  ```
603
600
 
@@ -612,11 +609,19 @@ Creates:
612
609
  snapshots/ # file hash snapshots
613
610
  ```
614
611
 
612
+ Also installs the detected agent integration:
613
+ - Claude: `CLAUDE.md`, `.claude/settings.json` hooks, `.mcp.json`
614
+ - Cursor: `.cursorrules`, `.cursor/rules/agentpack.mdc`, git hooks, VS Code task
615
+ - Windsurf: `.windsurfrules`, git hooks, VS Code task
616
+ - Codex: `AGENTS.md`, git hooks
617
+ - Antigravity: `GEMINI.md`, git hooks, VS Code task
618
+ - Generic: no agent-specific files
619
+
615
620
  ---
616
621
 
617
622
  ### `agentpack install`
618
623
 
619
- Configure agentpack for your AI coding agent.
624
+ Repair or reconfigure agent-specific files without reinitializing project state.
620
625
 
621
626
  ```bash
622
627
  agentpack install # auto-detect IDE
@@ -624,7 +629,7 @@ agentpack install --agent claude # CLAUDE.md + .claude/settings.json hooks
624
629
  agentpack install --agent cursor # .cursorrules + .mdc + git hooks + VS Code tasks
625
630
  agentpack install --agent windsurf # .windsurfrules + git hooks + VS Code tasks
626
631
  agentpack install --agent codex # AGENTS.md + git hooks
627
- agentpack install --agent antigravity # .agent/skills/agentpack/SKILL.md + GEMINI.md + git hooks + VS Code tasks
632
+ agentpack install --agent antigravity # GEMINI.md + git hooks + VS Code tasks
628
633
  ```
629
634
 
630
635
  All installs are idempotent — safe to re-run, merge with existing config, never duplicate.
@@ -1024,6 +1029,10 @@ include_tests = true
1024
1029
  include_configs = true
1025
1030
  include_receipts = true
1026
1031
 
1032
+ [hooks]
1033
+ task_switch_detection = true
1034
+ task_switch_min_terms = 1
1035
+
1027
1036
  [agents.claude]
1028
1037
  output = ".agentpack/context.claude.md"
1029
1038
  patch_claude_md = true
@@ -1248,7 +1257,7 @@ src/agentpack/
1248
1257
  cursor.py # CursorInstaller: .cursorrules + .mdc + auto-repack
1249
1258
  windsurf.py # WindsurfInstaller: .windsurfrules + auto-repack
1250
1259
  codex.py # CodexInstaller: AGENTS.md + git hooks
1251
- antigravity.py # AntigravityInstaller: GEMINI.md + .agent/skills/ + auto-repack
1260
+ antigravity.py # AntigravityInstaller: GEMINI.md + auto-repack
1252
1261
 
1253
1262
  integrations/ # system/tool integration (not core domain)
1254
1263
  git_hooks.py # install/remove .git/hooks post-commit/merge/checkout
@@ -1353,7 +1362,7 @@ Add to `.github/workflows/agentpack-context.yml` — see the full example in [CI
1353
1362
 
1354
1363
  ```bash
1355
1364
  # One-time project setup
1356
- agentpack init # creates config, session, task.md
1365
+ agentpack init # creates config/session/task.md + detected agent integration
1357
1366
  # Edit .agentpack/task.md to set your task
1358
1367
 
1359
1368
  # Every terminal session — just one command
@@ -1456,7 +1465,7 @@ agentpack pack --task "fix bug" --budget 40000 # explicit token cap
1456
1465
  ### Watch mode for active sessions
1457
1466
 
1458
1467
  ```bash
1459
- agentpack init # one-time setup (creates session + task.md)
1468
+ agentpack init # one-time setup (creates session/task.md + detected agent integration)
1460
1469
  agentpack watch # in another terminal — auto-resumes each time
1461
1470
  ```
1462
1471
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentpack-cli"
3
- version = "0.1.25"
3
+ version = "0.1.27"
4
4
  description = "Task-aware context packing for AI coding agents — Claude, Cursor, Windsurf, Codex, and Antigravity"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
@@ -1,3 +1,3 @@
1
1
  """AgentPack — task-aware context packing for AI coding agents."""
2
2
 
3
- __version__ = "0.1.25"
3
+ __version__ = "0.1.27"