Skip to content

Laravel Adapter ​

Retired

metadevs/ai-boost-laravel is retired and its repository is archived read-only. This page is kept for projects that still have it installed; nothing new should use it.

Run ai-boost init once in such a project. It converts .mcp.json to the HTTP transport, rewrites the generated instructions, and tells you when composer remove metadevs/ai-boost-laravel is safe. Do that sooner rather than later: of the 67 versions once published, only 4.4.0, 4.4.1 and 4.4.2 are still served, so a composer install against a lock pinning any earlier one fails.

How the adapter worked (history)

Package: metadevs/ai-boost-laravel

The Laravel adapter runs as a Composer package inside your Laravel project. It served the ai-boost tools to Claude Code as a local server, and provided Artisan commands for setup, indexing, and status checks.


Prerequisites ​

  • Docker running with your project's container up

  • An invitation to the project

  • Claude Code installed

  • PHP 8.2+ (8.2.x is enough — you do not need 8.3)

  • Laravel 10.49, 11, 12 or 13. On Laravel 10 the only installable laravel/mcp is the 0.5 line, which cannot run a local stdio server — indexing, hooks, status and init all work, and ai-boost:mcp prints the HTTP transport block to use instead. Laravel 9 and older are not supported.

  • The ai-boost CLI, on the machine that runs Claude Code — for the session hooks only. From adapter 2.0 the session hooks invoke the binary rather than shell scripts the package used to write, because that rule existed twice and a bug in it was present identically in both copies. Without the binary the MCP server, indexing, re-index-on-commit and generated instructions all still work — what is off is feedback recording and usage reporting, and nothing in a session says so. It cannot be a Composer dependency, being a standalone binary:

    sh
    curl -fsSL https://aiboost.metadevs.de/install.sh | sh
    ai-boost init          # in the project, on your own machine

    Your machine, not the container. php artisan ai-boost:init runs wherever artisan runs, which for most projects is inside Docker; Claude Code and its hooks run on your Mac, and the two do not share a filesystem. Running ai-boost:init in a container therefore registers no hooks and says so, rather than writing one that cannot start. php artisan ai-boost:status reports it as a problem until it is fixed.

If Composer refuses to install it

Composer reports the oldest releases it tried, not the one you asked for, so the error usually names a requirement the current release does not have — a php ^8.3 line while you are on 8.2 is the common one. PHP 8.2 is enough.

Make sure nothing pins the adapter to an old version, then composer clear-cache and retry. An ext-* "missing from your system" error in the same output belongs to one of your own project's dependencies, not to ai-boost.


Installation ​

Tell Composer where the package is (one line, no credentials) ​

The adapter is not on Packagist. It is published by ai-boost itself, so one repositories entry is all Composer needs:

bash
composer config repositories.ai-boost composer https://aiboost.metadevs.de/composer/metadevs/ai-boost-laravel

No token, no auth.json, no GitLab account. That endpoint is anonymous, and it is the same host the rest of ai-boost already talks to.

ai-boost init no longer installs the package; add the entry by hand if you still require it. Run the line above only if you are requiring the package by hand. CI needs nothing either: the entry lives in composer.json, so a pipeline that runs composer install inherits it.

Upgrading from the token-based setup

Earlier instructions had every developer create a GitLab personal access token and run composer config --global --auth gitlab-token.<your-gitlab-host> …. That is no longer needed. The entry in ~/.composer/auth.json does no harm if you leave it, but you can drop it:

bash
composer config --global --unset --auth gitlab-token.<your-gitlab-host>

Require the package ​

bash
composer require --dev metadevs/ai-boost-laravel

Or if it's already in composer.json:

bash
git checkout development
composer install

Already have laravel/boost installed?

laravel/boost sometimes locks laravel/mcp to a version older than the one your Laravel needs, and a plain composer require won't touch an already-locked package — so it fails with a version conflict. (This package accepts laravel/mcp: ^0.5|^0.6|^0.7, and on Laravel 10 the 0.5 line is the correct resolution rather than a problem — see the version table above.) Fix:

bash
composer require --dev metadevs/ai-boost-laravel -W --dry-run   # preview
composer require --dev metadevs/ai-boost-laravel -W             # apply

-W (--with-all-dependencies) is safe here: laravel/boost ^2.0 and laravel/mcp ^0.7.x resolve together.

Run both of the above inside your project's Docker container, not your host machine — some transitive dependencies expect PHP extensions (e.g. ext-grpc) baked into the container image but not present on a bare host PHP.


First-time Setup (~2 minutes) ​

Run init inside Docker:

bash
docker exec -it <container> php artisan ai-boost:init

Replace <container> with your project's Docker container name (e.g. acme-api).

What happens:

  • A URL opens in your browser → Google OAuth sign-in
  • After signing in, the browser shows a short authorisation code
  • Paste it back into the terminal
  • The command normalises the git remote URL (SSH → HTTPS, strips .git), finds the registered repository on the server, and auto-enrolls you as a project Member
  • Generates a personal ab_live_xxx API key, writes it to .env (only adds missing variables — never overwrites), and installs Claude Code hooks, .mcp.json, and a git post-commit hook

No project owner pre-step required — you are enrolled automatically via the git remote URL.

Flags (all optional):

FlagDescription
--skip-indexSkip the initial full index run after setup
--existingNon-interactive mode — reuses existing credentials, skips the OAuth flow; for CI/Composer scripts
--template=<name>Constitutional-rules template to seed (default: laravel-api)

Verify:

bash
docker exec <container> php artisan ai-boost:status

Output covers: API reachability (with chunk count, last index time and last job status) · the key · the git hook · .aiignore · .mcp.json · whether all eight session hooks are registered. --strict exits non-zero when anything is wrong, for CI.

If artisan runs in a container and no ai-boost binary is visible from inside it, that is expected rather than broken — the session hooks run on your machine, not in the container.

Open Claude Code:

bash
claude

MCP tools load automatically from .mcp.json. To confirm they're available:

ToolSearch("select:mcp__ai-boost__search_code_patterns")

You're live.


Daily Usage ​

You don't need to do anything differently. Eight Claude Code hooks and two git hooks run silently:

TriggerHookWhat it does
Session startai-boost hook session-startWarns if no key can be found, and points the agent at the semantic tools
First prompt submittedai-boost hook user-prompt-submitSnapshots which files were already modified, as a baseline for the Stop hook
record_agent_feedback is calledai-boost hook post-tool-useNotes that the score was given, so Stop stops asking. Matched to that one tool — it does not index
A subagent startsai-boost hook subagent-startTells it what the session was told — a subagent never receives SessionStart, so without this the agent most often delegated a search is the one least likely to know an index exists
A subagent finishesai-boost hook subagent-stopCounts it and notes its kind, so delegated work is visible in the Stop ask. It never blocks — several subagent types have no ai-boost tools
A compaction finishesai-boost hook post-compactRecords that it happened. A compaction summarises away what SessionStart injected; this event is the only place that is observable, and the next prompt restates the orientation once
The session goes awayai-boost hook session-endReports usage one last time. Stop fires only when a turn ends, so a session killed mid-turn spent tokens nothing recorded
Session end (code was changed)ai-boost hook stopAsks for record_agent_feedback if it is missing
git commit.git/hooks/post-commitIncremental index of the files that commit touched
git pull / git merge that changed anything.git/hooks/post-mergeIndexes the whole range the pull brought (--since=ORIG_HEAD), fast-forwards included — a teammate's merged branch reaches your index without you committing anything

Both git hooks run in the background and append their output to .ai-boost/hook.log rather than writing into your terminal, so git commit and git pull stay as quiet as they were before. That log is where to look if an index run failed; ai-boost:status reads it too.

At session end: Claude calls record_agent_feedback automatically when the stop hook detects code changes. For read-only or trivial sessions, Claude can include SKIP_FEEDBACK in its final response to bypass the check.


Using the MCP Tools ​

Load tool schemas once at the start of any coding session:

text
ToolSearch("select:mcp__ai-boost__search_code_patterns,mcp__ai-boost__record_agent_feedback,mcp__ai-boost__get_few_shot_examples,mcp__ai-boost__find_relevant_instructions,mcp__ai-boost__query_agent_feedback,mcp__ai-boost__search_commit_history")
ToolWhen to use
search_code_patterns(query)Before writing code — find existing patterns in the codebase
get_few_shot_examples(task_type)Before writing code — see high-quality past sessions for this task type
find_relevant_instructions(context)Check project conventions relevant to the current task
search_commit_history(query)Understand the history and reasoning behind existing code
record_agent_feedback(session_id, score, ...)At session end — rate the session quality
query_agent_feedback(k)Review recent session quality trends

See the MCP API Reference for full parameter documentation.


Re-indexing ​

Incremental indexing happens automatically on both of the ways code arrives: post-commit after a commit, and post-merge after a pull or merge that changed anything. It is not tied to file edits — the PostToolUse hook is matched to record_agent_feedback alone and does no indexing.

post-checkout is deliberately not installed. It fires for file checkouts and clones as well as branch switches, and the index holds one state per repository rather than one per branch — so hooking it would make switching branches overwrite the index with whatever tree happened to be out.

Manual commands:

bash
# Full re-index
docker exec <container> php artisan ai-boost:index

# Incremental — only files changed since last index
docker exec <container> php artisan ai-boost:index --incremental

# Index files changed in a specific commit
docker exec <container> php artisan ai-boost:index --commit=<sha>

# Index specific files — literal relative paths, repeat --files for more than one
docker exec <container> php artisan ai-boost:index --files=app/Services/PaymentService.php --files=app/Models/User.php

# Everything that changed between <ref> and HEAD — what post-merge passes, and the manual
# equivalent after a large pull
docker exec <container> php artisan ai-boost:index --since=ORIG_HEAD

# Report what would be sent, and send nothing
docker exec <container> php artisan ai-boost:index --dry-run

--dry-run needs no API key and reaches no network — it builds the chunks, reports the count and the number of batches it would POST, and returns. That makes it the answer to "is my index stale?": compare its chunk count against the one ai-boost:status reports from the server. It also names the prune step explicitly on a full run, because pruning is the only part of indexing that deletes anything and so the part a preview most has to be clear it did not do.


Environment Variables ​

The init command writes these automatically — it only adds missing variables from .env.example and never overwrites existing values.

VariableDescription
AI_BOOST_KEYYour personal API key (ab_live_xxx). Set by ai-boost:init.
AI_BOOST_ARTISAN_CMDThe command prefix to run Artisan. Default: docker exec <container> php artisan. Set by init from .env.example.

Troubleshooting ​

AI_BOOST_KEY is not set warning at session start

Run docker exec -it <container> php artisan ai-boost:init. Existing credentials are reused — no re-authentication needed.

MCP tools unavailable / {"status": "unavailable"}

The ai-boost server is unreachable. Your session continues unblocked. Check https://aiboost.metadevs.de/up.

ai-boost:init fails at repo discovery

The repo is not registered yet, or the GitLab URL doesn't match. Register it either from the Developer Portal (create/open the project → Add Repository) or via ai-boost repo:add --gitlab=<url> on the CLI — either way works, no admin role required. Note that SSH remotes (git@host:path.git) are automatically converted to HTTPS and .git is stripped — make sure the registered URL is in HTTPS form without .git.

Re-running init (e.g. after .env reset)

bash
docker exec -it <container> php artisan ai-boost:init

Hooks and .claude/CLAUDE.md are re-written. Your existing key and index are preserved.

Uninstalling

bash
docker exec <container> php artisan ai-boost:uninstall

Removes the hook entries, the .mcp.json entry, and the .claude/CLAUDE.md section. Does not delete your key or index on the server. AI_BOOST_KEY is left in .env — remove it manually if needed.

Known issue — check settings afterwards

As of adapter 4.3.0 this command does not remove every hook it installed. It knows four event names (PostToolUse, SessionStart, Stop, UserPromptSubmit) and looks only in .claude/settings.json, while ai-boost:init registers eight events and writes them to .claude/settings.local.json instead whenever the binary resolves only by absolute path.

So SubagentStart, PostCompact, SubagentStop and SessionEnd are left behind, and if your hooks landed in settings.local.json none of them are removed. They point at a command that is no longer configured, which fails silently — the failure of a hook is not surfaced to the session. Open both files and delete any remaining entry whose command contains ai-boost hook.

The CLI's own ai-boost uninstall derives its list from the same enum that registers the hooks, so it has never had this gap.


What Gets Installed ​

ai-boost:init makes the following changes to your project:

FileChange
.envAdds AI_BOOST_KEY and AI_BOOST_ARTISAN_CMD — only missing variables, never overwrites
.mcp.jsonAdds ai-boost stdio server entry
.claude/settings.json or settings.local.jsonWires up eight hooks (SessionStart, SubagentStart, UserPromptSubmit, PostToolUse, PostCompact, SubagentStop, Stop, SessionEnd), each invoking the ai-boost binary. It lands in the shared settings.json when the binary resolves by bare name, and in the personal settings.local.json when only an absolute path works — a path only your machine has must not be committed for teammates to inherit
.claude/CLAUDE.mdAppends ai-boost usage section with workflow table and tool docs
.ai-boost/Created, and holds hook.log — the git hooks' output. Git-ignored (see below), and skipped by the indexer
.ai-boost/hooks/Nothing, from 2.0. Up to 1.x this held four bash scripts needing bash, jq and python3; a missing python3 made every hook a silent no-op. ai-boost:init now deletes them when it finds them, and ai-boost:status warns while the directory remains
.git/hooks/post-commit and post-mergeBoth re-index hooks. Written to whatever git rev-parse --git-path hooks resolves to, which is not .git/hooks if this repository or your global config sets core.hooksPath. Each is reported separately, so adding the second to a project that already had the first does not claim to have installed something it left alone
.gitignoreAdds /.ai-boost — and /.claude/settings.local.json when the hooks had to be registered there
.aiignoreCreated if missing, or merged with existing file — adds only missing patterns

Once set up, see the MCP API Reference for the full tool documentation used during daily development.